30
39
class KivioStencilSpawner;
31
40
class KivioStencilSpawnerSet;
32
41
class KivioStackBar;
34
42
class KivioPainter;
35
43
class KivioStencil;
40
51
class QDomDocument;
42
#include <koDocument.h>
43
#include <koMainWindow.h>
44
#include "kivio_grid_data.h"
46
//#include <iostream.h>
49
#include <koprinter.h>
53
class KCommandHistory;
53
61
#define MIME_TYPE "application/x-kivio"
63
using namespace Kivio;
55
65
class KivioDoc : public KoDocument
57
friend class KivioPage;
59
KivioDoc( QWidget *parentWidget = 0, const char* widgetName = 0, QObject* parent = 0, const char* name = 0, bool singleViewMode = false );
62
virtual void addShell(KoMainWindow *shell);
64
virtual QDomDocument saveXML();
66
virtual bool loadXML( QIODevice *, const QDomDocument& doc );
68
virtual bool initDoc();
70
KivioOptions* config() { return m_options; }
72
virtual QCString mimeType() const { return MIME_TYPE; }
75
* @return a pointer to a new KivioPage. The KivioPage is not added to the map nor added to the GUI.
77
KivioPage* createPage();
80
* Adds a KivioPage to the GUI and makes it active. In addition the KivioPage is
86
void addPage( KivioPage* page );
89
* Adds a KivioStencilSpawnerSet to the list of spawner sets and make it active.
92
KivioStencilSpawnerSet *addSpawnerSet( QString );
93
KivioStencilSpawnerSet *addSpawnerSetDuringLoad( QString );
94
bool removeSpawnerSet( KivioStencilSpawnerSet * );
96
QList<KivioStencilSpawnerSet> *spawnerSets() { return m_pLstSpawnerSets; }
98
KivioStencilSpawner *findStencilSpawner( const QString& setId, const QString& stencilId );
99
KivioStencilSpawner *findInternalStencilSpawner( const QString& title );
101
KivioMap* map() const { return m_pMap; }
104
* @return TRUE if the document is currently loading.
106
bool isLoading() { return m_bLoading; }
108
virtual void paintContent( QPainter& painter, const QRect& rect, bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 );
109
void paintContent( KivioPainter& painter, const QRect& rect, bool transparent, KivioPage* page, QPoint, float, bool );
111
void printContent( KPrinter& prn );
112
bool exportPage( KivioPage *pPage, const QString &fileName, ExportPageDialog * );
114
static QList<KivioDoc>& documents();
116
KivioGroupStencil *clipboard();
117
void setClipboard( KivioGroupStencil * );
119
int units() { return m_units; }
121
KivioGridData grid() { return gridData; }
122
void setGrid(KivioGridData g) { gridData = g; emit sig_updateGrid();}
124
ViewItemList* viewItems() { return viewItemList; }
130
void updateView(KivioPage*, bool modified=true);
132
void slotDeleteStencilSet( DragBarButton *, QWidget *, KivioStackBar * );
133
void slotSelectionChanged();
137
void aboutGetStencilSets();
140
void sig_selectionChanged();
141
void sig_addPage(KivioPage*);
142
void sig_addSpawnerSet( KivioStencilSpawnerSet * );
143
void sig_updateView(KivioPage*);
144
void sig_pageNameChanged(KivioPage*, const QString&);
145
void sig_deleteStencilSet( DragBarButton*, QWidget *, KivioStackBar * );
146
void sig_updateGrid();
148
void unitsChanged(int);
151
bool checkStencilsForSpawner( KivioStencilSpawner * );
152
bool checkGroupForSpawner( KivioStencil *, KivioStencilSpawner *);
153
bool setIsAlreadyLoaded( QString dirName, QString name );
155
KoView* createViewInstance( QWidget* parent, const char* name );
158
* List of stencil spawner sets
160
QList <KivioStencilSpawnerSet> *m_pLstSpawnerSets;
164
* Loads a KivioStencilSpawnerSet based on it's id
166
bool loadStencilSpawnerSet( const QString &id );
169
* Overloaded function of @ref KoDocument.
171
virtual bool completeLoading( KoStore* );
174
* Pointer to the map that holds all the pages.
179
* This variable is used to give every KivioPage a unique default name.
186
* The URL of the this part. This variable is only set if the @ref #load function
187
* had been called with an URL as argument.
191
QString m_strFileURL;
194
* TRUE if loading is in process, otherwise FALSE.
195
* This flag is used to avoid updates etc. during loading.
201
KivioGroupStencil *m_pClipboard;
203
static QList<KivioDoc>* s_docs;
206
KivioStencilSpawnerSet* m_pInternalSet;
209
KivioGridData gridData;
211
ViewItemList* viewItemList;
213
KivioOptions* m_options;
68
friend class KivioPage;
70
KivioDoc( QWidget *parentWidget = 0, const char* widgetName = 0, QObject* parent = 0, const char* name = 0, bool singleViewMode = false );
73
virtual DCOPObject* dcopObject();
75
virtual QDomDocument saveXML();
77
virtual bool loadXML( QIODevice *, const QDomDocument& doc );
79
virtual bool initDoc();
81
KivioOptions* config()const { return m_options; }
83
virtual QCString mimeType() const { return MIME_TYPE; }
86
* @return a pointer to a new KivioPage. The KivioPage is not added to the map nor added to the GUI.
88
KivioPage* createPage();
91
* Adds a KivioPage to the GUI and makes it active. In addition the KivioPage is
97
void addPage( KivioPage* page );
100
* Adds a KivioStencilSpawnerSet to the list of spawner sets and make it active.
103
KivioStencilSpawnerSet *addSpawnerSet( const QString& );
104
KivioStencilSpawnerSet *addSpawnerSetDuringLoad( const QString& );
105
bool removeSpawnerSet( KivioStencilSpawnerSet * );
107
QPtrList<KivioStencilSpawnerSet> *spawnerSets()const { return m_pLstSpawnerSets; }
109
KivioStencilSpawner *findStencilSpawner( const QString& setId, const QString& stencilId );
110
KivioStencilSpawner *findInternalStencilSpawner( const QString& title );
112
KivioMap* map() const { return m_pMap; }
115
* @return TRUE if the document is currently loading.
117
bool isLoading()const { return m_bLoading; }
119
virtual void paintContent( QPainter& painter, const QRect& rect, bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 );
120
void paintContent( KivioPainter& painter, const QRect& rect, bool transparent, KivioPage* page, QPoint, KoZoomHandler*, bool );
122
void printContent( KPrinter& prn );
123
bool exportPage( KivioPage *pPage, const QString &fileName, ExportPageDialog * );
125
static QPtrList<KivioDoc>& documents();
127
KivioGroupStencil *clipboard();
128
void setClipboard( KivioGroupStencil * );
130
KoUnit::Unit units()const { return m_units; }
132
KivioGridData grid() { return gridData; }
133
void setGrid(KivioGridData g) { gridData = g; emit sig_updateGrid();}
135
ViewItemList* viewItems()const { return viewItemList; }
140
void addCommand( KCommand * cmd );
142
int undoRedoLimit() const;
143
void setUndoRedoLimit(int val);
144
KCommandHistory * commandHistory()const { return m_commandHistory; }
146
void insertPage( KivioPage * page );
147
void takePage( KivioPage * page );
148
void resetLayerPanel();
149
void updateProtectPanelCheckBox();
151
QFont defaultFont() { return m_font; }
154
void updateView(KivioPage*);
156
void slotDeleteStencilSet( DragBarButton *, QWidget *, KivioStackBar * );
157
void slotSelectionChanged();
158
void setUnits(KoUnit::Unit);
160
void setDefaultFont(const QFont& f) { m_font = f; }
163
void slotDocumentRestored();
164
void slotCommandExecuted();
167
void sig_selectionChanged();
168
void sig_addPage(KivioPage*);
169
void sig_addSpawnerSet( KivioStencilSpawnerSet * );
170
void sig_updateView(KivioPage*);
171
void sig_pageNameChanged(KivioPage*, const QString&);
172
void sig_deleteStencilSet( DragBarButton*, QWidget *, KivioStackBar * );
173
void sig_updateGrid();
175
void unitsChanged(KoUnit::Unit);
178
bool checkStencilsForSpawner( KivioStencilSpawner * );
179
bool checkGroupForSpawner( KivioStencil *, KivioStencilSpawner *);
180
bool setIsAlreadyLoaded( QString dirName, QString name );
182
KoView* createViewInstance( QWidget* parent, const char* name );
185
* List of stencil spawner sets
187
QPtrList <KivioStencilSpawnerSet> *m_pLstSpawnerSets;
191
* Loads a KivioStencilSpawnerSet based on it's id
193
bool loadStencilSpawnerSet( const QString &id );
196
* Overloaded function of @ref KoDocument.
198
virtual bool completeLoading( KoStore* );
201
* Pointer to the map that holds all the pages.
206
* This variable is used to give every KivioPage a unique default name.
213
* The URL of the this part. This variable is only set if the @ref #load function
214
* had been called with an URL as argument.
218
QString m_strFileURL;
221
* TRUE if loading is in process, otherwise FALSE.
222
* This flag is used to avoid updates etc. during loading.
228
KivioGroupStencil *m_pClipboard;
230
static QPtrList<KivioDoc>* s_docs;
233
KivioStencilSpawnerSet* m_pInternalSet;
235
KoUnit::Unit m_units;
236
KivioGridData gridData;
238
ViewItemList* viewItemList;
240
KivioOptions* m_options;
242
KCommandHistory * m_commandHistory;