karbon

karbon_part.h
1/* This file is part of the KDE project
2 Copyright (C) 2001, 2002, 2003 The Karbon Developers
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef __KARBON_PART_H__
21#define __KARBON_PART_H__
22
23
24#include <tqptrlist.h>
25
26#include <KoDocument.h>
27#include <KoUnit.h>
28#include "vdocument.h"
29#include "koffice_export.h"
30
31class DCOPObject;
32class KoRect;
33class TQRect;
34class VCommand;
35class VDocument;
36class VCommandHistory;
37
45class KARBONCOMMON_EXPORT KarbonPart : public KoDocument
46{
47 TQ_OBJECT
48
49public:
50 KarbonPart( TQWidget* parentWidget = 0L, const char* widgetName = 0L,
51 TQObject* parent = 0L, const char* name = 0L, bool singleViewMode = false );
52 virtual ~KarbonPart();
53
54 virtual void paintContent( TQPainter& painter, const TQRect& rect,
55 bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 );
56
58 virtual bool initDoc(InitDocFlags flags, TQWidget* parentWidget=0);
59
61 virtual bool loadXML( TQIODevice*, const TQDomDocument& document );
62 virtual bool loadOasis( const TQDomDocument &doc, KoOasisStyles &styles, const TQDomDocument &settings, KoStore *store );
63
65 virtual TQDomDocument saveXML();
66 virtual bool saveOasis( KoStore *store, KoXmlWriter *manifestWriter );
67
68 virtual void addShell( KoMainWindow *shell );
69
70 virtual DCOPObject* dcopObject();
71
73 void insertObject( VObject* object );
74
76 void addCommand( VCommand* cmd, bool repaint = false );
77
78 // access static document:
79 VDocument& document() { return m_doc; }
80
81 // Clear history.
82 void clearHistory();
83
86 {
87 return m_commandHistory;
88 }
89
90 bool showStatusBar() const
91 {
92 return m_bShowStatusBar;
93 }
94
95 void setShowStatusBar( bool b );
98 void reorganizeGUI();
99
100 void setUndoRedoLimit( int undos );
101
102 void initConfig();
103 unsigned int maxRecentFiles() const { return m_maxRecentFiles; }
104
105 void setPageLayout( KoPageLayout& layout, KoUnit::Unit _unit );
106
107 bool mergeNativeFormat( const TQString & file );
108
109public slots:
111 void repaintAllViews( bool repaint = true );
112 void repaintAllViews( const KoRect& );
113 void slotDocumentRestored();
114 void slotCommandExecuted( VCommand * );
115 void slotUnitChanged( KoUnit::Unit unit );
116
117protected:
118 virtual KoView* createViewInstance( TQWidget* parent, const char* name );
119 virtual void removeView( KoView *view );
120 void saveOasisSettings( KoXmlWriter &/*settingsWriter*/ );
121 void loadOasisSettings( const TQDomDocument&settingsDoc );
122
123private:
124 VDocument m_doc;
125 VCommandHistory* m_commandHistory;
126
127 bool m_bShowStatusBar;
128 bool m_merge;
129 unsigned int m_maxRecentFiles;
130 DCOPObject *dcop;
131};
132
133#endif
134
Keeps track of visual per document properties.
Definition karbon_part.h:46
VCommandHistory * commandHistory()
access the command history:
Definition karbon_part.h:85
Manages a set of commands.
Definition vcommand.h:144
The base class for all karbon commands.
Definition vcommand.h:42
All non-visual, static doc info is in here.
Definition vdocument.h:53
The base class for all karbon objects.
Definition vobject.h:50