projectmanager.h
Go to the documentation of this file.00001 #ifndef __PROJECTMANAGER_H__ 00002 #define __PROJECTMANAGER_H__ 00003 00004 00005 #include <qstring.h> 00006 #include <qobject.h> 00007 #include <qdict.h> 00008 00009 00010 #include <kxmlguiclient.h> 00011 #include <kservice.h> 00012 00013 class KAction; 00014 class KSelectAction; 00015 class KService; 00016 class ProjectInfo; 00017 class ProjectSession; 00018 class KRecentFilesAction; 00019 class KDevPlugin; 00020 00021 00022 class ProjectInfo 00023 { 00024 public: 00025 KURL m_projectURL; 00026 QDomDocument m_document; 00027 QString m_projectPlugin, m_language, m_activeLanguage; 00028 QStringList m_ignoreParts, m_loadParts, m_keywords, m_secondaryLanguages; 00029 00030 QString sessionFile() const; 00031 }; 00032 00033 00034 class ProjectManager : public QObject, public KXMLGUIClient 00035 { 00036 Q_OBJECT 00037 00038 public: 00039 00040 ~ProjectManager(); 00041 00042 static QString projectDirectory( const QString& path, bool absolute ); 00043 00044 static ProjectManager *getInstance(); 00045 00046 void loadSettings(); 00047 void saveSettings(); 00048 void loadDefaultProject(); 00049 00050 bool projectLoaded() const; 00051 00052 KURL projectFile() const; 00053 00054 void createActions( KActionCollection* ac ); 00055 00056 ProjectSession* projectSession() const; 00057 00058 public slots: 00059 bool loadProject( const KURL& url); 00060 bool loadKDevelop2Project( const KURL& url); 00061 bool closeProject( bool exiting = false ); 00062 00063 private slots: 00064 void slotOpenProject(); 00065 void slotProjectOptions(); 00066 00067 void slotLoadProject(); 00068 00069 void loadLocalParts(); 00070 00071 void updateActiveLangMenu(); 00072 void switchLanguage(const QString& lang); 00073 00074 private: 00075 ProjectManager(); 00076 00077 void setupActions(); 00078 void getGeneralInfo(); 00079 00080 bool loadProjectFile(); 00081 bool saveProjectFile(); 00082 00083 bool loadProjectPart(); 00084 void unloadProjectPart(); 00085 00086 bool loadLanguageSupport(const QString& lang); 00087 void unloadLanguageSupport(); 00088 00089 ProjectInfo *m_info; 00090 00091 KAction *m_closeProjectAction, *m_projectOptionsAction; 00092 KRecentFilesAction *m_openRecentProjectAction; 00093 KSelectAction *m_activeLanguage; 00094 00095 static ProjectManager *s_instance; 00096 00097 ProjectSession* m_pProjectSession; 00098 }; 00099 00100 00101 #endif