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 duplicate a text layer to a different language, if languageFrom doesn't | ||||
185 | * exist this makes a new text layer. | ||||
186 | * @param languageFrom the language from which to duplicate. | ||||
187 | * @param languageTo the language to make the new text layer at. | ||||
188 | */ | ||||
189 | Q_INVOKABLE void duplicateTextLayer(const QString&languageFrom, const QString& languageTo = QString()); | ||||
190 | /** | ||||
191 | * @brief get the possible translations. | ||||
192 | * @return a stringlist with all the languages available. | ||||
193 | */ | ||||
194 | QStringList textLayerLanguages() const; | ||||
195 | /** | ||||
196 | * @brief fires when the textlayer languages list changes | ||||
197 | * | ||||
198 | * this can happen when text layers are added or removed. | ||||
199 | */ | ||||
200 | Q_SIGNAL void textLayerLanguagesChanged(); | ||||
152 | 201 | | |||
153 | /** | 202 | /** | ||
154 | * @returns a list of frames in this page. | 203 | * @returns a list of frames in this page. | ||
Context not available. | |||||
158 | * @param index - index of the frame. | 207 | * @param index - index of the frame. | ||
159 | * @return the frame of that index. | 208 | * @return the frame of that index. | ||
160 | */ | 209 | */ | ||
161 | Frame* frame(int index) const; | 210 | Q_INVOKABLE Frame* frame(int index) const; | ||
162 | /** | 211 | /** | ||
163 | * @param frame - the frame you want to index of. | 212 | * @param frame - the frame you want to index of. | ||
164 | * @returns the index of the given frame. | 213 | * @returns the index of the given frame. | ||
Context not available. | |||||
177 | * @param frame - the frame to remove. | 226 | * @param frame - the frame to remove. | ||
178 | */ | 227 | */ | ||
179 | void removeFrame(Frame* frame); | 228 | void removeFrame(Frame* frame); | ||
229 | /** | ||||
230 | * @brief remove frame by index. | ||||
231 | * @param index index of the frame to remove. | ||||
232 | */ | ||||
233 | Q_INVOKABLE void removeFrame(int index); | ||||
234 | /** | ||||
235 | * @brief add a frame at index.. | ||||
236 | * @param index - the index to add it at. If afterIndex is larger than | ||||
237 | * zero, the insertion will happen at that index | ||||
238 | */ | ||||
239 | Q_INVOKABLE void addFrame(int index = -1); | ||||
180 | /** | 240 | /** | ||
181 | * \brief Swap two frames in the list. | 241 | * \brief Swap two frames in the list. | ||
182 | * @param swapThis - the first frame to swap. | 242 | * @param swapThis - the first index to swap. | ||
183 | * @param withThis - the second frame to swap. | 243 | * @param withThis - the second index to swap. | ||
184 | */ | 244 | */ | ||
185 | bool swapFrames(Frame* swapThis, Frame* withThis); | 245 | Q_INVOKABLE bool swapFrames(int swapThis, int withThis); | ||
246 | /** | ||||
247 | * @brief frameCount | ||||
248 | * @return the total amount of frames. | ||||
249 | */ | ||||
250 | int frameCount(); | ||||
251 | /** | ||||
252 | * @brief fires when the frame count changes. | ||||
253 | */ | ||||
254 | Q_SIGNAL void frameCountChanged(); | ||||
186 | 255 | | |||
187 | /** | 256 | /** | ||
188 | * @return the list of jump objects for this page. | 257 | * @return the list of jump objects for this page. | ||
Context not available. | |||||
192 | * @param index - the index for which you want the jump object. | 261 | * @param index - the index for which you want the jump object. | ||
193 | * @return a jump object for the given frame. | 262 | * @return a jump object for the given frame. | ||
194 | */ | 263 | */ | ||
195 | Jump* jump(int index) const; | 264 | Q_INVOKABLE Jump* jump(int index) const; | ||
196 | /** | 265 | /** | ||
197 | * @param jump - the jump you want to index of. | 266 | * @param jump - the jump you want to index of. | ||
198 | * @returns the index of the given jump. | 267 | * @returns the index of the given jump. | ||
Context not available. | |||||
206 | * zero, the insertion will happen at that index | 275 | * zero, the insertion will happen at that index | ||
207 | */ | 276 | */ | ||
208 | void addJump(Jump* jump, int index = -1); | 277 | void addJump(Jump* jump, int index = -1); | ||
278 | /** | ||||
279 | * @brief addJump | ||||
280 | * @param index - the index to add it at. If afterIndex is larger than | ||||
281 | * zero, the insertion will happen at that index | ||||
282 | */ | ||||
283 | Q_INVOKABLE void addJump(int pageIndex, int index = -1); | ||||
209 | /** | 284 | /** | ||
210 | * \brief remove the given jump from the list of jumps. | 285 | * \brief remove the given jump from the list of jumps. | ||
211 | * @param jump - the jump to remove. | 286 | * @param jump - the jump to remove. | ||
212 | */ | 287 | */ | ||
213 | void removeJump(Jump* jump); | 288 | void removeJump(Jump* jump); | ||
289 | /** | ||||
290 | * @brief removeJump | ||||
291 | * @param index to remove the jump at. | ||||
292 | */ | ||||
293 | Q_INVOKABLE void removeJump(int index); | ||||
214 | /** | 294 | /** | ||
215 | * \brief Swap two jumps in the list. | 295 | * \brief Swap two jumps in the list. | ||
216 | * @param swapThis - the first jumps to swap. | 296 | * @param swapThis - the first index to swap. | ||
217 | * @param withThis - the second jumps to swap. | 297 | * @param withThis - the second index to swap. | ||
298 | */ | ||||
299 | Q_INVOKABLE bool swapJumps(int swapThis, int withThis); | ||||
300 | /** | ||||
301 | * @brief the amount of jumps on this page. | ||||
302 | */ | ||||
303 | int jumpCount(); | ||||
304 | /** | ||||
305 | * @brief changes when the jumpcount changes. | ||||
218 | */ | 306 | */ | ||
219 | bool swapJumps(Jump* swapThis, Jump* withThis); | 307 | Q_SIGNAL void jumpCountChanged(); | ||
220 | 308 | | |||
221 | /** | 309 | /** | ||
222 | * @returns whether this is the cover page. | 310 | * @returns whether this is the cover page. | ||
Context not available. |