1 /* This file is part of the KDE project
2  * Copyright (C) 2006-2010 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; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public License
15  * along with this library; see the file COPYING.LIB.  If not, write to
16  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  * Boston, MA 02110-1301, USA.
18  */
19 #ifndef KWPAGESTYLE_P_H
20 #define KWPAGESTYLE_P_H
21 
22 #include <QSharedData>
23 #include <KoText.h>
24 #include <KoShapeBackground.h>
25 #include <KoColumns.h>
26 
27 class KWPageStylePrivate : public QSharedData
28 {
29 public:
KWPageStylePrivate()30     KWPageStylePrivate() : fullPageBackground(0) { clear(); }
31     ~KWPageStylePrivate();
32     void clear();
33 
34     KWPageStyle::PageUsageType pageUsage;
35     KoColumns columns;
36     KoPageLayout pageLayout;
37     QString name;
38     QString displayName;
39     qreal headerDistance, footerDistance, footNoteDistance, endNoteDistance;
40     qreal headerMinimumHeight,footerMinimumHeight;
41     Words::HeaderFooterType headers, footers;
42     bool headerDynamicSpacing;
43     bool footerDynamicSpacing;
44     qreal footNoteSeparatorLineWidth; ///< width of line; so more like 'thickness'
45     int footNoteSeparatorLineLength; ///< It's a percentage of page.
46     Qt::PenStyle footNoteSeparatorLineType; ///< foot note separate type
47     Words::FootNoteSeparatorLinePos footNoteSeparatorLinePos; ///< alignment in page
48 
49     // See parag 16.2 for all the ODF features.
50     KoText::Direction direction;
51     QSharedPointer<KoShapeBackground> fullPageBackground;
52     QString nextStyleName;
53 
54     // called from the command
copyProperties(KWPageStylePrivate * other)55     void copyProperties(KWPageStylePrivate *other) {
56         pageUsage = other->pageUsage;
57         columns = other->columns;
58         pageLayout = other->pageLayout;
59         //name = other->name;
60         headerDistance = other->headerDistance;
61         footerDistance = other->footerDistance;
62         footNoteDistance = other->footNoteDistance;
63         endNoteDistance = other->endNoteDistance;
64         headerMinimumHeight = other->headerMinimumHeight;
65         footerMinimumHeight = other->footerMinimumHeight;
66         headers = other->headers;
67         footers = other->footers;
68         footNoteSeparatorLineWidth = other->footNoteSeparatorLineWidth;
69         footNoteSeparatorLineLength = other->footNoteSeparatorLineLength;
70         footNoteSeparatorLineType = other->footNoteSeparatorLineType;
71         footNoteSeparatorLinePos = other->footNoteSeparatorLinePos;
72         direction = other->direction;
73         fullPageBackground = other->fullPageBackground;
74         nextStyleName = other->nextStyleName;
75     }
76 };
77 
78 #endif
79