File: KoOdfNotesConfiguration.h

package info (click to toggle)
calligra 1%3A3.2.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 260,432 kB
  • sloc: cpp: 650,911; xml: 27,662; python: 6,044; perl: 2,724; yacc: 1,817; ansic: 1,325; sh: 1,277; lex: 1,107; ruby: 1,010; javascript: 495; makefile: 24
file content (189 lines) | stat: -rw-r--r-- 6,090 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/* This file is part of the KDE project

   Copyright (C) 2010 Boudewijn Rempt

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License version 2 as published by the Free Software Foundation.

   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
 */
#ifndef KOODFNOTESCONFIGURATION_H
#define KOODFNOTESCONFIGURATION_H

#include <QMetaType>
#include <QObject>

#include "KoXmlReader.h"
#include "koodf_export.h"

class KoXmlWriter;
class KoOdfNumberDefinition;

/**
 * load and save the notes-configuration element from the text: namespace.
 *
 * @see 14.9.2 Notes Configuration Element
 * A document in OpenDocument format contains at most one notes configuration element for every
 * notes class used in the document. If there is no note configuration element, a default note
 * configuration is used.
 * The attributes that may be associated with the <text:notes-configuration> element are:
 *
 * • Note class
 * • Citation text style
 * • Citation body text style
 * • Default footnote paragraph style
 * • Master page
 * • Start value
 * • Number format
 * • Numbering scheme
 * • Footnote position
 *
 * The following element may be included in the <text:footnotes-configuration> element:
 *
 * • Footnote continuation notice (forward and backward)
 */
class KOODF_EXPORT KoOdfNotesConfiguration : public QObject
{
    Q_OBJECT
public:

    /**
     * Note class
     * The note class attribute determines which note elements this notes configuration applies to.
     */
    enum NoteClass {
        Footnote,
        Endnote
    };

    explicit KoOdfNotesConfiguration(NoteClass noteClass);
    ~KoOdfNotesConfiguration() override;
    KoOdfNotesConfiguration(const KoOdfNotesConfiguration &other);
    KoOdfNotesConfiguration &operator=(const KoOdfNotesConfiguration &other);


    /**
     * load the notes-configuration element
     */
    void loadOdf(const KoXmlElement &element);

    /**
     * save the notes-configuration element
     */
    void saveOdf(KoXmlWriter * writer) const;


    NoteClass noteClass() const;

    /**
     * Citation Text Style
     * The text:citation-style attribute specifies the text style to use for the footnote citation
     * within the footnote.
     */
    QString citationTextStyleName() const;
    void *citationTextStyle() const;
    void setCitationTextStyle(void *citationTextStyle);

    /**
     * Citation Body Text Style
     * The text:citation-body-style-name attribute specifies the text style to use for the
     * footnote citation in the text flow.
     */
    QString citationBodyTextStyleName() const;
    void *citationBodyTextStyle() const;
    void setCitationBodyTextStyle(void *citationBodyTextStyle);

    /**
     * Default Note Paragraph Style
     * The default footnote paragraph style is only used for footnotes that are inserted into an existing
     * document. It is not used for footnotes that already exist.
     */
    QString defaultNoteParagraphStyleName() const;
    void *defaultNoteParagraphStyle() const;
    void setDefaultNoteParagraphStyle(void *defaultNoteParagraphStyle);

    /**
     * Master Page
     * To display the footnotes at the end of the document, the pages that contain the footnotes must be
     * instances of the master page specified by the text:master-page-name attribute.
     */
    QString masterPage() const;
    void setMasterPage(const QString &masterPage);

    /**
     * Start Value
     * The start:value attribute specifies the value at which the footnote numbering starts.
     */
    int startValue() const;
    void setStartValue(int startValue);

    /**
     * Number Format
     * See section 12.2 for information on the number format for footnotes.
     */
    KoOdfNumberDefinition numberFormat() const;
    void setNumberFormat(const KoOdfNumberDefinition &numberFormat);

    /**
     * Numbering Scheme
     * The text:start-numbering-at attribute specifies if footnote numbers start with a new
     * number at the beginning of the document or at the beginning of each chapter or page.
     */
    enum NumberingScheme {
        BeginAtDocument,
        BeginAtChapter,
        BeginAtPage
    };

    NumberingScheme numberingScheme() const;
    void setNumberingScheme(NumberingScheme numberingScheme);

    /**
     * Footnotes Position
     * • The text:footnotes-position attribute specifies one of the following positions for footnotes:
     * • text: At the page where the footnote citation is located, immediately below the page's text.
     * • page: The bottom of the page where the footnote citation is located.
     * • section: The end of the section
     * • document: The end of the document.
     */
    enum FootnotesPosition {
        Text,
        Page,
        Section,
        Document
    };

    FootnotesPosition footnotesPosition() const;
    void setFootnotesPosition(FootnotesPosition footnotesPosition);

    /**
     * Footnote Continuation
     *  The footnote continuation elements specify:
     *   • Text displayed at the end of a footnote that is continued on the next page
     *   • Text displayed before the continued text
     */
    QString footnoteContinuationForward() const;
    void setFootnoteContinuationForward(const QString &footnoteContinuationForward);

    QString footnoteContinuationBackward() const;
    void setFootnoteContinuationBackward(const QString &footnoteContinuationBackward);

private:

    class Private;
    Private * const d;

};

Q_DECLARE_METATYPE(KoOdfNotesConfiguration*)

#endif // KOODFNOTESCONFIGURATION_H