Subversion Repositories Scribus

Rev

Rev 4069 | Rev 4430 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 paul 1
/***************************************************************************
2
                          page.h  -  description
3
                             -------------------
4
    begin                : Sat Apr 7 2001
5
    copyright            : (C) 2001 by Franz Schmid
6
    email                : Franz.Schmid@altmuehlnet.de
7
 ***************************************************************************/
8
 
9
/***************************************************************************
10
 *                                                                         *
11
 *   This program is free software; you can redistribute it and/or modify  *
12
 *   it under the terms of the GNU General Public License as published by  *
13
 *   the Free Software Foundation; either version 2 of the License, or     *
14
 *   (at your option) any later version.                                   *
15
 *                                                                         *
16
 ***************************************************************************/
17
 
18
#ifndef PAGE_H
19
#define PAGE_H
838 cbradney 20
 
3670 cbradney 21
#include <utility>
22
 
838 cbradney 23
class QString;
24
#include "qvaluelist.h"
25
#include "qptrlist.h"
26
 
2969 craig 27
#include "scribusapi.h"
1115 tsoots 28
#include "undoobject.h"
838 cbradney 29
#include "scribusstructs.h"
30
#include "pageitem.h"
1190 tsoots 31
 
32
class UndoManager;
33
class UndoState;
34
 
3 paul 35
/**
36
  *@author Franz Schmid
37
  */
2969 craig 38
class SCRIBUS_API Page : public UndoObject
456 fschmid 39
{
3 paul 40
public:
3200 cbradney 41
        Page(const double x, const double y, const double b, const double h);
4069 craig 42
        ~Page();
4241 craig 43
        double xOffset() const { return m_xOffset; }
44
        double yOffset() const { return m_yOffset; }
45
        double width() const { return m_width; }
46
        double height() const { return m_height; }
47
        double initialWidth() const { return m_initialWidth; }
48
        double initialHeight() const { return m_initialHeight; }
3200 cbradney 49
        void setXOffset(const double);
50
        void setYOffset(const double);
51
        void setWidth(const double);
52
        void setHeight(const double);
53
        void setInitialWidth(const double);
54
        void setInitialHeight(const double);
1065 cbradney 55
        MarginStruct Margins;
2777 fschmid 56
        MarginStruct initialMargins;
3 paul 57
  /** Nummer der Seite */
3035 fschmid 58
        int LeftPg;
456 fschmid 59
        QString MPageNam;
168 Franz 60
        QString PageNam;
2880 fschmid 61
        QString PageSize;
62
        int PageOri;
80 Franz 63
        QValueList<double> XGuides;
64
        QValueList<double> YGuides;
4241 craig 65
        uint pageNr() const { return m_pageNr; }
3200 cbradney 66
        void setPageNr(const int pageNr);
4241 craig 67
        const QString& pageSectionNumber() const { return m_pageSectionNumber; }
3778 cbradney 68
        void setPageSectionNumber(const QString&);
1115 tsoots 69
        void addXGuide(double position);
70
        void addYGuide(double position);
71
        void addXGuides(QValueList<double>& guides);
72
        void addYGuides(QValueList<double>& guides);
73
        void removeXGuide(double position);
74
        void removeXGuide(int index);
75
        void removeYGuide(double position);
76
        void removeYGuide(int index);
77
        void moveXGuide(int fromIndex, double to);
78
        void moveYGuide(int fromIndex, double to);
1199 tsoots 79
        void setPageName(const QString& newName);
1115 tsoots 80
        void restore(UndoState* state, bool isUndo);
1238 tsoots 81
 
4241 craig 82
        // As a bit of a dirty hack, we declare this mutable so it can be altered
83
        // even while the object is `const'. That's normally only for internal
84
        // implementation, but in this case it at least lets us guarantee the rest
85
        // of the object is unchanged in (eg) pdflib. This should be replaced with
86
        // proper access methods later.
87
        mutable QPtrList<PageItem> FromMaster;
88
 
1238 tsoots 89
private:
3987 craig 90
        UndoManager * const undoManager;
1518 tsoots 91
        void restorePageItemCreation(ItemState<PageItem*> *state, bool isUndo);
92
        void restorePageItemDeletion(ItemState<PageItem*> *state, bool isUndo);
3670 cbradney 93
        void restorePageItemConversion(ItemState<std::pair<PageItem*, PageItem*> >*state, bool isUndo);
3200 cbradney 94
 
95
        double m_xOffset;
96
        double m_yOffset;
97
        double m_width;
98
        double m_height;
99
        double m_initialWidth;
100
        double m_initialHeight;
101
        uint m_pageNr;
3778 cbradney 102
        QString m_pageSectionNumber;
3 paul 103
};
104
 
105
#endif