trollprojectpart.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2003 by Thomas Hasart * 00003 * thasart@gmx.de * 00004 * Copyright (C) 2001-2002 by Bernd Gehrmann * 00005 * bernd@kdevelop.org * 00006 * Copyright (C) 2002 by Jakob Simon-Gaarde * 00007 * jakob@jsg.dk * 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 00016 #ifndef _TROLLPROJECTPART_H_ 00017 #define _TROLLPROJECTPART_H_ 00018 00019 #include <qdict.h> 00020 #include <qguardedptr.h> 00021 #include <qmap.h> 00022 #include <qdatetime.h> 00023 00024 #include "kdevproject.h" 00025 00026 class KDialogBase; 00027 class TrollProjectWidget; 00028 00029 00030 class TrollProjectPart : public KDevProject 00031 { 00032 Q_OBJECT 00033 00034 public: 00035 TrollProjectPart( QObject *parent, const char *name, const QStringList &args ); 00036 ~TrollProjectPart(); 00037 00038 bool isTMakeProject() const { return m_tmakeProject; } 00039 bool isDirty(); 00040 virtual Options options() const; 00041 QStringList distFiles() const; 00042 00043 protected: 00044 virtual void openProject(const QString &dirName, const QString &projectName); 00045 virtual void closeProject(); 00046 00047 virtual QString projectDirectory() const; 00048 virtual QString projectName() const; 00049 virtual QString mainProgram(bool relative = false) const; 00050 virtual QString activeDirectory() const; 00051 virtual QStringList allFiles() const; 00052 virtual void addFile(const QString &fileName); 00053 virtual void addFiles ( const QStringList &fileList ); 00054 virtual void removeFile(const QString &fileName); 00055 virtual void removeFiles ( const QStringList &fileList ); 00056 virtual QString& getQMakeHeader() {return m_qmakeHeader;} 00057 virtual QString buildDirectory() const; 00058 virtual QString runDirectory() const; 00059 virtual QString runArguments() const; 00060 virtual DomUtil::PairList runEnvironmentVars() const; 00061 00062 private slots: 00063 void projectConfigWidget(KDialogBase *dlg); 00064 // void slotBuild(); 00065 // void slotClean(); 00066 // void slotExecute(); 00067 void slotCommandFinished( const QString& command ); 00068 00069 private: 00070 // void startMakeCommand(const QString &dir, const QString &target); 00071 void startQMakeCommand(const QString &dir); 00072 void execute(const QString &directory, const QString &command); 00073 void queueCmd(const QString &dir, const QString &cmd); 00074 QString makeEnvironment(); 00075 00076 bool isValidQtDir( const QString& path ) const; 00077 QStringList availableQtDirList() const; 00078 00079 QGuardedPtr<TrollProjectWidget> m_widget; 00080 QString m_qmakeHeader; 00081 QString m_projectName; 00082 bool m_tmakeProject; 00083 00084 QMap<QString, QDateTime> m_timestamp; 00085 bool m_executeAfterBuild; 00086 QString m_buildCommand; 00087 QString m_defaultQtDir; 00088 QStringList m_availableQtDirList; 00089 00090 friend class TrollProjectWidget; 00091 friend class ProjectRunOptionsDlg; 00092 }; 00093 00094 #endif 00095