1 /* This file is part of the KDE project 2 Copyright (C) 2012 C. Boemann <cbo@kogmbh.com> 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 KWPART_H 21 #define KWPART_H 22 23 #include <KoPart.h> 24 25 #include "words_export.h" 26 27 class KoMainWindow; 28 class KWDocument; 29 class KWView; 30 class QGraphicsItem; 31 32 class WORDS_EXPORT KWPart : public KoPart 33 { 34 Q_OBJECT 35 36 public: 37 explicit KWPart(QObject *parent); 38 // TODO: not nice, just added to allow CAuPart pass its own componentData 39 explicit KWPart(const KoComponentData &componentData, QObject *parent); 40 41 ~KWPart() override; 42 43 QGraphicsItem *createCanvasItem(KoDocument *document) override; ///reimplemented 44 45 void setDocument(KWDocument *document); 46 KWDocument *document() const; 47 48 /// reimplemented from super 49 QList<KoPart::CustomDocumentWidgetItem> createCustomDocumentWidgets(QWidget *parent) override; 50 51 /// reimplemented from super 52 KoMainWindow *createMainWindow() override; 53 54 void showStartUpWidget(KoMainWindow *parent, bool alwaysShow = false) override; 55 56 private Q_SLOTS: 57 void showErrorAndDie(); 58 59 protected: 60 61 KoView *createViewInstance(KoDocument *document, QWidget *parent) override; ///reimplemented 62 virtual void setupViewInstance(KoDocument *document, KWView *view); 63 64 KWDocument *m_document; 65 }; 66 67 #endif 68