kplato
kptpart.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KPLATO_PART_H
00023 #define KPLATO_PART_H
00024
00025 #include "kpttask.h"
00026 #include "kptconfig.h"
00027 #include "kptwbsdefinition.h"
00028 #include "kptxmlloaderobject.h"
00029
00030 #include <KoDocument.h>
00031 #include <KoTextZoomHandler.h>
00032
00033 class KoView;
00034 class KoCommandHistory;
00035 class KCommand;
00036
00037 namespace KPlato
00038 {
00039
00040 class View;
00041 class Project;
00042 class ProjectDialog;
00043 class ResourceGroup;
00044 class Context;
00045 class GanttView;
00046
00047 class Part : public KoDocument, public KoTextZoomHandler {
00048 Q_OBJECT
00049
00050 public:
00051 Part(QWidget *parentWidget = 0, const char *widgetName = 0,
00052 QObject* parent = 0, const char* name = 0,
00053 bool singleViewMode = false);
00054 ~Part();
00055
00056 virtual void paintContent(QPainter& painter, const QRect& rect,
00057 bool transparent = FALSE,
00058 double zoomX = 1.0, double zoomY = 1.0);
00059
00060 virtual bool initDoc(InitDocFlags flags, QWidget* parentWidget=0);
00061
00065 void editProject();
00066
00067 Project &getProject() { return *m_project; }
00068 const Project &getProject() const { return *m_project; }
00069
00070
00071 virtual bool loadXML(QIODevice *, const QDomDocument &document);
00072 virtual QDomDocument saveXML();
00073
00074 bool saveOasis(KoStore*, KoXmlWriter*) { return false; }
00075 bool loadOasis(const QDomDocument &, KoOasisStyles &, const QDomDocument&, KoStore *) { return false; }
00076
00077 void addCommand(KCommand * cmd, bool execute=true);
00078
00079 void setCommandType(int type);
00080
00081 Config &config() { return m_config; }
00082
00083 void generateWBS();
00084 WBSDefinition &wbsDefinition() { return m_wbsDefinition; }
00085
00086 const XMLLoaderObject &xmlLoader() const { return m_xmlLoader; }
00087 protected:
00088 virtual KoView* createViewInstance(QWidget* parent, const char* name);
00089
00090 protected slots:
00091 void slotDocumentRestored();
00092 void slotCommandExecuted();
00093 void slotCopyContextFromView();
00094 void slotViewDestroyed();
00095
00096 private:
00097 Project *m_project;
00098 ProjectDialog *m_projectDialog;
00099 QWidget* m_parentWidget;
00100 View *m_view;
00101
00106 GanttView* m_embeddedGanttView;
00107 Context* m_embeddedContext;
00108 bool m_embeddedContextInitialized;
00109
00110 KoCommandHistory *m_commandHistory;
00111 bool m_update, m_calculate, m_baseline;
00112
00113 Config m_config;
00114 Context *m_context;
00115
00116 WBSDefinition m_wbsDefinition;
00117
00118 XMLLoaderObject m_xmlLoader;
00119 };
00120
00121 }
00122
00123 #endif
|