page.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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