kword

KWPage.h

00001 /* This file is part of the KOffice project
00002  * Copyright (C) 2005 Thomas Zander <zander@kde.org>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Library General Public
00006  * License as published by the Free Software Foundation; version 2.
00007 
00008  * This library is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011  * Library General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU Library General Public License
00014  * along with this library; see the file COPYING.LIB.  If not, write to
00015  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016  * Boston, MA 02110-1301, USA.
00017  */
00018 #ifndef kw_page_h
00019 #define kw_page_h
00020 
00021 #include <KoRect.h>
00022 #include "KWPageManager.h"
00023 #include "KoPageLayout.h"
00024 
00025 class KoZoomHandler;
00026 
00030 class KWPage {
00031 public:
00033     enum PageSideEnum {Left, Right}; //future:, PageSpread };
00034 
00036     void setWidth(const double &x);
00038     void setHeight(const double &y);
00040     void setTopMargin(const double &x);
00042     void setBottomMargin(const double &y);
00043 
00049     void setPageEdgeMargin(const double &x);
00055     void setMarginClosestBinding(const double &y);
00061     void setLeftMargin(const double &l);
00067     void setRightMargin(const double &r);
00068 
00070     double width() const;
00072     double height() const;
00074     double topMargin() const;
00076     double bottomMargin() const;
00078     double leftMargin() const;
00080     double rightMargin() const;
00082     double pageEdgeMargin() const;
00084     double marginClosestBinding() const;
00085 
00086     // the y coordinate
00094     double offsetInDocument() const;
00095 
00097     PageSideEnum pageSide() const { return m_pageSide; }
00099     void setPageSide(PageSideEnum ps) { m_pageSide = ps; }
00100 
00102     int pageNumber() const { return m_pageNum; }
00103 
00109     QRect zoomedRect(KoZoomHandler *zoomHandler);
00111     const KoRect rect() const;
00112 
00113 private:
00118     KWPage(KWPageManager *parent, int pageNum);
00119     int m_pageNum;
00120     PageSideEnum m_pageSide;
00121     KoPageLayout m_pageLayout;
00122 
00123     KWPageManager *m_parent;
00124 
00125 friend class KWPageManager;
00126 };
00127 
00128 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys