kplato

kptpart.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999, 2000 Torben Weis <weis@kde.org>
3 Copyright (C) 2004, 2005 Dag Andersen <danders@get2net.dk>
4 Copyright (C) 2006 Raphael Langerhorst <raphael.langerhorst@kdemail.net>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21
22#ifndef KPLATO_PART_H
23#define KPLATO_PART_H
24
25#include "kpttask.h"
26#include "kptconfig.h"
27#include "kptwbsdefinition.h"
28#include "kptxmlloaderobject.h"
29
30#include <KoDocument.h>
31#include <KoTextZoomHandler.h>
32
33class KoView;
34class KoCommandHistory;
35class KCommand;
36
37namespace KPlato
38{
39
40class View;
41class Project;
42class ProjectDialog;
43class ResourceGroup;
44class Context;
45class GanttView;
46
47class Part : public KoDocument, public KoTextZoomHandler {
48 TQ_OBJECT
49
50
51public:
52 Part(TQWidget *parentWidget = 0, const char *widgetName = 0,
53 TQObject* parent = 0, const char* name = 0,
54 bool singleViewMode = false);
55 ~Part();
56
57 virtual void paintContent(TQPainter& painter, const TQRect& rect,
58 bool transparent = false,
59 double zoomX = 1.0, double zoomY = 1.0);
60
61 virtual bool initDoc(InitDocFlags flags, TQWidget* parentWidget=0);
62
66 void editProject();
67
68 Project &getProject() { return *m_project; }
69 const Project &getProject() const { return *m_project; }
70
71 // The load and save functions. Look in the file kplato.dtd for info
72 virtual bool loadXML(TQIODevice *, const TQDomDocument &document);
73 virtual TQDomDocument saveXML();
74
75 bool saveOasis(KoStore*, KoXmlWriter*) { return false; }
76 bool loadOasis(const TQDomDocument &, KoOasisStyles &, const TQDomDocument&, KoStore *) { return false; }
77
78 void addCommand(KCommand * cmd, bool execute=true);
79
80 void setCommandType(int type);
81
82 Config &config() { return m_config; }
83
84 void generateWBS();
85 WBSDefinition &wbsDefinition() { return m_wbsDefinition; }
86
87 const XMLLoaderObject &xmlLoader() const { return m_xmlLoader; }
88protected:
89 virtual KoView* createViewInstance(TQWidget* parent, const char* name);
90
91protected slots:
92 void slotDocumentRestored();
93 void slotCommandExecuted();
94 void slotCopyContextFromView();
95 void slotViewDestroyed();
96
97private:
98 Project *m_project;
99 ProjectDialog *m_projectDialog;
100 TQWidget* m_parentWidget;
101 View *m_view;
102
107 GanttView* m_embeddedGanttView;
108 Context* m_embeddedContext;
109 bool m_embeddedContextInitialized;
110
111 KoCommandHistory *m_commandHistory;
112 bool m_update, m_calculate, m_baseline;
113
114 Config m_config;
115 Context *m_context;
116
117 WBSDefinition m_wbsDefinition;
118
119 XMLLoaderObject m_xmlLoader;
120};
121
122} //KPlato namespace
123
124#endif
Project is the main node in a project, it contains child nodes and possibly sub-projects.
Definition kptproject.h:52
This class represents a group of similar resources to be assigned to a task e.g.
Definition kptresource.h:66