kword

KWPage.h
1/* This file is part of the KOffice project
2 * Copyright (C) 2005 Thomas Zander <zander@kde.org>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; version 2.
7
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 * Library General Public License for more details.
12 *
13 * You should have received a copy of the GNU Library General Public License
14 * along with this library; see the file COPYING.LIB. If not, write to
15 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16 * Boston, MA 02110-1301, USA.
17 */
18#ifndef kw_page_h
19#define kw_page_h
20
21#include <KoRect.h>
22#include "KWPageManager.h"
23#include "KoPageLayout.h"
24
25class KoZoomHandler;
26
30class KWPage {
31public:
33 enum PageSideEnum {Left, Right}; //future:, PageSpread };
34
36 void setWidth(const double &x);
38 void setHeight(const double &y);
40 void setTopMargin(const double &x);
42 void setBottomMargin(const double &y);
43
49 void setPageEdgeMargin(const double &x);
55 void setMarginClosestBinding(const double &y);
61 void setLeftMargin(const double &l);
67 void setRightMargin(const double &r);
68
70 double width() const;
72 double height() const;
74 double topMargin() const;
76 double bottomMargin() const;
78 double leftMargin() const;
80 double rightMargin() const;
82 double pageEdgeMargin() const;
84 double marginClosestBinding() const;
85
86 // the y coordinate
94 double offsetInDocument() const;
95
97 PageSideEnum pageSide() const { return m_pageSide; }
99 void setPageSide(PageSideEnum ps) { m_pageSide = ps; }
100
102 int pageNumber() const { return m_pageNum; }
103
109 TQRect zoomedRect(KoZoomHandler *zoomHandler);
111 const KoRect rect() const;
112
113private:
118 KWPage(KWPageManager *parent, int pageNum);
119 int m_pageNum;
120 PageSideEnum m_pageSide;
121 KoPageLayout m_pageLayout;
122
123 KWPageManager *m_parent;
124
125friend class KWPageManager;
126};
127
128#endif
The Page Manager manages all the pages a document contains and separates all the frames the document ...
This class represents a printed page of the document.
Definition KWPage.h:30
void setMarginClosestBinding(const double &y)
set width of the margin that is the closest to the binding, i.e.
Definition KWPage.cpp:67
void setRightMargin(const double &r)
set width of the right margin.
Definition KWPage.cpp:79
void setTopMargin(const double &x)
set height of the top margin in pt
Definition KWPage.cpp:56
void setBottomMargin(const double &y)
set height of the bottom margin in pt
Definition KWPage.cpp:59
double height() const
return the height of this page (in pt)
Definition KWPage.cpp:44
void setLeftMargin(const double &l)
set width of the left margin.
Definition KWPage.cpp:72
void setPageSide(PageSideEnum ps)
set the pageSide of this page, see the PageSideEnum
Definition KWPage.h:99
double leftMargin() const
return the width of the margin at left (in pt);
Definition KWPage.cpp:97
PageSideEnum
An enum to define if this is a page that is printed to be a left or a right page.
Definition KWPage.h:33
void setHeight(const double &y)
set the height of the page in pt
Definition KWPage.cpp:53
int pageNumber() const
returns the number of this page as it will be shown to the user.
Definition KWPage.h:102
void setWidth(const double &x)
set the width of the page in pt
Definition KWPage.cpp:50
double topMargin() const
return the height of the margin at top (in pt);
Definition KWPage.cpp:87
double bottomMargin() const
return the height of the margin at bottom (in pt);
Definition KWPage.cpp:92
void setPageEdgeMargin(const double &x)
set width of the margin that is the closest to the page edge, i.e.
Definition KWPage.cpp:62
PageSideEnum pageSide() const
Return the pageSide of this page, see the PageSideEnum.
Definition KWPage.h:97
double pageEdgeMargin() const
return width of the margin that is the closest to the page edge, i.e. left for even pages
Definition KWPage.cpp:117
double marginClosestBinding() const
return width of the margin that is the closest to the binding, i.e. right for even pages
Definition KWPage.cpp:122
double width() const
return the width of this page (in pt)
Definition KWPage.cpp:38
double rightMargin() const
return the width of the margin at left (in pt);
Definition KWPage.cpp:108
double offsetInDocument() const
All Pages are in a document-wide coordinate system that simply puts every page under the next page an...
Definition KWPage.cpp:128
TQRect zoomedRect(KoZoomHandler *zoomHandler)
return a TQRect with the size of this page in pixels.
Definition KWPage.cpp:132
const KoRect rect() const
return a KoRect with the (pt) sizes of this page. Margins are ignored for this function.
Definition KWPage.cpp:137