projectsession.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 projectsession.h - description 00003 ------------------- 00004 begin : 30 Nov 2002 00005 copyright : (C) 2002 by Falk Brettschneider 00006 email : falk@kdevelop.org 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 #ifndef _PROJECTSESSION_H_ 00018 #define _PROJECTSESSION_H_ 00019 00020 #include <qobject.h> 00021 #include <qdom.h> 00022 #include <qdict.h> 00023 #include <qvaluelist.h> 00024 00025 class QWidget; 00026 class KURL; 00027 class KDevPlugin; 00028 00035 class ProjectSession : public QObject 00036 { 00037 Q_OBJECT 00038 // methods 00039 public: 00040 ProjectSession(); 00041 virtual ~ProjectSession(); 00042 00044 bool saveToFile(const QString& fileName, const QValueList<KDevPlugin*> plugins ); 00045 00047 bool restoreFromFile(const QString& fileName, const QValueList<KDevPlugin*> plugins ); 00048 00049 signals: 00050 void sig_restoreMainWindowProperties(const QDomElement* el); 00051 void sig_saveMainWindowProperties(QDomElement* el); 00052 00053 void sig_restoreAdditionalViewProperties(const QString& viewName, const QDomElement* el); 00054 void sig_saveAdditionalViewProperties(const QString& viewName, QDomElement* el); 00055 00056 private slots: 00060 void loadDocument(); 00061 00062 private: 00064 void recreateDocs(QDomElement& el); 00066 void recreateViews(KURL& url, QDomElement docEl, bool activate); 00068 void initXMLTree(); 00069 00070 // attributes 00071 private: 00073 QDomDocument domdoc; 00074 00075 struct DocumentData 00076 { 00077 DocumentData() : line(0) {} 00078 KURL url; 00079 int line; 00080 QString type; 00081 bool activate; 00082 }; 00083 00084 QValueList<DocumentData> _docDataList; 00085 00086 }; 00087 00088 #endif // _PROJECTSESSION_H_