Changeset View
Changeset View
Standalone View
Standalone View
src/acbf/AcbfLanguage.h
Context not available. | |||||
25 | #include <memory> | 25 | #include <memory> | ||
---|---|---|---|---|---|
26 | 26 | | |||
27 | #include "AcbfBookinfo.h" | 27 | #include "AcbfBookinfo.h" | ||
28 | 28 | /** | |||
29 | * \brief Class to handle the list of translations in an ACBF document. | ||||
30 | * | ||||
31 | * Due to an oddity in the naming of certain elements in the ACBF standard, this class | ||||
32 | * actually represents a text-layer sub-element in the languages subelement of book-info. | ||||
33 | * | ||||
34 | * Show determines whether the language in question can be overlaid(true) or is actually the | ||||
35 | * language the comic is written in(false). | ||||
36 | */ | ||||
29 | namespace AdvancedComicBookFormat | 37 | namespace AdvancedComicBookFormat | ||
30 | { | 38 | { | ||
31 | // Due to an oddity in the naming of certain elements in the ACBF standard, this class | 39 | | ||
32 | // actually represents a text-layer sub-element in the languages subelement of book-info | | |||
33 | class ACBF_EXPORT Language : public QObject | 40 | class ACBF_EXPORT Language : public QObject | ||
34 | { | 41 | { | ||
35 | Q_OBJECT | 42 | Q_OBJECT | ||
Context not available. | |||||
37 | explicit Language(BookInfo* parent = nullptr); | 44 | explicit Language(BookInfo* parent = nullptr); | ||
38 | ~Language() override; | 45 | ~Language() override; | ||
39 | 46 | | |||
47 | /** | ||||
48 | * \brief write the language into the XML writer. | ||||
49 | */ | ||||
40 | void toXml(QXmlStreamWriter* writer); | 50 | void toXml(QXmlStreamWriter* writer); | ||
51 | /** | ||||
52 | * \brief load a language element into this object. | ||||
53 | * @return True if the xmlReader encountered no errors. | ||||
54 | */ | ||||
41 | bool fromXml(QXmlStreamReader *xmlReader); | 55 | bool fromXml(QXmlStreamReader *xmlReader); | ||
42 | 56 | | |||
57 | /** | ||||
58 | * \brief set the language of this language entry. | ||||
59 | * @param language - the language of the entry in language code, country | ||||
60 | * code format joined by a dash (not an underscore). | ||||
61 | */ | ||||
43 | void setLanguage(const QString& language); | 62 | void setLanguage(const QString& language); | ||
63 | /** | ||||
64 | * @returns the language of this language entry. | ||||
65 | */ | ||||
44 | QString language() const; | 66 | QString language() const; | ||
45 | 67 | | |||
68 | /** | ||||
69 | * \brief set whether the language entry should be overlaid(true) or is the native | ||||
70 | * language(false). | ||||
71 | * @param show - wether to overlay or not. | ||||
72 | */ | ||||
46 | void setShow(bool show); | 73 | void setShow(bool show); | ||
74 | /** | ||||
75 | * @return whether the language entry should be overlaid(true) or is the native | ||||
76 | * language(false). | ||||
77 | */ | ||||
47 | bool show() const; | 78 | bool show() const; | ||
48 | private: | 79 | private: | ||
49 | class Private; | 80 | class Private; | ||
Context not available. |