Changeset View
Changeset View
Standalone View
Standalone View
src/acbf/AcbfSequence.h
Show All 19 Lines | |||||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef ACBFSEQUENCE_H | 22 | #ifndef ACBFSEQUENCE_H | ||
23 | #define ACBFSEQUENCE_H | 23 | #define ACBFSEQUENCE_H | ||
24 | 24 | | |||
25 | #include <memory> | 25 | #include <memory> | ||
26 | 26 | | |||
27 | #include "AcbfBookinfo.h" | 27 | #include "AcbfBookinfo.h" | ||
28 | 28 | /** | |||
29 | * \brief Class to handle the sequence information. | ||||
30 | * | ||||
31 | * A comic book can be part of several collections or series. | ||||
32 | * ACBF can handle multiple sequences, with numbers and volumes. | ||||
33 | * | ||||
34 | */ | ||||
29 | namespace AdvancedComicBookFormat | 35 | namespace AdvancedComicBookFormat | ||
30 | { | 36 | { | ||
31 | class ACBF_EXPORT Sequence : public QObject | 37 | class ACBF_EXPORT Sequence : public QObject | ||
32 | { | 38 | { | ||
33 | Q_OBJECT | 39 | Q_OBJECT | ||
34 | public: | 40 | public: | ||
35 | explicit Sequence(BookInfo * parent = nullptr); | 41 | explicit Sequence(BookInfo * parent = nullptr); | ||
36 | ~Sequence() override; | 42 | ~Sequence() override; | ||
37 | 43 | | |||
44 | /** | ||||
45 | * \brief Write the sequence into the xml writer. | ||||
46 | */ | ||||
38 | void toXml(QXmlStreamWriter* writer); | 47 | void toXml(QXmlStreamWriter* writer); | ||
48 | /** | ||||
49 | * \brief load the sequence element into this object. | ||||
50 | * @return True if the xmlReader encountered no errors. | ||||
51 | */ | ||||
39 | bool fromXml(QXmlStreamReader *xmlReader); | 52 | bool fromXml(QXmlStreamReader *xmlReader); | ||
40 | 53 | | |||
54 | /** | ||||
55 | * @returns the name of the series or sequence. | ||||
56 | */ | ||||
41 | QString title() const; | 57 | QString title() const; | ||
58 | /** | ||||
59 | * \brief set the name of the sequence. | ||||
60 | * @param title - the name of the sequence as a QString. | ||||
61 | */ | ||||
42 | void setTitle(const QString& title); | 62 | void setTitle(const QString& title); | ||
43 | 63 | | |||
44 | // Optional attribute - if set to 0, this is not saved | 64 | /** | ||
65 | * @returns the volume number. | ||||
66 | */ | ||||
45 | int volume() const; | 67 | int volume() const; | ||
68 | /** | ||||
69 | * \brief set the volume number. | ||||
70 | * @param volume - The volume number, this is optional | ||||
71 | * if set to 0, this is not saved | ||||
72 | */ | ||||
46 | void setVolume(int volume = 0); | 73 | void setVolume(int volume = 0); | ||
47 | 74 | | |||
75 | /** | ||||
76 | * @return the number that this work takes up in the sequence. | ||||
77 | */ | ||||
48 | int number() const; | 78 | int number() const; | ||
79 | /** | ||||
80 | * \brief set the number in the sequence. | ||||
81 | * @param number - an interger number that indicates where it is | ||||
82 | * part of the series. | ||||
83 | */ | ||||
49 | void setNumber(int number); | 84 | void setNumber(int number); | ||
50 | private: | 85 | private: | ||
51 | class Private; | 86 | class Private; | ||
52 | std::unique_ptr<Private> d; | 87 | std::unique_ptr<Private> d; | ||
53 | }; | 88 | }; | ||
54 | } | 89 | } | ||
55 | 90 | | |||
56 | #endif//ACBFSEQUENCE_H | 91 | #endif//ACBFSEQUENCE_H |