File indexing completed on 2024-05-12 16:36:43

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2008 Fredy Yanardi <fyanardi@gmail.com>
0003  * Copyright (C) 2008-2009 Thorsten Zachmann <zachmann@kde.org>
0004  *
0005  * This library is free software; you can redistribute it and/or
0006  * modify it under the terms of the GNU Library General Public
0007  * License as published by the Free Software Foundation; either
0008  * version 2 of the License, or (at your option) any later version.
0009  *
0010  * This library is distributed in the hope that it will be useful,
0011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013  * Library General Public License for more details.
0014  *
0015  * You should have received a copy of the GNU Library General Public License
0016  * along with this library; see the file COPYING.LIB.  If not, write to
0017  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018  * Boston, MA 02110-1301, USA.
0019  */
0020 
0021 #ifndef KPRNOTES_H
0022 #define KPRNOTES_H
0023 
0024 #include <KoPageLayout.h>
0025 #include <KoPAPageBase.h>
0026 
0027 class KoShape;
0028 class KoImageCollection;
0029 class KPrDocument;
0030 class KPrPage;
0031 
0032 class KPrNotes : public KoPAPageBase
0033 {
0034 public:
0035     KPrNotes( KPrPage * page, KPrDocument * document );
0036     ~KPrNotes() override;
0037 
0038     /// Get the main text note shape for this presentation notes
0039     KoShape *textShape();
0040 
0041     /// reimplemented
0042     void saveOdf(KoShapeSavingContext &context) const override;
0043 
0044     /// reimplemented
0045     bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context) override;
0046 
0047     /// reimplemented
0048     void paintComponent(QPainter& painter, const KoViewConverter& converter, KoShapePaintingContext &paintcontext) override;
0049 
0050     /// Get the page layout for this presentation notes
0051     KoPageLayout &pageLayout() override;
0052 
0053     const KoPageLayout& pageLayout() const override;
0054 
0055     /// update the page thumbnail to reflect current page
0056     void updatePageThumbnail();
0057 
0058     /// reimplemented
0059     bool displayMasterShapes() override;
0060     /// reimplemented
0061     void setDisplayMasterShapes( bool ) override;
0062     /// reimplemented
0063     bool displayMasterBackground() override;
0064     /// reimplemented
0065     void setDisplayMasterBackground( bool ) override;
0066     /// reimplemented
0067     bool displayShape(KoShape *shape) const override;
0068 
0069     QImage thumbImage(const QSize& = QSize(512, 512)) override;
0070     /// reimplemented
0071     virtual QPixmap generateThumbnail( const QSize& );
0072     /// reimplemented
0073     void paintPage( QPainter & painter, KoZoomHandler & zoomHandler ) override;
0074 
0075 private:
0076     KoShape *m_textShape;
0077     KoShape *m_thumbnailShape;
0078     KoPageLayout m_pageLayout;
0079     KPrPage *m_page;
0080     KPrDocument *m_doc;
0081     KoImageCollection * m_imageCollection;
0082 };
0083 
0084 #endif // KPRNOTES_H
0085