Back to index

scribus-ng  1.3.4.dfsg+svn20071115
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 "qvaluelist.h"
00030 #include "qptrlist.h"
00031 
00032 #include "scribusapi.h"
00033 #include "undoobject.h"
00034 #include "scribusstructs.h"
00035 #include "pageitem.h"
00036 #include "guidemanagercore.h"
00037 
00038 class QString;
00039 class UndoManager;
00040 class UndoState;
00041 class ScribusDoc;
00042 
00043 
00047 class SCRIBUS_API Page : public UndoObject
00048 {
00049 public:
00050        Page(const double x, const double y, const double b, const double h);
00051        ~Page();
00052        double xOffset() const { return m_xOffset; }
00053        double yOffset() const { return m_yOffset; }
00054        double width() const { return m_width; }
00055        double height() const { return m_height; }
00056        double initialWidth() const { return m_initialWidth; }
00057        double initialHeight() const { return m_initialHeight; }
00058        void setXOffset(const double);
00059        void setYOffset(const double);
00060        void setWidth(const double);
00061        void setHeight(const double);
00062        void setInitialWidth(const double);
00063        void setInitialHeight(const double);
00064        void copySizingProperties(Page *sourcePage, const MarginStruct& pageMargins);
00065        MarginStruct Margins;
00066        MarginStruct initialMargins;
00068        int LeftPg;
00070        QString MPageNam;
00071 
00072        QString m_pageSize;
00073        int PageOri;
00074        ScribusDoc* doc() const { return m_Doc; }
00075        void setDocument(ScribusDoc* doc);
00076        uint pageNr() const { return m_pageNr; }
00077        void setPageNr(int pageNr);
00078        const QString& pageSectionNumber() const { return m_pageSectionNumber; }
00079        void setPageSectionNumber(const QString&);
00081        const QString& pageName() const {return m_PageName;};
00082        void setPageName(const QString& newName);
00083        void restore(UndoState* state, bool isUndo);
00084 
00090        mutable QPtrList<PageItem> FromMaster;
00092        GuideManagerCore guides;
00093 
00094 protected:
00095        UndoManager * const undoManager;
00096        void restorePageItemCreation(ItemState<PageItem*> *state, bool isUndo);
00097        void restorePageItemDeletion(ItemState<PageItem*> *state, bool isUndo);
00098        void restorePageItemConversion(ItemState<std::pair<PageItem*, PageItem*> >*state, bool isUndo);
00099        
00100        double m_xOffset;
00101        double m_yOffset;
00102        double m_width;
00103        double m_height;
00104        double m_initialWidth;
00105        double m_initialHeight;
00106        uint m_pageNr;
00108        QString m_PageName;
00109        ScribusDoc* m_Doc;   
00110        QString m_pageSectionNumber;
00111 };
00112 
00113 #endif