File: KoInlineCite.h

package info (click to toggle)
calligra 1%3A25.04.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 309,164 kB
  • sloc: cpp: 667,890; xml: 126,105; perl: 2,724; python: 2,497; yacc: 1,817; ansic: 1,326; sh: 1,223; lex: 1,107; javascript: 495; makefile: 24
file content (201 lines) | stat: -rw-r--r-- 4,591 bytes parent folder | download
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
190
191
192
193
194
195
196
197
198
199
200
201
/* This file is part of the KDE project
 * SPDX-FileCopyrightText: 2011 Smit Patel <smitpatel24@gmail.com>
 *
 * SPDX-License-Identifier: LGPL-2.0-or-later
 */
#ifndef KOINLINECITE_H
#define KOINLINECITE_H

#include "KoInlineObject.h"
#include "kotext_export.h"

/**
 * This object is an inline object, which means it is anchored in the text-flow and it can hold
 * bibliography-mark(citation).
 */
class KOTEXT_EXPORT KoInlineCite : public KoInlineObject
{
    Q_OBJECT
public:
    enum Type {
        Citation,
        ClonedCitation // cloned from other citation in document
    };
    /**
     * Construct a new cite to be inserted in the text using KoTextSelectionHandler::insertInlineObject() for example.
     */
    explicit KoInlineCite(Type type);

    ~KoInlineCite() override;

    bool operator!=(const KoInlineCite &cite) const;

    KoInlineCite &operator=(const KoInlineCite &cite);

    Type type() const; // return type of cite

    void setType(Type t);

    QString dataField(const QString &fieldName) const; // returns bibliography-data-field with name fieldName

    bool hasSameData(KoInlineCite *cite) const;

    void copyFrom(KoInlineCite *cite);

    void setIdentifier(const QString &identifier);

    void setBibliographyType(const QString &bibliographyType);

    void setAddress(const QString &addr);

    void setAnnotation(const QString &annotation);

    void setAuthor(const QString &author);

    void setBookTitle(const QString &booktitle);

    void setChapter(const QString &chapter);

    void setEdition(const QString &edition);

    void setEditor(const QString &editor);

    void setPublicationType(const QString &publicationType);

    void setInstitution(const QString &institution);

    void setJournal(const QString &journal);

    void setLabel(const QString &label);

    void setMonth(const QString &month);

    void setNote(const QString &note);

    void setNumber(const QString &number);

    void setOrganisation(const QString &organisation);

    void setPages(const QString &pages);

    void setPublisher(const QString &publisher);

    void setSchool(const QString &school);

    void setSeries(const QString &series);

    void setTitle(const QString &title);

    void setReportType(const QString &reportType);

    void setVolume(const QString &volume);

    void setYear(const QString &year);

    void setURL(const QString &url);

    void setISBN(const QString &isbn);

    void setISSN(const QString &issn);

    void setCustom1(const QString &custom1);

    void setCustom2(const QString &custom2);

    void setCustom3(const QString &custom3);

    void setCustom4(const QString &custom4);

    void setCustom5(const QString &custom5);

    QString identifier() const;

    QString address() const;

    QString author() const;

    QString bibliographyType() const;

    QString annotation() const;

    QString bookTitle() const;

    QString chapter() const;

    QString edition() const;

    QString editor() const;

    QString publicationType() const;

    QString institution() const;

    QString journal() const;

    QString month() const;

    QString note() const;

    QString number() const;

    QString organisations() const;

    QString pages() const;

    QString publisher() const;

    QString school() const;

    QString series() const;

    QString title() const;

    QString reportType() const;

    QString volume() const;

    QString year() const;

    QString url() const;

    QString isbn() const;

    QString issn() const;

    QString custom1() const;

    QString custom2() const;

    QString custom3() const;

    QString custom4() const;

    QString custom5() const;

    int posInDocument() const;

    bool loadOdf(const KoXmlElement &element, KoShapeLoadingContext &context) override;

    /// reimplemented
    void saveOdf(KoShapeSavingContext &context) override;

protected:
    /// reimplemented
    void updatePosition(const QTextDocument *document, int posInDocument, const QTextCharFormat &format) override;
    /// reimplemented
    void resize(const QTextDocument *document, QTextInlineObject &object, int posInDocument, const QTextCharFormat &format, QPaintDevice *pd) override;
    /// reimplemented
    void paint(QPainter &painter,
               QPaintDevice *pd,
               const QTextDocument *document,
               const QRectF &rect,
               const QTextInlineObject &object,
               int posInDocument,
               const QTextCharFormat &format) override;

private:
    class Private;
    Private *const d;
};

#endif // KOINLINECITE_H