diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-01-20 01:29:50 +0000 |
commit | 8362bf63dea22bbf6736609b0f49c152f975eb63 (patch) | |
tree | 0eea3928e39e50fae91d4e68b21b1e6cbae25604 /kplato/kptpart.h | |
download | koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip |
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kplato/kptpart.h')
-rw-r--r-- | kplato/kptpart.h | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/kplato/kptpart.h b/kplato/kptpart.h new file mode 100644 index 00000000..dbafa9f6 --- /dev/null +++ b/kplato/kptpart.h @@ -0,0 +1,123 @@ +/* This file is part of the KDE project + Copyright (C) 1998, 1999, 2000 Torben Weis <weis@kde.org> + Copyright (C) 2004, 2005 Dag Andersen <danders@get2net.dk> + Copyright (C) 2006 Raphael Langerhorst <raphael.langerhorst@kdemail.net> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. +*/ + +#ifndef KPLATO_PART_H +#define KPLATO_PART_H + +#include "kpttask.h" +#include "kptconfig.h" +#include "kptwbsdefinition.h" +#include "kptxmlloaderobject.h" + +#include <KoDocument.h> +#include <KoTextZoomHandler.h> + +class KoView; +class KoCommandHistory; +class KCommand; + +namespace KPlato +{ + +class View; +class Project; +class ProjectDialog; +class ResourceGroup; +class Context; +class GanttView; + +class Part : public KoDocument, public KoTextZoomHandler { + Q_OBJECT + +public: + Part(QWidget *parentWidget = 0, const char *widgetName = 0, + QObject* parent = 0, const char* name = 0, + bool singleViewMode = false); + ~Part(); + + virtual void paintContent(QPainter& painter, const QRect& rect, + bool transparent = FALSE, + double zoomX = 1.0, double zoomY = 1.0); + + virtual bool initDoc(InitDocFlags flags, QWidget* parentWidget=0); + + /** + * Edit the settings of the project + */ + void editProject(); + + Project &getProject() { return *m_project; } + const Project &getProject() const { return *m_project; } + + // The load and save functions. Look in the file kplato.dtd for info + virtual bool loadXML(QIODevice *, const QDomDocument &document); + virtual QDomDocument saveXML(); + + bool saveOasis(KoStore*, KoXmlWriter*) { return false; } + bool loadOasis(const QDomDocument &, KoOasisStyles &, const QDomDocument&, KoStore *) { return false; } + + void addCommand(KCommand * cmd, bool execute=true); + + void setCommandType(int type); + + Config &config() { return m_config; } + + void generateWBS(); + WBSDefinition &wbsDefinition() { return m_wbsDefinition; } + + const XMLLoaderObject &xmlLoader() const { return m_xmlLoader; } +protected: + virtual KoView* createViewInstance(QWidget* parent, const char* name); + +protected slots: + void slotDocumentRestored(); + void slotCommandExecuted(); + void slotCopyContextFromView(); + void slotViewDestroyed(); + +private: + Project *m_project; + ProjectDialog *m_projectDialog; + QWidget* m_parentWidget; + View *m_view; + + /** + * Used for drawing the project when embedded into another koffice app. + * @see paintContent() + */ + GanttView* m_embeddedGanttView; + Context* m_embeddedContext; + bool m_embeddedContextInitialized; + + KoCommandHistory *m_commandHistory; + bool m_update, m_calculate, m_baseline; + + Config m_config; + Context *m_context; + + WBSDefinition m_wbsDefinition; + + XMLLoaderObject m_xmlLoader; +}; + +} //KPlato namespace + +#endif |