karbon
karbon_part.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __KARBON_PART_H__
00021 #define __KARBON_PART_H__
00022
00023
00024 #include <qptrlist.h>
00025
00026 #include <KoDocument.h>
00027 #include <KoUnit.h>
00028 #include "vdocument.h"
00029 #include "koffice_export.h"
00030
00031 class DCOPObject;
00032 class KoRect;
00033 class QRect;
00034 class VCommand;
00035 class VDocument;
00036 class VCommandHistory;
00037
00045 class KARBONCOMMON_EXPORT KarbonPart : public KoDocument
00046 {
00047 Q_OBJECT
00048 public:
00049 KarbonPart( QWidget* parentWidget = 0L, const char* widgetName = 0L,
00050 QObject* parent = 0L, const char* name = 0L, bool singleViewMode = false );
00051 virtual ~KarbonPart();
00052
00053 virtual void paintContent( QPainter& painter, const QRect& rect,
00054 bool transparent = false, double zoomX = 1.0, double zoomY = 1.0 );
00055
00057 virtual bool initDoc(InitDocFlags flags, QWidget* parentWidget=0);
00058
00060 virtual bool loadXML( QIODevice*, const QDomDocument& document );
00061 virtual bool loadOasis( const QDomDocument &doc, KoOasisStyles &styles, const QDomDocument &settings, KoStore *store );
00062
00064 virtual QDomDocument saveXML();
00065 virtual bool saveOasis( KoStore *store, KoXmlWriter *manifestWriter );
00066
00067 virtual void addShell( KoMainWindow *shell );
00068
00069 virtual DCOPObject* dcopObject();
00070
00072 void insertObject( VObject* object );
00073
00075 void addCommand( VCommand* cmd, bool repaint = false );
00076
00077
00078 VDocument& document() { return m_doc; }
00079
00080
00081 void clearHistory();
00082
00084 VCommandHistory* commandHistory()
00085 {
00086 return m_commandHistory;
00087 }
00088
00089 bool showStatusBar() const
00090 {
00091 return m_bShowStatusBar;
00092 }
00093
00094 void setShowStatusBar( bool b );
00097 void reorganizeGUI();
00098
00099 void setUndoRedoLimit( int undos );
00100
00101 void initConfig();
00102 unsigned int maxRecentFiles() const { return m_maxRecentFiles; }
00103
00104 void setPageLayout( KoPageLayout& layout, KoUnit::Unit _unit );
00105
00106 bool mergeNativeFormat( const QString & file );
00107
00108 public slots:
00110 void repaintAllViews( bool repaint = true );
00111 void repaintAllViews( const KoRect& );
00112 void slotDocumentRestored();
00113 void slotCommandExecuted( VCommand * );
00114 void slotUnitChanged( KoUnit::Unit unit );
00115
00116 protected:
00117 virtual KoView* createViewInstance( QWidget* parent, const char* name );
00118 virtual void removeView( KoView *view );
00119 void saveOasisSettings( KoXmlWriter & );
00120 void loadOasisSettings( const QDomDocument&settingsDoc );
00121
00122 private:
00123 VDocument m_doc;
00124 VCommandHistory* m_commandHistory;
00125
00126 bool m_bShowStatusBar;
00127 bool m_merge;
00128 unsigned int m_maxRecentFiles;
00129 DCOPObject *dcop;
00130 };
00131
00132 #endif
00133
|