1 /* This file is part of the KDE project 2 * Copyright (C) 2008 Fredy Yanardi <fyanardi@gmail.com> 3 * Copyright (C) 2008-2009 Thorsten Zachmann <zachmann@kde.org> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public License 16 * along with this library; see the file COPYING.LIB. If not, write to 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef KPRNOTES_H 22 #define KPRNOTES_H 23 24 #include <KoPageLayout.h> 25 #include <KoPAPageBase.h> 26 27 class KoShape; 28 class KoImageCollection; 29 class KPrDocument; 30 class KPrPage; 31 32 class KPrNotes : public KoPAPageBase 33 { 34 public: 35 KPrNotes( KPrPage * page, KPrDocument * document ); 36 ~KPrNotes() override; 37 38 /// Get the main text note shape for this presentation notes 39 KoShape *textShape(); 40 41 /// reimplemented 42 void saveOdf(KoShapeSavingContext &context) const override; 43 44 /// reimplemented 45 bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context) override; 46 47 /// reimplemented 48 void paintComponent(QPainter& painter, const KoViewConverter& converter, KoShapePaintingContext &paintcontext) override; 49 50 /// Get the page layout for this presentation notes 51 KoPageLayout &pageLayout() override; 52 53 const KoPageLayout& pageLayout() const override; 54 55 /// update the page thumbnail to reflect current page 56 void updatePageThumbnail(); 57 58 /// reimplemented 59 bool displayMasterShapes() override; 60 /// reimplemented 61 void setDisplayMasterShapes( bool ) override; 62 /// reimplemented 63 bool displayMasterBackground() override; 64 /// reimplemented 65 void setDisplayMasterBackground( bool ) override; 66 /// reimplemented 67 bool displayShape(KoShape *shape) const override; 68 69 QImage thumbImage(const QSize& = QSize(512, 512)) override; 70 /// reimplemented 71 virtual QPixmap generateThumbnail( const QSize& ); 72 /// reimplemented 73 void paintPage( QPainter & painter, KoZoomHandler & zoomHandler ) override; 74 75 private: 76 KoShape *m_textShape; 77 KoShape *m_thumbnailShape; 78 KoPageLayout m_pageLayout; 79 KPrPage *m_page; 80 KPrDocument *m_doc; 81 KoImageCollection * m_imageCollection; 82 }; 83 84 #endif // KPRNOTES_H 85 86