Changeset View
Changeset View
Standalone View
Standalone View
src/acbf/AcbfTextlayer.h
Context not available. | |||||
39 | class ACBF_EXPORT Textlayer : public QObject | 39 | class ACBF_EXPORT Textlayer : public QObject | ||
---|---|---|---|---|---|
40 | { | 40 | { | ||
41 | Q_OBJECT | 41 | Q_OBJECT | ||
42 | Q_PROPERTY(QString language READ language WRITE setLanguage NOTIFY languageChanged) | ||||
43 | Q_PROPERTY(QString bgcolor READ bgcolor WRITE setBgcolor NOTIFY bgcolorChanged) | ||||
44 | Q_PROPERTY(int textareaCount READ textareaCount NOTIFY textareaCountChanged) | ||||
42 | public: | 45 | public: | ||
43 | explicit Textlayer(Page* parent = nullptr); | 46 | explicit Textlayer(Page* parent = nullptr); | ||
44 | ~Textlayer() override; | 47 | ~Textlayer() override; | ||
Context not available. | |||||
63 | * code format joined by a dash (not an underscore). | 66 | * code format joined by a dash (not an underscore). | ||
64 | */ | 67 | */ | ||
65 | void setLanguage(const QString& language); | 68 | void setLanguage(const QString& language); | ||
69 | /** | ||||
70 | * @brief fires when the language changes. | ||||
71 | */ | ||||
72 | Q_SIGNAL void languageChanged(); | ||||
66 | 73 | | |||
67 | /** | 74 | /** | ||
68 | * @return the background color as a QString. | 75 | * @return the background color as a QString. | ||
Context not available. | |||||
76 | * @param newColor - a String with an 8bit per channel rgb hexcode (#ff00ff, or the like) | 83 | * @param newColor - a String with an 8bit per channel rgb hexcode (#ff00ff, or the like) | ||
77 | */ | 84 | */ | ||
78 | void setBgcolor(const QString& newColor = QString()); | 85 | void setBgcolor(const QString& newColor = QString()); | ||
86 | /** | ||||
87 | * @brief fires when the background color changes. | ||||
88 | */ | ||||
89 | Q_SIGNAL void bgcolorChanged(); | ||||
79 | 90 | | |||
80 | /** | 91 | /** | ||
81 | * @returns a list of textareas in this page. | 92 | * @returns a list of textareas in this page. | ||
Context not available. | |||||
85 | * @param index - index of the textarea. | 96 | * @param index - index of the textarea. | ||
86 | * @return the textarea of that index. | 97 | * @return the textarea of that index. | ||
87 | */ | 98 | */ | ||
88 | Textarea* textarea(int index) const; | 99 | Q_INVOKABLE Textarea* textarea(int index) const; | ||
89 | /** | 100 | /** | ||
90 | * @param textarea - the textarea you want to index of. | 101 | * @param textarea - the textarea you want to index of. | ||
91 | * @returns the index of the given textarea. | 102 | * @returns the index of the given textarea. | ||
92 | */ | 103 | */ | ||
93 | int textareaIndex(Textarea* textarea) const; | 104 | Q_INVOKABLE int textareaIndex(Textarea* textarea) const; | ||
94 | 105 | | |||
95 | /** | 106 | /** | ||
96 | * \brief add a textarea to the list of frames. | 107 | * \brief add a textarea to the list of frames. | ||
97 | * @param textarea - the frame to add. | 108 | * @param textarea - the textarea to add. | ||
98 | * @param index - the index to add it at. If afterIndex is larger than | 109 | * @param index - the index to add it at. If afterIndex is larger than | ||
99 | * zero, the insertion will happen at that index | 110 | * zero, the insertion will happen at that index | ||
100 | */ | 111 | */ | ||
101 | void addTextarea(Textarea* textarea, int index = -1); | 112 | void addTextarea(Textarea* textarea, int index = -1); | ||
113 | /** | ||||
114 | * @brief add a text area at index. | ||||
115 | * @param index - the index to add it at. If afterIndex is larger than | ||||
116 | * zero, the insertion will happen at that index | ||||
117 | */ | ||||
118 | Q_INVOKABLE void addTextarea(int index = -1); | ||||
102 | /** | 119 | /** | ||
103 | * \brief remove the given textarea from the framelist. | 120 | * \brief remove the given textarea from the framelist. | ||
104 | * @param textarea - the textarea to remove. | 121 | * @param textarea - the textarea to remove. | ||
105 | */ | 122 | */ | ||
106 | void removeTextarea(Textarea* textarea); | 123 | void removeTextarea(Textarea* textarea); | ||
124 | /** | ||||
125 | * @brief addTextarea | ||||
126 | * @param index to remove the textarea at. | ||||
127 | */ | ||||
128 | Q_INVOKABLE void removeTextarea(int index); | ||||
107 | /** | 129 | /** | ||
108 | * \brief Swap two textareas in the list. | 130 | * \brief Swap two textareas in the list. | ||
109 | * @param swapThis - the first textarea to swap. | 131 | * @param swapThis - the first textarea to swap. | ||
110 | * @param withThis - the second textarea to swap. | 132 | * @param withThis - the second textarea to swap. | ||
111 | */ | 133 | */ | ||
112 | bool swapTextareas(Textarea* swapThis, Textarea* withThis); | 134 | Q_INVOKABLE bool swapTextareas(int swapThis, int withThis); | ||
135 | /** | ||||
136 | * @brief textareaCount | ||||
137 | * @return | ||||
138 | */ | ||||
139 | int textareaCount(); | ||||
140 | /** | ||||
141 | * @brief textareaCountChanged | ||||
142 | */ | ||||
143 | Q_SIGNAL void textareaCountChanged(); | ||||
113 | private: | 144 | private: | ||
114 | class Private; | 145 | class Private; | ||
115 | std::unique_ptr<Private> d; | 146 | std::unique_ptr<Private> d; | ||
Context not available. |