summaryrefslogtreecommitdiffstats
path: root/buildtools/ant/antprojectpart.h
blob: 5831b0ee8b7f543bf40fa03283bd3825af41f3a5 (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#ifndef _ANTPROJECTPART_H_
#define _ANTPROJECTPART_H_


#include <tqstring.h>
#include <tqstringlist.h>
#include <tqmap.h>


class TQPopupMenu;


class KAction;
class KDialogBase;
class Context;
class ClassPathWidget;


#include "kdevbuildtool.h"


class AntOptionsWidget;


class AntOptions
{
public:

  AntOptions();

  enum Verbosity { Quiet, Verbose, Debug };

  TQString m_buildXML;
  TQString m_defaultTarget;
  TQStringList m_targets;
  TQMap<TQString,TQString> m_properties;
  TQMap<TQString,bool> m_defineProperties;
  Verbosity m_verbosity;
  
};


class AntProjectPart : public KDevBuildTool
{
  Q_OBJECT
  TQ_OBJECT

public:
	  
  AntProjectPart(TQObject *parent, const char *name, const TQStringList &args);
  ~AntProjectPart();
    TQStringList distFiles() const;


protected:

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

  virtual TQString projectDirectory() const;
  virtual TQString projectName() const;
  virtual TQString mainProgram() const;
  virtual TQString activeDirectory() const;
  virtual TQStringList allFiles() const;
  virtual TQString buildDirectory() const;
  virtual TQString runDirectory() const;
  virtual TQString runArguments() const;
  virtual TQString debugArguments() const;
  virtual DomUtil::PairList runEnvironmentVars() const;

  virtual void addFile(const TQString &fileName);
  virtual void addFiles ( const TQStringList &fileList );
  virtual void removeFile(const TQString &fileName);
  virtual void removeFiles ( const TQStringList& fileList );


private slots:

  void slotBuild();
  void slotTargetMenuActivated(int id);

  void projectConfigWidget(KDialogBase *dlg);
  void contextMenu(TQPopupMenu *popup, const Context *context);

  void optionsAccepted();

  void slotAddToProject();
  void slotRemoveFromProject();


private:

  void parseBuildXML();
  void fillMenu();
  void populateProject();

  void ant(const TQString &target);

  TQString m_projectDirectory, m_projectName;
  TQStringList m_classPath;

  TQStringList m_sourceFiles;

  AntOptions m_antOptions;

  KAction *m_buildProjectAction;

  TQPopupMenu *m_targetMenu;

  AntOptionsWidget *m_antOptionsWidget;
  ClassPathWidget *m_classPathWidget;

  TQString m_contextFileName;

};


#endif