Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

page.h

Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 /***************************************************************************
00008                           page.h  -  description
00009                              -------------------
00010     begin                : Sat Apr 7 2001
00011     copyright            : (C) 2001 by Franz Schmid
00012     email                : Franz.Schmid@altmuehlnet.de
00013  ***************************************************************************/
00014 
00015 /***************************************************************************
00016  *                                                                         *
00017  *   This program is free software; you can redistribute it and/or modify  *
00018  *   it under the terms of the GNU General Public License as published by  *
00019  *   the Free Software Foundation; either version 2 of the License, or     *
00020  *   (at your option) any later version.                                   *
00021  *                                                                         *
00022  ***************************************************************************/
00023 
00024 #ifndef PAGE_H
00025 #define PAGE_H
00026 
00027 #include <utility>
00028 
00029 #include <QList>
00030 
00031 #include "scribusapi.h"
00032 #include "undostate.h"
00033 #include "scribusstructs.h"
00034 #include "guidemanagercore.h"
00035 
00036 class PageItem;
00037 class QString;
00038 class UndoManager;
00039 class UndoState;
00040 class ScribusDoc;
00041 
00042 
00046 class SCRIBUS_API Page : public UndoObject, public SingleObservable<Page>
00047 {
00048 public:
00049     Page(const double x, const double y, const double b, const double h);
00050     ~Page();
00051     double xOffset() const { return m_xOffset; }
00052     double yOffset() const { return m_yOffset; }
00053     double width() const { return m_width; }
00054     double height() const { return m_height; }
00055     double initialWidth() const { return m_initialWidth; }
00056     double initialHeight() const { return m_initialHeight; }
00057     void setXOffset(const double);
00058     void setYOffset(const double);
00059     void setWidth(const double);
00060     void setHeight(const double);
00061     void setInitialWidth(const double);
00062     void setInitialHeight(const double);
00063     void copySizingProperties(Page *sourcePage, const MarginStruct& pageMargins);
00064     MarginStruct Margins;
00065     MarginStruct initialMargins;
00067     int LeftPg;
00069     QString MPageNam;
00070 
00071     QString m_pageSize;
00072     int PageOri;
00073     ScribusDoc* doc() const { return m_Doc; }
00074     void setDocument(ScribusDoc* doc);
00075     int pageNr() const { return m_pageNr; }
00076     void setPageNr(int pageNr);
00077     const QString& pageSectionNumber() const { return m_pageSectionNumber; }
00078     void setPageSectionNumber(const QString&);
00080     const QString& pageName() const {return m_PageName;};
00081     void setPageName(const QString& newName);
00082     void restore(UndoState* state, bool isUndo);
00083 
00089     mutable QList<PageItem*> FromMaster;
00091     GuideManagerCore guides;
00092 
00093 protected:
00094     UndoManager * const undoManager;
00095     void restorePageItemCreation(ItemState<PageItem*> *state, bool isUndo);
00096     void restorePageItemDeletion(ItemState<PageItem*> *state, bool isUndo);
00097     void restorePageItemConversion(ItemState<std::pair<PageItem*, PageItem*> >*state, bool isUndo);
00098     
00099     double m_xOffset;
00100     double m_yOffset;
00101     double m_width;
00102     double m_height;
00103     double m_initialWidth;
00104     double m_initialHeight;
00105     int m_pageNr;
00107     QString m_PageName;
00108     ScribusDoc* m_Doc;  
00109     QString m_pageSectionNumber;
00110 };
00111 
00112 #endif
Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.