Warning, file /office/calligra/libs/odf/KoPageLayout.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /* This file is part of the KDE project
0002    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
0003    Copyright 2002, 2003 David Faure <faure@kde.org>
0004    Copyright 2003 Nicolas GOUTTE <goutte@kde.org>
0005    Copyright 2007 Thomas Zander <zander@kde.org>
0006 
0007    This library is free software; you can redistribute it and/or
0008    modify it under the terms of the GNU Library General Public
0009    License as published by the Free Software Foundation; either
0010    version 2 of the License, or (at your option) any later version.
0011 
0012    This library is distributed in the hope that it will be useful,
0013    but WITHOUT ANY WARRANTY; without even the implied warranty of
0014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0015    Library General Public License for more details.
0016 
0017    You should have received a copy of the GNU Library General Public License
0018    along with this library; see the file COPYING.LIB.  If not, write to
0019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0020  * Boston, MA 02110-1301, USA.
0021 */
0022 
0023 #ifndef KOPAGELAYOUT_H
0024 #define KOPAGELAYOUT_H
0025 
0026 #include "KoPageFormat.h"
0027 #include "KoXmlReaderForward.h"
0028 #include "KoBorder.h"
0029 
0030 #include "koodf_export.h"
0031 
0032 class KoGenStyle;
0033 
0034 /**
0035  * This structure defines the page layout, including
0036  * its size in points, its format (e.g. A4), orientation, unit, margins etc.
0037  */
0038 struct KoPageLayout {
0039     /** Page format */
0040     KoPageFormat::Format format;
0041     /** Page orientation */
0042     KoPageFormat::Orientation orientation;
0043 
0044     /** Page width in points */
0045     qreal width;
0046     /** Page height in points */
0047     qreal height;
0048 
0049     /**
0050      * margin on left edge
0051      * Using a margin >= 0 here indicates this is a single page system and the
0052      *  bindingSide + pageEdge variables should be -1 at the same time.
0053      */
0054     qreal leftMargin;
0055     /**
0056      * margin on right edge
0057      * Using a margin >= 0 here indicates this is a single page system and the
0058      *  bindingSide + pageEdge variables should be -1 at the same time.
0059      */
0060     qreal rightMargin;
0061     /** Top margin in points */
0062     qreal topMargin;
0063     /** Bottom margin in points */
0064     qreal bottomMargin;
0065 
0066     /**
0067      * margin on page edge
0068      * Using a margin >= 0 here indicates this is a pageSpread (facing pages) and the
0069      *  left + right variables should be -1 at the same time.
0070      */
0071     qreal pageEdge;
0072     /**
0073      * margin on page-binding edge
0074      * Using a margin >= 0 here indicates this is a pageSpread (facing pages) and the
0075      *  left + right variables should be -1 at the same time.
0076      */
0077     qreal bindingSide;
0078 
0079     /** Left padding in points */
0080     qreal leftPadding;
0081     /** Right padding in points */
0082     qreal rightPadding;
0083     /** Top padding in points */
0084     qreal topPadding;
0085     /** Bottom padding in points */
0086     qreal bottomPadding;
0087 
0088     /// page border definition
0089     KoBorder  border;
0090 
0091     KOODF_EXPORT bool operator==(const KoPageLayout &l) const;
0092     KOODF_EXPORT bool operator!=(const KoPageLayout& l) const;
0093 
0094     /**
0095      * Save this page layout to ODF.
0096      */
0097     KOODF_EXPORT KoGenStyle saveOdf() const;
0098 
0099     /**
0100      * Load this page layout from ODF
0101      */
0102     KOODF_EXPORT void loadOdf(const KoXmlElement &style);
0103 
0104     /**
0105      * Construct a page layout with the default page size depending on the locale settings,
0106      * default margins (2 cm), and portrait orientation.
0107      */
0108     KOODF_EXPORT KoPageLayout();
0109 };
0110 
0111 #endif /* KOPAGELAYOUT_H */
0112