F:/KPlato/koffice/kplato/kptpart.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002   Copyright (C) 1998, 1999, 2000 Torben Weis <weis@kde.org>
00003   Copyright (C) 2004 - 2006 Dag Andersen <danders@get2net.dk>
00004   Copyright (C) 2006 Raphael Langerhorst <raphael.langerhorst@kdemail.net>
00005 
00006   This library is free software; you can redistribute it and/or
00007   modify it under the terms of the GNU Library General Public
00008   License as published by the Free Software Foundation; either
00009   version 2 of the License, or (at your option) any later version.
00010 
00011   This library is distributed in the hope that it will be useful,
00012   but WITHOUT ANY WARRANTY; without even the implied warranty of
00013   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014   Library General Public License for more details.
00015 
00016   You should have received a copy of the GNU Library General Public License
00017   along with this library; see the file COPYING.LIB.  If not, write to
00018   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019 * Boston, MA 02110-1301, USA.
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 KCommandHistory;
00035 class KCommand;
00036 
00037 namespace KPlato
00038 {
00039 
00040 class View;
00041 class Project;
00042 class MainProjectDialog;
00043 class ResourceGroup;
00044 class Context;
00045 class GanttView;
00046 
00047 class Part : public KoDocument, public KoTextZoomHandler
00048 {
00049     Q_OBJECT
00050 
00051 public:
00052     Part( QWidget *parentWidget = 0,
00053           QObject* parent = 0,
00054           bool singleViewMode = false );
00055     ~Part();
00056 
00057     virtual void paintContent( QPainter& painter, const QRect& rect,
00058                                bool transparent = FALSE,
00059                                double zoomX = 1.0, double zoomY = 1.0 );
00060 
00064     void editProject();
00065 
00066     Project &getProject() { return * m_project; }
00067     const Project &getProject() const { return * m_project; }
00068 
00069     // The load and save functions. Look in the file kplato.dtd for info
00070     virtual bool loadXML( QIODevice *, const QDomDocument &document );
00071     virtual QDomDocument saveXML();
00072 
00073     bool saveOasis( KoStore*, KoXmlWriter* ) { return false; }
00074     bool loadOasis( const QDomDocument &, KoOasisStyles &, const QDomDocument&, KoStore * ) { return false; }
00075 
00076     void addCommand( KCommand * cmd, bool execute = true );
00077 
00078     void setCommandType( int type );
00079 
00080     Config &config() { return m_config; }
00081 
00082     void generateWBS();
00083     WBSDefinition &wbsDefinition() { return m_wbsDefinition; }
00084 
00085     const XMLLoaderObject &xmlLoader() const { return m_xmlLoader; }
00086 protected:
00087     virtual KoView* createViewInstance( QWidget* parent );
00088 
00089 protected slots:
00090     void slotDocumentRestored();
00091     void slotCommandExecuted( KCommand * );
00092     void slotCopyContextFromView();
00093     void slotViewDestroyed();
00094 
00095 private:
00096     Project *m_project;
00097     MainProjectDialog *m_projectDialog;
00098     QWidget* m_parentWidget;
00099     View *m_view;
00100 
00105     GanttView* m_embeddedGanttView;
00106     Context* m_embeddedContext;
00107     bool m_embeddedContextInitialized;
00108 
00109     KCommandHistory *m_commandHistory;
00110     bool m_update, m_calculate;
00111 
00112     Config m_config;
00113     Context *m_context;
00114 
00115     WBSDefinition m_wbsDefinition;
00116 
00117     XMLLoaderObject m_xmlLoader;
00118 };
00119 
00120 }  //KPlato namespace
00121 
00122 #endif

Généré le Wed Nov 22 23:40:57 2006 pour KPlato par  doxygen 1.5.1-p1