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

0001 /* This file is part of the KDE project
0002  * Copyright (C) 2007-2009 Thorsten Zachmann <zachmann@kde.org>
0003  *
0004  * This library is free software; you can redistribute it and/or
0005  * modify it under the terms of the GNU Library General Public
0006  * License as published by the Free Software Foundation; either
0007  * version 2 of the License, or (  at your option ) any later version.
0008  *
0009  * This library is distributed in the hope that it will be useful,
0010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012  * Library General Public License for more details.
0013  *
0014  * You should have received a copy of the GNU Library General Public License
0015  * along with this library; see the file COPYING.LIB.  If not, write to
0016  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017  * Boston, MA 02110-1301, USA.
0018  */
0019 
0020 #ifndef KPRPAGE_H
0021 #define KPRPAGE_H
0022 
0023 #include <KoPAPage.h>
0024 
0025 #include "KPrPageData.h"
0026 #include "KPrDeclarations.h"
0027 
0028 #include "stage_export.h"
0029 
0030 class KoPADocument;
0031 class KPrDocument;
0032 class KPrPageApplicationData;
0033 class KPrNotes;
0034 class KPrPageLayout;
0035 class KPrDeclarations;
0036 
0037 class STAGE_EXPORT KPrPage : public KoPAPage, public KPrPageData
0038 {
0039 public:
0040     KPrPage( KoPAMasterPage * masterPage, KPrDocument * document );
0041     ~KPrPage() override;
0042 
0043     /**
0044      * Get the page data
0045      *
0046      * This method is static that you don't need to cast the page to a KPrPage first.
0047      * As every KPrPage needs to have a KPrPageApplicationData this call fails with a
0048      * assertion when it is not possible to retrieve.
0049      */
0050     static KPrPageApplicationData * pageData( KoPAPageBase * page );
0051 
0052     /**
0053      * Get the presentation notes for this page
0054      *
0055      * @return the presentation notes
0056      */
0057     KPrNotes *pageNotes();
0058 
0059     /// reimplemented
0060     void shapeAdded( KoShape * shape ) override;
0061 
0062     /// reimplemented
0063     void shapeRemoved( KoShape * shape ) override;
0064 
0065     /**
0066      * Set the layout to use on the page
0067      *
0068      * @param layout the layout that should be used from now. 
0069      *        If 0 no layout will be used.
0070      */
0071     void setLayout( KPrPageLayout * layout, KoPADocument * document  );
0072 
0073     /**
0074      * Get the layout used on the page
0075      *
0076      * @return layout that is used or 0 if no layout is used
0077      */
0078     KPrPageLayout * layout() const;
0079 
0080     /**
0081      * Get the page type used in the document
0082      *
0083      * @return KoPageApp::Slide
0084      */
0085     KoPageApp::PageType pageType() const override;
0086 
0087     QString declaration(KPrDeclarations::Type type) const;
0088 
0089     /// reimplemented
0090     bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context) override;
0091 
0092     /// reimplemented
0093     bool displayShape(KoShape *shape) const override;
0094 
0095 protected:
0096     /// reimplemented
0097     void saveOdfPageContent( KoPASavingContext & paContext ) const override;
0098 
0099     /// reimplemented
0100     void saveOdfPageStyleData( KoGenStyle &style, KoPASavingContext &paContext ) const override;
0101 
0102     /// reimplemented
0103     void loadOdfPageTag( const KoXmlElement &element, KoPALoadingContext &loadingContext ) override;
0104 
0105     /// reimplemented
0106     void loadOdfPageExtra( const KoXmlElement &element, KoPALoadingContext & loadingContext ) override;
0107 
0108     /// reimplemented
0109     bool saveOdfAnimations(KoPASavingContext & paContext) const override;
0110 
0111     /// reimplemented
0112     bool saveOdfPresentationNotes(KoPASavingContext &paContext) const override;
0113 
0114     /// reimplemented
0115     KoShapeManagerPaintingStrategy * getPaintingStrategy() const override;
0116 
0117 private:
0118     class Private;
0119     Private * const d;
0120 };
0121 
0122 #endif /* KPRPAGE_H */