~ubuntu-branches/debian/sid/calligraplan/sid

« back to all changes in this revision

Viewing changes to src/libs/odf/KoOdfBibliographyConfiguration.h

  • Committer: Package Import Robot
  • Author(s): Pino Toscano
  • Date: 2018-02-01 18:20:19 UTC
  • Revision ID: package-import@ubuntu.com-20180201182019-1qo7qaim5wejm5k9
Tags: upstream-3.1.0
Import upstream version 3.1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
 * Copyright (C) 2011 Smit Patel <smitpatel24@gmail.com>
 
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 KOODFBIBLIOGRAPHYCONFIGURATION_H
 
20
#define KOODFBIBLIOGRAPHYCONFIGURATION_H
 
21
 
 
22
#include <QString>
 
23
#include <QMetaType>
 
24
#include <QObject>
 
25
 
 
26
#include "KoXmlReader.h"
 
27
#include "koodf_export.h"
 
28
 
 
29
class KoXmlWriter;
 
30
 
 
31
// TODO: add namespacing prefix
 
32
typedef QPair<QString, Qt::SortOrder> SortKeyPair;
 
33
 
 
34
/**
 
35
 * load and save the bibliography-configuration element from the text: namespace.
 
36
 * • Prefix
 
37
 * • Suffix
 
38
 * • Numbered entries
 
39
 * • Sort by position
 
40
 * • Sort algorithm
 
41
 */
 
42
class KOODF_EXPORT KoOdfBibliographyConfiguration : public QObject
 
43
{
 
44
    Q_OBJECT
 
45
public:
 
46
 
 
47
    KoOdfBibliographyConfiguration();
 
48
    ~KoOdfBibliographyConfiguration();
 
49
    KoOdfBibliographyConfiguration(const KoOdfBibliographyConfiguration &other);
 
50
    KoOdfBibliographyConfiguration &operator=(const KoOdfBibliographyConfiguration &other);
 
51
 
 
52
    static const QList<QString> bibTypes;
 
53
    static const QList<QString> bibDataFields;
 
54
 
 
55
    /**
 
56
     * load the bibliography-configuration element
 
57
     */
 
58
    void loadOdf(const KoXmlElement &element);
 
59
 
 
60
    /**
 
61
     * save the bibliography-configuration element
 
62
     */
 
63
    void saveOdf(KoXmlWriter * writer) const;
 
64
 
 
65
    /**
 
66
     * Sort by position
 
67
     * If text:sort-by-position attribute is true then bibliography entries or citations will be
 
68
     * sorted according to their position in document.
 
69
     */
 
70
    bool sortByPosition() const;
 
71
    void setSortByPosition(bool enable);
 
72
 
 
73
    /**
 
74
     * Numberred entries
 
75
     * If text:numbered-entries attribute is true then bibliography entries or citations will be numbered.
 
76
     */
 
77
    bool numberedEntries() const;
 
78
    void setNumberedEntries(bool enable);
 
79
 
 
80
    /**
 
81
     * Prefix
 
82
     * The text:prefix attribute specifies prefix of bibliography entry or citation(text:bibliography-mark)
 
83
     */
 
84
    QString prefix() const;
 
85
    void setPrefix(const QString &prefixValue);
 
86
 
 
87
    /**
 
88
     * Suffix
 
89
     * The text:suffix attribute specifies suffix of bibliography entry or citation(text:bibliography-mark)
 
90
     */
 
91
    QString suffix() const;
 
92
    void setSuffix(const QString &suffixValue);
 
93
 
 
94
    /**
 
95
     * Sort algorithm
 
96
     * The text:sort-algorithm attribute specifies sorting algorithm for bibliography entry
 
97
     */
 
98
    QString sortAlgorithm() const;
 
99
    void setSortAlgorithm(const QString &algorithm);
 
100
 
 
101
    /**
 
102
     * Sort Keys
 
103
     * The text:sort-key attribute specifies sort key for bibliography entry
 
104
     */
 
105
    QVector<SortKeyPair> sortKeys() const;
 
106
    void setSortKeys(const QVector<SortKeyPair> &sortKeys);
 
107
 
 
108
private:
 
109
 
 
110
    class Private;
 
111
    Private * const d;
 
112
 
 
113
};
 
114
 
 
115
Q_DECLARE_METATYPE(KoOdfBibliographyConfiguration*)
 
116
 
 
117
#endif // KOODFBIBLIOGRAPHYCONFIGURATION_H