Changeset View
Changeset View
Standalone View
Standalone View
src/acbf/AcbfDocumentinfo.h
Context not available. | |||||
43 | class ACBF_EXPORT DocumentInfo : public QObject | 43 | class ACBF_EXPORT DocumentInfo : public QObject | ||
---|---|---|---|---|---|
44 | { | 44 | { | ||
45 | Q_OBJECT | 45 | Q_OBJECT | ||
46 | Q_PROPERTY(QStringList authorNames READ authorNames NOTIFY authorsChanged) | ||||
47 | Q_PROPERTY(QStringList source READ source WRITE setSource NOTIFY sourceChanged) | ||||
48 | Q_PROPERTY(float version READ version WRITE setVersion NOTIFY versionChanged) | ||||
49 | Q_PROPERTY(QStringList history READ history WRITE setHistory NOTIFY historyChanged) | ||||
46 | public: | 50 | public: | ||
47 | explicit DocumentInfo(Metadata* parent = nullptr); | 51 | explicit DocumentInfo(Metadata* parent = nullptr); | ||
48 | ~DocumentInfo() override; | 52 | ~DocumentInfo() override; | ||
Context not available. | |||||
75 | */ | 79 | */ | ||
76 | void removeAuthor(Author* author); | 80 | void removeAuthor(Author* author); | ||
77 | 81 | | |||
82 | /** | ||||
83 | * @return The list of authors that worked on this book as | ||||
84 | * a stringlist of names. | ||||
85 | */ | ||||
86 | QStringList authorNames() const; | ||||
87 | | ||||
88 | /** | ||||
89 | * \brief get an author object by index. | ||||
90 | * @param index - the index of the author. | ||||
91 | */ | ||||
92 | Q_INVOKABLE Author* getAuthor(int index) const; | ||||
93 | | ||||
94 | /** | ||||
95 | * \brief add an author to the list. | ||||
96 | * @param activity - the role this author played. | ||||
97 | * @param language - the language of the author in language code, country | ||||
98 | * code format joined by a dash (not an underscore). | ||||
99 | * @param firstName - the given name of the author. | ||||
100 | * @param middleName - the middle name(s) of the author as a string. | ||||
101 | * @param lastName - the family name of the author. | ||||
102 | * @param nickName - the nickname of the author. | ||||
103 | * @param homePages - a homepage url to associate with this author. | ||||
104 | * @param emails - an email adress to associate with this author. | ||||
105 | */ | ||||
106 | Q_INVOKABLE void addAuthor(QString activity, QString language, QString firstName, QString middleName, QString lastName, QString nickName, QStringList homePages, QStringList emails); | ||||
107 | /** | ||||
108 | * \brief make changes to an author in the list. | ||||
109 | * @param index - The index of this author in the author list. | ||||
110 | * @param activity - the role this author played. | ||||
111 | * @param language - the language of the author in language code, country | ||||
112 | * code format joined by a dash (not an underscore). | ||||
113 | * @param firstName - the given name of the author. | ||||
114 | * @param middleName - the middle name(s) of the author as a string. | ||||
115 | * @param lastName - the family name of the author. | ||||
116 | * @param nickName - the nickname of the author. | ||||
117 | * @param homePages - a homepage url to associate with this author. | ||||
118 | * @param emails - an email adress to associate with this author. | ||||
119 | */ | ||||
120 | Q_INVOKABLE void setAuthor(int index, QString activity, QString language, QString firstName, QString middleName, QString lastName, QString nickName, QStringList homePages, QStringList emails); | ||||
121 | | ||||
122 | /** | ||||
123 | * \brief remove an author in the list. | ||||
124 | * @param index - the index of the author to remove. | ||||
125 | */ | ||||
126 | Q_INVOKABLE void removeAuthor(int index); | ||||
127 | /** | ||||
128 | * \brief triggers when the authors list changes. | ||||
129 | */ | ||||
130 | Q_SIGNAL void authorsChanged(); | ||||
131 | | ||||
78 | /** | 132 | /** | ||
79 | * @return a QDate with the creation date of this file. | 133 | * @return a QDate with the creation date of this file. | ||
80 | */ | 134 | */ | ||
Context not available. | |||||
95 | */ | 149 | */ | ||
96 | void setSource(const QStringList& source); | 150 | void setSource(const QStringList& source); | ||
97 | 151 | | |||
152 | /** | ||||
153 | * @brief remove the source by index. | ||||
154 | * @param index - index of the source to remove. | ||||
155 | */ | ||||
156 | Q_INVOKABLE void removeSource(int index); | ||||
157 | /** | ||||
158 | * @brief fires when the source stringlist is changed. | ||||
159 | */ | ||||
160 | Q_SIGNAL void sourceChanged(); | ||||
161 | | ||||
98 | /** | 162 | /** | ||
99 | * @returns the unique id of this ACBF document, used for cataloguing purposes. | 163 | * @returns the unique id of this ACBF document, used for cataloguing purposes. | ||
100 | */ | 164 | */ | ||
Context not available. | |||||
114 | * @param version - the version as a floating point number. | 178 | * @param version - the version as a floating point number. | ||
115 | */ | 179 | */ | ||
116 | void setVersion(const float& version); | 180 | void setVersion(const float& version); | ||
117 | 181 | /** | |||
182 | * @brief fires when the version of the document changes. | ||||
183 | */ | ||||
184 | Q_SIGNAL void versionChanged(); | ||||
118 | /** | 185 | /** | ||
119 | * @return a list of history entries as a stringlist. | 186 | * @return a list of history entries as a stringlist. | ||
120 | */ | 187 | */ | ||
Context not available. | |||||
129 | * @param historyLine - a single entry in the document. | 196 | * @param historyLine - a single entry in the document. | ||
130 | */ | 197 | */ | ||
131 | void addHistoryLine(const QString& historyLine); | 198 | void addHistoryLine(const QString& historyLine); | ||
199 | /** | ||||
200 | * @brief remove the history line by index. | ||||
201 | * @param index - index of the line to remove. | ||||
202 | */ | ||||
203 | Q_INVOKABLE void removeHistoryLine(int index); | ||||
204 | /** | ||||
205 | * @brief fires when the history stringlist changes. | ||||
206 | */ | ||||
207 | Q_SIGNAL void historyChanged(); | ||||
132 | private: | 208 | private: | ||
133 | class Private; | 209 | class Private; | ||
134 | Private* d; | 210 | Private* d; | ||
Context not available. |