File indexing completed on 2024-05-12 16:35:46

0001 /* This file is part of the KDE project
0002    Copyright 2007 Stefan Nikolaus <stefan.nikolaus@kdemail.net>
0003    Copyright 2007 Thorsten Zachmann <zachmann@kde.org>
0004    Copyright 2004 Ariya Hidayat <ariya@kde.org>
0005    Copyright 2002-2003 Norbert Andres <nandres@web.de>
0006    Copyright 2000-2005 Laurent Montel <montel@kde.org>
0007    Copyright 2002 John Dailey <dailey@vt.edu>
0008    Copyright 2002 Phillip Mueller <philipp.mueller@gmx.de>
0009    Copyright 2000 Werner Trobin <trobin@kde.org>
0010    Copyright 1999-2000 Simon Hausmann <hausmann@kde.org>
0011    Copyright 1999 David Faure <faure@kde.org>
0012    Copyright 1998-2000 Torben Weis <weis@kde.org>
0013 
0014    This library is free software; you can redistribute it and/or
0015    modify it under the terms of the GNU Library General Public
0016    License as published by the Free Software Foundation; either
0017    version 2 of the License, or (at your option) any later version.
0018 
0019    This library is distributed in the hope that it will be useful,
0020    but WITHOUT ANY WARRANTY; without even the implied warranty of
0021    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0022    Library General Public License for more details.
0023 
0024    You should have received a copy of the GNU Library General Public License
0025    along with this library; see the file COPYING.LIB.  If not, write to
0026    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0027    Boston, MA 02110-1301, USA.
0028 */
0029 
0030 #ifndef CALLIGRA_SHEETS_PART
0031 #define CALLIGRA_SHEETS_PART
0032 
0033 #include <KoDocument.h>
0034 #include <KoPart.h>
0035 
0036 #include "sheets_common_export.h"
0037 
0038 class QWidget;
0039 class QGraphicsItem;
0040 
0041 namespace Calligra
0042 {
0043 namespace Sheets
0044 {
0045 class Doc;
0046 
0047 class CALLIGRA_SHEETS_COMMON_EXPORT Part : public KoPart
0048 {
0049     Q_OBJECT
0050 
0051 public:
0052     explicit Part(QObject *parent = 0);
0053 
0054     /**
0055      * Destroys the document.
0056      */
0057     ~Part() override;
0058 
0059     void setDocument(Doc *document);
0060 
0061     void addView(KoView *_view, KoDocument *document) override; /// reimplemented
0062 
0063     QGraphicsItem *createCanvasItem(KoDocument *document) override; /// reimplemented
0064 
0065     KoMainWindow *createMainWindow() override; /// reimplemented
0066 
0067 protected:
0068     KoView* createViewInstance(KoDocument *document, QWidget*) override; /// reimplemented
0069 
0070     void openTemplate(const QUrl& url) override; /// reimplemented
0071 
0072     Doc *m_document;
0073 
0074 };
0075 
0076 } // namespace Sheets
0077 } // namespace Calligra
0078 
0079 #endif /* CALLIGRA_SHEETS_PART */