krita/ui
kis_doc2.hGo to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KIS_DOC_2_H_
00023 #define KIS_DOC_2_H_
00024
00025 #include <kis_debug.h>
00026
00027 #include <KoDocument.h>
00028
00029 #include "kis_types.h"
00030
00031 #include <krita_export.h>
00032
00033 class QString;
00034
00035 class KoColorSpace;
00036 class KoColor;
00037 class KoShape;
00038
00039 class KoShapeControllerBase;
00040 class KisView2;
00041 class KisChildDoc;
00042 class KisUndoAdapter;
00043 class KisNodeModel;
00058 class KRITAUI_EXPORT KisDoc2 : public KoDocument
00059 {
00060
00061 Q_OBJECT
00062
00063 public:
00064 KisDoc2(QWidget *parentWidget = 0, QObject* parent = 0, bool singleViewMode = true);
00065 virtual ~KisDoc2();
00066
00067 public:
00068
00069 virtual bool wantExportConfirmation() const {
00070 return false;
00071 }
00072 virtual bool completeLoading(KoStore *store);
00073 virtual bool completeSaving(KoStore*);
00074
00076 virtual bool loadOdf(KoOdfReadStore & odfStore);
00078 virtual bool saveOdf(SavingContext &documentContext);
00079
00080 virtual QDomDocument saveXML();
00081 virtual bool loadXML(const KoXmlDocument& doc, KoStore* store);
00082
00083 virtual QByteArray mimeType() const;
00084 virtual QList<KoDocument::CustomDocumentWidgetItem> createCustomDocumentWidgets(QWidget *parent);
00085
00089 virtual void paintContent(QPainter& painter, const QRect& rect);
00090
00091 void showStartUpWidget(KoMainWindow* parent, bool alwaysShow);
00092
00094 virtual QPixmap generatePreview(const QSize& size);
00095
00096 virtual void setUndo(bool undo);
00097 virtual bool undo() const;
00098
00099 public slots:
00100
00105 virtual void initEmpty();
00106
00107 void showErrorAndDie();
00108
00109 public:
00110
00115 bool newImage(const QString& name, qint32 width, qint32 height, const KoColorSpace * cs, const KoColor &bgColor, const QString &imageDescription, const double imageResolution);
00116
00121 KisImageWSP newImage(const QString& name, qint32 width, qint32 height, const KoColorSpace * colorspace);
00122
00123 KisImageWSP image() const;
00124
00128 void prepareForImport();
00129
00133 void setCurrentImage(KisImageWSP image);
00134
00135 KisUndoAdapter * undoAdapter() const;
00136
00141 KoShapeControllerBase * shapeController() const;
00142
00143 KoShape * shapeForNode(KisNodeSP layer) const;
00144
00148 KoShape * addShape(const KisNodeSP node);
00149
00154 KisNodeModel * nodeModel() const;
00155
00156 signals:
00157
00158 void sigLoadingFinished();
00159
00160 public:
00161
00162
00163 virtual KoView* createViewInstance(QWidget *parent);
00164
00165 protected slots:
00166
00167 void slotLoadingFinished();
00168
00169
00170 virtual void openExistingFile(const KUrl& url);
00171 virtual void openTemplate(const KUrl& url);
00172
00173 private slots:
00174
00175 void undoIndexChanged(int idx);
00176
00177 private:
00178
00179 bool init();
00180
00181 private:
00182
00183 class KisDocPrivate;
00184 KisDocPrivate * const m_d;
00185
00186 };
00187
00188 #endif // KIS_DOC_H_
|