1
/* This file is part of the KDE project
2
* Copyright (C) 2011 Smit Patel <smitpatel24@gmail.com>
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.
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.
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.
19
#ifndef KOODFBIBLIOGRAPHYCONFIGURATION_H
20
#define KOODFBIBLIOGRAPHYCONFIGURATION_H
26
#include "KoXmlReader.h"
27
#include "koodf_export.h"
31
// TODO: add namespacing prefix
32
typedef QPair<QString, Qt::SortOrder> SortKeyPair;
35
* load and save the bibliography-configuration element from the text: namespace.
42
class KOODF_EXPORT KoOdfBibliographyConfiguration : public QObject
47
KoOdfBibliographyConfiguration();
48
~KoOdfBibliographyConfiguration();
49
KoOdfBibliographyConfiguration(const KoOdfBibliographyConfiguration &other);
50
KoOdfBibliographyConfiguration &operator=(const KoOdfBibliographyConfiguration &other);
52
static const QList<QString> bibTypes;
53
static const QList<QString> bibDataFields;
56
* load the bibliography-configuration element
58
void loadOdf(const KoXmlElement &element);
61
* save the bibliography-configuration element
63
void saveOdf(KoXmlWriter * writer) const;
67
* If text:sort-by-position attribute is true then bibliography entries or citations will be
68
* sorted according to their position in document.
70
bool sortByPosition() const;
71
void setSortByPosition(bool enable);
75
* If text:numbered-entries attribute is true then bibliography entries or citations will be numbered.
77
bool numberedEntries() const;
78
void setNumberedEntries(bool enable);
82
* The text:prefix attribute specifies prefix of bibliography entry or citation(text:bibliography-mark)
84
QString prefix() const;
85
void setPrefix(const QString &prefixValue);
89
* The text:suffix attribute specifies suffix of bibliography entry or citation(text:bibliography-mark)
91
QString suffix() const;
92
void setSuffix(const QString &suffixValue);
96
* The text:sort-algorithm attribute specifies sorting algorithm for bibliography entry
98
QString sortAlgorithm() const;
99
void setSortAlgorithm(const QString &algorithm);
103
* The text:sort-key attribute specifies sort key for bibliography entry
105
QVector<SortKeyPair> sortKeys() const;
106
void setSortKeys(const QVector<SortKeyPair> &sortKeys);
115
Q_DECLARE_METATYPE(KoOdfBibliographyConfiguration*)
117
#endif // KOODFBIBLIOGRAPHYCONFIGURATION_H