Changeset View
Changeset View
Standalone View
Standalone View
src/acbf/AcbfPage.h
Context not available. | |||||
57 | class ACBF_EXPORT Page : public QObject | 57 | class ACBF_EXPORT Page : public QObject | ||
---|---|---|---|---|---|
58 | { | 58 | { | ||
59 | Q_OBJECT | 59 | Q_OBJECT | ||
60 | Q_PROPERTY(QString bgcolor READ bgcolor WRITE setBgcolor NOTIFY bgcolorChanged) | ||||
61 | Q_PROPERTY(QString transition READ transition WRITE setTransition NOTIFY transitionChanged) | ||||
62 | Q_PROPERTY(QString imageHref READ imageHref WRITE setImageHref NOTIFY imageHrefChanged) | ||||
63 | Q_PROPERTY(QStringList textLayerLanguages READ textLayerLanguages NOTIFY textLayerLanguagesChanged) | ||||
64 | Q_PROPERTY(int frameCount READ frameCount NOTIFY frameCountChanged) | ||||
65 | Q_PROPERTY(int jumpCount READ jumpCount NOTIFY jumpCountChanged) | ||||
60 | public: | 66 | public: | ||
61 | // Pages can also be cover pages, which means they can also be children of BookInfo | 67 | // Pages can also be cover pages, which means they can also be children of BookInfo | ||
62 | explicit Page(Document* parent = nullptr); | 68 | explicit Page(Document* parent = nullptr); | ||
Context not available. | |||||
84 | * @param newColor - a String with an 8bit per channel rgb hexcode (#ff00ff, or the like) | 90 | * @param newColor - a String with an 8bit per channel rgb hexcode (#ff00ff, or the like) | ||
85 | */ | 91 | */ | ||
86 | void setBgcolor(const QString& newColor = QString()); | 92 | void setBgcolor(const QString& newColor = QString()); | ||
87 | 93 | /** | |||
94 | * @brief fires when the background color changes. | ||||
95 | */ | ||||
96 | Q_SIGNAL void bgcolorChanged(); | ||||
88 | /** | 97 | /** | ||
89 | * @return transition type as a string. | 98 | * @return transition type as a string. | ||
90 | */ | 99 | */ | ||
Context not available. | |||||
94 | * @param transition - the transition type, possible entries are in the availableTransitions() stringlist. | 103 | * @param transition - the transition type, possible entries are in the availableTransitions() stringlist. | ||
95 | */ | 104 | */ | ||
96 | void setTransition(const QString& transition); | 105 | void setTransition(const QString& transition); | ||
106 | /** | ||||
107 | * @brief fires when the transition type changes. | ||||
108 | */ | ||||
109 | Q_SIGNAL void transitionChanged(); | ||||
97 | /** | 110 | /** | ||
98 | * @returns a list of strings that can be used for the transition. | 111 | * @returns a list of strings that can be used for the transition. | ||
99 | */ | 112 | */ | ||
100 | static QStringList availableTransitions(); | 113 | Q_INVOKABLE static QStringList availableTransitions(); | ||
101 | 114 | | |||
102 | /** | 115 | /** | ||
103 | * @return all titles for this page in all languages. | 116 | * @return all titles for this page in all languages. | ||
104 | */ | 117 | */ | ||
105 | QStringList titleForAllLanguages() const; | 118 | Q_INVOKABLE QStringList titleForAllLanguages() const; | ||
106 | /** | 119 | /** | ||
107 | * @param language - the language of the entry in language code, country | 120 | * @param language - the language of the entry in language code, country | ||
108 | * code format joined by a dash (not an underscore). | 121 | * code format joined by a dash (not an underscore). | ||
109 | * @return the title for this language. | 122 | * @return the title for this language. | ||
110 | */ | 123 | */ | ||
111 | QString title(const QString& language = QString()) const; | 124 | Q_INVOKABLE QString title(const QString& language = QString()) const; | ||
112 | /** | 125 | /** | ||
113 | * \brief set the title for this language. | 126 | * \brief set the title for this language. | ||
114 | * @param language - the language of the entry in language code, country | 127 | * @param language - the language of the entry in language code, country | ||
115 | * code format joined by a dash (not an underscore). | 128 | * code format joined by a dash (not an underscore). | ||
116 | */ | 129 | */ | ||
117 | void setTitle(const QString& title, const QString& language = QString()); | 130 | Q_INVOKABLE void setTitle(const QString& title, const QString& language = QString()); | ||
131 | /** | ||||
132 | * @brief titlesChanged | ||||
133 | */ | ||||
134 | Q_SIGNAL void titlesChanged(); | ||||
118 | 135 | | |||
119 | /** | 136 | /** | ||
120 | * @returns the URI for the image of this page as a QString | 137 | * @returns the URI for the image of this page as a QString | ||
Context not available. | |||||
130 | * - Everything else is presumed to be a file on disk. | 147 | * - Everything else is presumed to be a file on disk. | ||
131 | */ | 148 | */ | ||
132 | void setImageHref(const QString& imageHref); | 149 | void setImageHref(const QString& imageHref); | ||
150 | /** | ||||
151 | * @brief fires when the image url changes. | ||||
152 | */ | ||||
153 | Q_SIGNAL void imageHrefChanged(); | ||||
133 | 154 | | |||
134 | /** | 155 | /** | ||
135 | * @returns all the textlayers objects. | 156 | * @returns all the textlayers objects. | ||
Context not available. | |||||
140 | * code format joined by a dash (not an underscore). | 161 | * code format joined by a dash (not an underscore). | ||
141 | * @returns the TextLayer object for that language. | 162 | * @returns the TextLayer object for that language. | ||
142 | */ | 163 | */ | ||
143 | Textlayer* textLayer(const QString& language = QString()) const; | 164 | Q_INVOKABLE Textlayer* textLayer(const QString& language = QString()) const; | ||
144 | /** | 165 | /** | ||
145 | * | 166 | * | ||
146 | * @param language - the language of the entry in language code, country | 167 | * @param language - the language of the entry in language code, country | ||
Context not available. | |||||
148 | * for a language to null removes that language (as with other translated | 169 | * for a language to null removes that language (as with other translated | ||
149 | * entries, though this one not being text warranted a comment) | 170 | * entries, though this one not being text warranted a comment) | ||
150 | */ | 171 | */ | ||
151 | void setTextLayer(Textlayer* textlayer, const QString& language = ""); | 172 | void setTextLayer(Textlayer* textlayer, const QString& language = QString()); | ||
173 | /** | ||||
174 | * @brief add a textlayer for language. | ||||
175 | * @param language code to add a textlayer for. | ||||
176 | */ | ||||
177 | Q_INVOKABLE void addTextLayer(const QString& language = QString()); | ||||
178 | /** | ||||
179 | * @brief remove a text layer by language. | ||||
180 | * @param language code to remove the textlayer for. | ||||
181 | */ | ||||
182 | Q_INVOKABLE void removeTextLayer(const QString& language = QString()); | ||||
183 | /** | ||||
184 | * @brief get the possible translations. | ||||
185 | * @return a stringlist with all the languages available. | ||||
186 | */ | ||||
187 | QStringList textLayerLanguages() const; | ||||
188 | /** | ||||
189 | * @brief fires when the textlayer languages list changes | ||||
190 | * | ||||
191 | * this can happen when text layers are added or removed. | ||||
192 | */ | ||||
193 | Q_SIGNAL void textLayerLanguagesChanged(); | ||||
152 | 194 | | |||
153 | /** | 195 | /** | ||
154 | * @returns a list of frames in this page. | 196 | * @returns a list of frames in this page. | ||
Context not available. | |||||
158 | * @param index - index of the frame. | 200 | * @param index - index of the frame. | ||
159 | * @return the frame of that index. | 201 | * @return the frame of that index. | ||
160 | */ | 202 | */ | ||
161 | Frame* frame(int index) const; | 203 | Q_INVOKABLE Frame* frame(int index) const; | ||
162 | /** | 204 | /** | ||
163 | * @param frame - the frame you want to index of. | 205 | * @param frame - the frame you want to index of. | ||
164 | * @returns the index of the given frame. | 206 | * @returns the index of the given frame. | ||
Context not available. | |||||
177 | * @param frame - the frame to remove. | 219 | * @param frame - the frame to remove. | ||
178 | */ | 220 | */ | ||
179 | void removeFrame(Frame* frame); | 221 | void removeFrame(Frame* frame); | ||
222 | /** | ||||
223 | * @brief remove frame by index. | ||||
224 | * @param index index of the frame to remove. | ||||
225 | */ | ||||
226 | Q_INVOKABLE void removeFrame(int index); | ||||
227 | /** | ||||
228 | * @brief add a frame at index.. | ||||
229 | * @param index - the index to add it at. If afterIndex is larger than | ||||
230 | * zero, the insertion will happen at that index | ||||
231 | */ | ||||
232 | Q_INVOKABLE void addFrame(int index = -1); | ||||
180 | /** | 233 | /** | ||
181 | * \brief Swap two frames in the list. | 234 | * \brief Swap two frames in the list. | ||
182 | * @param swapThis - the first frame to swap. | 235 | * @param swapThis - the first index to swap. | ||
183 | * @param withThis - the second frame to swap. | 236 | * @param withThis - the second index to swap. | ||
184 | */ | 237 | */ | ||
185 | bool swapFrames(Frame* swapThis, Frame* withThis); | 238 | Q_INVOKABLE bool swapFrames(int swapThis, int withThis); | ||
239 | /** | ||||
240 | * @brief frameCount | ||||
241 | * @return the total amount of frames. | ||||
242 | */ | ||||
243 | int frameCount(); | ||||
244 | /** | ||||
245 | * @brief fires when the frame count changes. | ||||
246 | */ | ||||
247 | Q_SIGNAL void frameCountChanged(); | ||||
186 | 248 | | |||
187 | /** | 249 | /** | ||
188 | * @return the list of jump objects for this page. | 250 | * @return the list of jump objects for this page. | ||
Context not available. | |||||
192 | * @param index - the index for which you want the jump object. | 254 | * @param index - the index for which you want the jump object. | ||
193 | * @return a jump object for the given frame. | 255 | * @return a jump object for the given frame. | ||
194 | */ | 256 | */ | ||
195 | Jump* jump(int index) const; | 257 | Q_INVOKABLE Jump* jump(int index) const; | ||
196 | /** | 258 | /** | ||
197 | * @param jump - the jump you want to index of. | 259 | * @param jump - the jump you want to index of. | ||
198 | * @returns the index of the given jump. | 260 | * @returns the index of the given jump. | ||
Context not available. | |||||
206 | * zero, the insertion will happen at that index | 268 | * zero, the insertion will happen at that index | ||
207 | */ | 269 | */ | ||
208 | void addJump(Jump* jump, int index = -1); | 270 | void addJump(Jump* jump, int index = -1); | ||
271 | /** | ||||
272 | * @brief addJump | ||||
273 | * @param index - the index to add it at. If afterIndex is larger than | ||||
274 | * zero, the insertion will happen at that index | ||||
275 | */ | ||||
276 | Q_INVOKABLE void addJump(int pageIndex, int index = -1); | ||||
209 | /** | 277 | /** | ||
210 | * \brief remove the given jump from the list of jumps. | 278 | * \brief remove the given jump from the list of jumps. | ||
211 | * @param jump - the jump to remove. | 279 | * @param jump - the jump to remove. | ||
212 | */ | 280 | */ | ||
213 | void removeJump(Jump* jump); | 281 | void removeJump(Jump* jump); | ||
282 | /** | ||||
283 | * @brief removeJump | ||||
284 | * @param index to remove the jump at. | ||||
285 | */ | ||||
286 | Q_INVOKABLE void removeJump(int index); | ||||
214 | /** | 287 | /** | ||
215 | * \brief Swap two jumps in the list. | 288 | * \brief Swap two jumps in the list. | ||
216 | * @param swapThis - the first jumps to swap. | 289 | * @param swapThis - the first index to swap. | ||
217 | * @param withThis - the second jumps to swap. | 290 | * @param withThis - the second index to swap. | ||
291 | */ | ||||
292 | Q_INVOKABLE bool swapJumps(int swapThis, int withThis); | ||||
293 | /** | ||||
294 | * @brief the amount of jumps on this page. | ||||
295 | */ | ||||
296 | int jumpCount(); | ||||
297 | /** | ||||
298 | * @brief changes when the jumpcount changes. | ||||
218 | */ | 299 | */ | ||
219 | bool swapJumps(Jump* swapThis, Jump* withThis); | 300 | Q_SIGNAL void jumpCountChanged(); | ||
220 | 301 | | |||
221 | /** | 302 | /** | ||
222 | * @returns whether this is the cover page. | 303 | * @returns whether this is the cover page. | ||
Context not available. |