summaryrefslogtreecommitdiffstats
path: root/buildtools/ada/adaproject_part.h
blob: 5511da78762b74fcc0495044cb43440e1e9e7377 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/* Copyright (C) 2003 Oliver Kellogg
 * okellogg@users.sourceforge.net
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 */
#ifndef __KDEVPART_ADAPROJECT_H__
#define __KDEVPART_ADAPROJECT_H__

#include <tqguardedptr.h>

#include "kdevbuildtool.h"

class AdaProjectWidget;
class KDialogBase;
class KDevCompilerOptions;

class AdaProjectPart : public KDevBuildTool
{
    Q_OBJECT
  
public:
    AdaProjectPart(TQObject *parent, const char *name, const TQStringList &);
    ~AdaProjectPart();

    virtual void openProject(const TQString &dirName, const TQString &projectName);
    virtual void closeProject();

    /**Returns the name of the main source file without extension.
       We assume that all Ada compilers call the binary that way.  */
    virtual TQString mainProgram() const;
    /**Main source file (like src/main.adb)*/
    virtual TQString mainSource() const;
    virtual void setMainSource(TQString fullPath);

    virtual TQString projectDirectory() const;
    virtual TQString projectName() const;
    virtual TQString activeDirectory() const;
    /**The location of the main source file*/
    virtual TQString buildDirectory() const;
    virtual TQString runDirectory() const;
    virtual TQString debugArguments() const;
    virtual TQString runArguments() const;
    virtual DomUtil::PairList runEnvironmentVars() const;

    /**Returns everything in the project directory*/
    virtual TQStringList allFiles() const;
    /**This does absolutelly nothing*/
    virtual void addFile(const TQString &fileName);
    /**This does absolutelly nothing*/
    virtual void addFiles(const TQStringList &fileList);
    /**This does absolutelly nothing*/
    virtual void removeFile(const TQString &fileName);
    /**This does absolutelly nothing*/
    virtual void removeFiles(const TQStringList &fileList);

    virtual void changedFiles( const TQStringList & fileList );
    virtual void changedFile( const TQString & fileName );

    KDevCompilerOptions *createCompilerOptions(const TQString &name);

    virtual TQString defaultOptions(const TQString compiler);
    TQStringList distFiles() const;

public slots:
    /**loads config from project file*/
    void loadProjectConfig();

private slots:
    void slotBuild();
    void slotExecute();
    void projectConfigWidget(KDialogBase *dlg);
    void configWidget(KDialogBase *dlg);

private:
    TQGuardedPtr<AdaProjectWidget> m_widget;

    void listOfFiles(TQStringList &result, TQString path) const;

    TQString m_buildDir;
    TQString m_projectDir;
    TQString m_projectName;

    TQString m_mainProg;
    TQString m_mainSource;
    TQString m_compilerExec;
    TQString m_compilerOpts;

    TQStringList m_sourceFiles;
};

#endif