Changeset View
Changeset View
Standalone View
Standalone View
src/acbf/AcbfDatabaseref.h
Show All 18 Lines | |||||
19 | * | 19 | * | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef ACBFDATABASEREF_H | 22 | #ifndef ACBFDATABASEREF_H | ||
23 | #define ACBFDATABASEREF_H | 23 | #define ACBFDATABASEREF_H | ||
24 | 24 | | |||
25 | #include <memory> | 25 | #include <memory> | ||
26 | #include "AcbfBookinfo.h" | 26 | #include "AcbfBookinfo.h" | ||
27 | 27 | /** | |||
28 | * \brief Class to handle references to this book in catalogues and databases. | ||||
29 | * | ||||
30 | * Books can have entries in databases and library catalogues. If such an entry | ||||
31 | * exists, the DatabaseRef object can hold it. Such entries are useful to figure | ||||
32 | * out if two stories are related, or to retrieve extra information about the book | ||||
33 | * such as collections it may be part of. | ||||
34 | * | ||||
35 | * dbname is the name of the database. | ||||
36 | * type is the type of reference it is, such as IssueID, SeriesID, or just plain URL. | ||||
37 | * reference is the actual reference. | ||||
38 | */ | ||||
28 | namespace AdvancedComicBookFormat | 39 | namespace AdvancedComicBookFormat | ||
29 | { | 40 | { | ||
30 | class ACBF_EXPORT DatabaseRef : public QObject | 41 | class ACBF_EXPORT DatabaseRef : public QObject | ||
31 | { | 42 | { | ||
32 | Q_OBJECT | 43 | Q_OBJECT | ||
33 | public: | 44 | public: | ||
34 | explicit DatabaseRef(BookInfo* parent = nullptr); | 45 | explicit DatabaseRef(BookInfo* parent = nullptr); | ||
35 | ~DatabaseRef() override; | 46 | ~DatabaseRef() override; | ||
36 | 47 | | |||
48 | /** | ||||
49 | * \brief write the contents of this object into the xmlwriter. | ||||
50 | */ | ||||
37 | void toXml(QXmlStreamWriter* writer); | 51 | void toXml(QXmlStreamWriter* writer); | ||
52 | /** | ||||
53 | * \brief load a DatabaseRef section from the xml into this object. | ||||
54 | * @return True if the xmlReader encountered no errors. | ||||
55 | */ | ||||
38 | bool fromXml(QXmlStreamReader *xmlReader); | 56 | bool fromXml(QXmlStreamReader *xmlReader); | ||
39 | 57 | | |||
58 | /** | ||||
59 | * @return the name of the database. | ||||
60 | */ | ||||
40 | QString dbname() const; | 61 | QString dbname() const; | ||
62 | /** | ||||
63 | * \brief set the name of the database for this reference. | ||||
64 | * @param dbname - the name of the database. | ||||
65 | */ | ||||
41 | void setDbname(const QString& dbname); | 66 | void setDbname(const QString& dbname); | ||
42 | 67 | | |||
68 | /** | ||||
69 | * @returns the type of reference the reference is. | ||||
70 | */ | ||||
43 | QString type() const; | 71 | QString type() const; | ||
72 | /** | ||||
73 | * \brief set which type of reference the reference is. | ||||
74 | * @param type - the type of reference. | ||||
75 | */ | ||||
44 | void setType(const QString& type); | 76 | void setType(const QString& type); | ||
45 | 77 | | |||
78 | /** | ||||
79 | * @returns the reference. | ||||
80 | */ | ||||
46 | QString reference() const; | 81 | QString reference() const; | ||
82 | /** | ||||
83 | * \brief set the reference as a string. | ||||
84 | * @param reference - the reference a QString. | ||||
85 | */ | ||||
47 | void setReference(const QString& reference); | 86 | void setReference(const QString& reference); | ||
48 | private: | 87 | private: | ||
49 | class Private; | 88 | class Private; | ||
50 | std::unique_ptr<Private> d; | 89 | std::unique_ptr<Private> d; | ||
51 | }; | 90 | }; | ||
52 | } | 91 | } | ||
53 | 92 | | |||
54 | #endif//ACBFDATABASEREF_H | 93 | #endif//ACBFDATABASEREF_H |