customprojectpart.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2001-2002 by Bernd Gehrmann * 00003 * bernd@kdevelop.org * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 ***************************************************************************/ 00011 00012 #ifndef _CUSTOMPROJECTPART_H_ 00013 #define _CUSTOMPROJECTPART_H_ 00014 00015 #include <qdict.h> 00016 #include <qguardedptr.h> 00017 #include <qmap.h> 00018 #include <qdatetime.h> 00019 00020 #include <kdevproject.h> 00021 00022 class QListViewItem; 00023 class QPopupMenu; 00024 class QStringList; 00025 class KDialogBase; 00026 class CustomProjectWidget; 00027 class Context; 00028 class KSelectAction; 00029 00030 class CustomProjectPart : public KDevProject 00031 { 00032 Q_OBJECT 00033 00034 public: 00035 CustomProjectPart( QObject *parent, const char *name, const QStringList & ); 00036 ~CustomProjectPart(); 00037 00038 QStringList allMakeEnvironments() const; 00039 QString currentMakeEnvironment() const; 00040 00041 bool isDirty(); 00042 QStringList distFiles() const; 00043 00044 protected: 00045 virtual void openProject(const QString &dirName, const QString &projectName); 00046 virtual void closeProject(); 00047 00048 virtual QString projectDirectory() const; 00049 virtual QString projectName() const; 00050 virtual QString mainProgram(bool relative = false) const; 00051 virtual QString activeDirectory() const; 00052 virtual QStringList allFiles() const; 00053 virtual void addFile(const QString &fileName); 00054 virtual void addFiles ( const QStringList& fileList ); 00055 virtual void removeFile(const QString &fileName); 00056 virtual void removeFiles ( const QStringList &fileList ); 00057 virtual QString buildDirectory() const; 00058 virtual QString runDirectory() const; 00059 virtual QString runArguments() const; 00060 virtual DomUtil::PairList runEnvironmentVars() const; 00061 00062 00063 private slots: 00064 void projectConfigWidget(KDialogBase *dlg); 00065 void contextMenu(QPopupMenu *popup, const Context *context); 00066 void slotAddToProject(); 00067 void slotRemoveFromProject(); 00068 void slotChooseActiveDirectory(); 00069 void slotBuild(); 00070 void slotCompileFile(); 00071 void slotClean(); 00072 void slotExecute(); 00073 void updateTargetMenu(); 00074 void targetMenuActivated(int id); 00075 void updateMakeEnvironmentsMenu(); 00076 void makeEnvironmentsMenuActivated(int id); 00077 void slotCommandFinished( const QString& command ); 00078 void slotCommandFailed( const QString& command ); 00079 00080 private: 00081 void populateProject(); 00082 void saveProject(); 00083 void startMakeCommand(const QString &dir, const QString &target); 00084 QString makeEnvironment() const; 00085 00086 QString m_projectDirectory; 00087 QString m_projectName; 00088 QStringList m_sourceFiles; 00089 QPopupMenu *m_targetMenu; 00090 KSelectAction *m_makeEnvironmentsSelector; 00091 QStringList m_targets; 00092 QStringList m_contextAddFiles; 00093 QStringList m_contextRemoveFiles; 00094 QString m_contextDirName; 00095 00096 QMap<QString, QDateTime> m_timestamp; 00097 bool m_executeAfterBuild; 00098 QString m_buildCommand; 00099 bool m_lastCompilationFailed; 00100 }; 00101 00102 #endif