Changeset View
Changeset View
Standalone View
Standalone View
ui/formwidgets.h
Show First 20 Lines • Show All 164 Lines • ▼ Show 20 Line(s) | 162 | protected: | |||
---|---|---|---|---|---|
165 | FormWidgetsController * m_controller; | 165 | FormWidgetsController * m_controller; | ||
166 | Okular::FormField * m_ff; | 166 | Okular::FormField * m_ff; | ||
167 | 167 | | |||
168 | private: | 168 | private: | ||
169 | QWidget * m_widget; | 169 | QWidget * m_widget; | ||
170 | PageViewItem * m_pageItem; | 170 | PageViewItem * m_pageItem; | ||
171 | }; | 171 | }; | ||
172 | 172 | | |||
173 | #define DECLARE_ADDITIONAL_ACTIONS \ | ||||
174 | protected: \ | ||||
175 | virtual void mousePressEvent( QMouseEvent *event ) override; \ | ||||
176 | virtual void mouseReleaseEvent( QMouseEvent *event ) override; \ | ||||
177 | virtual void focusInEvent( QFocusEvent *event ) override; \ | ||||
178 | virtual void focusOutEvent( QFocusEvent *event ) override; \ | ||||
179 | virtual void leaveEvent( QEvent *event ) override; \ | ||||
180 | virtual void enterEvent( QEvent *event ) override; | ||||
173 | 181 | | |||
174 | class PushButtonEdit : public QPushButton, public FormWidgetIface | 182 | class PushButtonEdit : public QPushButton, public FormWidgetIface | ||
175 | { | 183 | { | ||
176 | Q_OBJECT | 184 | Q_OBJECT | ||
177 | 185 | | |||
178 | public: | 186 | public: | ||
179 | explicit PushButtonEdit( Okular::FormFieldButton * button, QWidget * parent = nullptr ); | 187 | explicit PushButtonEdit( Okular::FormFieldButton * button, QWidget * parent = nullptr ); | ||
180 | 188 | | |||
181 | private Q_SLOTS: | 189 | private Q_SLOTS: | ||
182 | void slotClicked(); | 190 | void slotClicked(); | ||
191 | DECLARE_ADDITIONAL_ACTIONS | ||||
183 | }; | 192 | }; | ||
184 | 193 | | |||
185 | class CheckBoxEdit : public QCheckBox, public FormWidgetIface | 194 | class CheckBoxEdit : public QCheckBox, public FormWidgetIface | ||
186 | { | 195 | { | ||
187 | Q_OBJECT | 196 | Q_OBJECT | ||
188 | 197 | | |||
189 | public: | 198 | public: | ||
190 | explicit CheckBoxEdit( Okular::FormFieldButton * button, QWidget * parent = nullptr ); | 199 | explicit CheckBoxEdit( Okular::FormFieldButton * button, QWidget * parent = nullptr ); | ||
191 | 200 | | |||
192 | // reimplemented from FormWidgetIface | 201 | // reimplemented from FormWidgetIface | ||
193 | void setFormWidgetsController( FormWidgetsController *controller ) override; | 202 | void setFormWidgetsController( FormWidgetsController *controller ) override; | ||
194 | 203 | | |||
195 | void doActivateAction(); | 204 | void doActivateAction(); | ||
196 | 205 | | |||
197 | protected: | 206 | protected: | ||
198 | void slotRefresh( Okular::FormField *form ) override; | 207 | void slotRefresh( Okular::FormField *form ) override; | ||
208 | DECLARE_ADDITIONAL_ACTIONS | ||||
199 | }; | 209 | }; | ||
200 | 210 | | |||
201 | class RadioButtonEdit : public QRadioButton, public FormWidgetIface | 211 | class RadioButtonEdit : public QRadioButton, public FormWidgetIface | ||
202 | { | 212 | { | ||
203 | Q_OBJECT | 213 | Q_OBJECT | ||
204 | 214 | | |||
205 | public: | 215 | public: | ||
206 | explicit RadioButtonEdit( Okular::FormFieldButton * button, QWidget * parent = nullptr ); | 216 | explicit RadioButtonEdit( Okular::FormFieldButton * button, QWidget * parent = nullptr ); | ||
207 | 217 | | |||
208 | // reimplemented from FormWidgetIface | 218 | // reimplemented from FormWidgetIface | ||
209 | void setFormWidgetsController( FormWidgetsController *controller ) override; | 219 | void setFormWidgetsController( FormWidgetsController *controller ) override; | ||
220 | DECLARE_ADDITIONAL_ACTIONS | ||||
210 | }; | 221 | }; | ||
211 | 222 | | |||
212 | class FormLineEdit : public QLineEdit, public FormWidgetIface | 223 | class FormLineEdit : public QLineEdit, public FormWidgetIface | ||
213 | { | 224 | { | ||
214 | Q_OBJECT | 225 | Q_OBJECT | ||
215 | 226 | | |||
216 | public: | 227 | public: | ||
217 | explicit FormLineEdit( Okular::FormFieldText * text, QWidget * parent = nullptr ); | 228 | explicit FormLineEdit( Okular::FormFieldText * text, QWidget * parent = nullptr ); | ||
Show All 12 Lines | 240 | private Q_SLOTS: | |||
230 | void slotChanged(); | 241 | void slotChanged(); | ||
231 | 242 | | |||
232 | protected: | 243 | protected: | ||
233 | void slotRefresh( Okular::FormField* form ) override; | 244 | void slotRefresh( Okular::FormField* form ) override; | ||
234 | 245 | | |||
235 | private: | 246 | private: | ||
236 | int m_prevCursorPos; | 247 | int m_prevCursorPos; | ||
237 | int m_prevAnchorPos; | 248 | int m_prevAnchorPos; | ||
249 | DECLARE_ADDITIONAL_ACTIONS | ||||
238 | }; | 250 | }; | ||
239 | 251 | | |||
240 | class TextAreaEdit : public KTextEdit, public FormWidgetIface | 252 | class TextAreaEdit : public KTextEdit, public FormWidgetIface | ||
241 | { | 253 | { | ||
242 | Q_OBJECT | 254 | Q_OBJECT | ||
243 | 255 | | |||
244 | public: | 256 | public: | ||
245 | explicit TextAreaEdit( Okular::FormFieldText * text, QWidget * parent = nullptr ); | 257 | explicit TextAreaEdit( Okular::FormFieldText * text, QWidget * parent = nullptr ); | ||
Show All 13 Lines | 270 | private Q_SLOTS: | |||
259 | void slotChanged(); | 271 | void slotChanged(); | ||
260 | 272 | | |||
261 | protected: | 273 | protected: | ||
262 | void slotRefresh( Okular::FormField* form ) override; | 274 | void slotRefresh( Okular::FormField* form ) override; | ||
263 | 275 | | |||
264 | private: | 276 | private: | ||
265 | int m_prevCursorPos; | 277 | int m_prevCursorPos; | ||
266 | int m_prevAnchorPos; | 278 | int m_prevAnchorPos; | ||
279 | DECLARE_ADDITIONAL_ACTIONS | ||||
267 | }; | 280 | }; | ||
268 | 281 | | |||
269 | 282 | | |||
270 | class FileEdit : public KUrlRequester, public FormWidgetIface | 283 | class FileEdit : public KUrlRequester, public FormWidgetIface | ||
271 | { | 284 | { | ||
272 | Q_OBJECT | 285 | Q_OBJECT | ||
273 | 286 | | |||
274 | public: | 287 | public: | ||
Show All 9 Lines | 295 | private Q_SLOTS: | |||
284 | void slotHandleFileChangedByUndoRedo( int pageNumber, | 297 | void slotHandleFileChangedByUndoRedo( int pageNumber, | ||
285 | Okular::FormFieldText * form, | 298 | Okular::FormFieldText * form, | ||
286 | const QString & contents, | 299 | const QString & contents, | ||
287 | int cursorPos, | 300 | int cursorPos, | ||
288 | int anchorPos ); | 301 | int anchorPos ); | ||
289 | private: | 302 | private: | ||
290 | int m_prevCursorPos; | 303 | int m_prevCursorPos; | ||
291 | int m_prevAnchorPos; | 304 | int m_prevAnchorPos; | ||
305 | DECLARE_ADDITIONAL_ACTIONS | ||||
292 | }; | 306 | }; | ||
293 | 307 | | |||
294 | 308 | | |||
295 | class ListEdit : public QListWidget, public FormWidgetIface | 309 | class ListEdit : public QListWidget, public FormWidgetIface | ||
296 | { | 310 | { | ||
297 | Q_OBJECT | 311 | Q_OBJECT | ||
298 | 312 | | |||
299 | public: | 313 | public: | ||
300 | explicit ListEdit( Okular::FormFieldChoice * choice, QWidget * parent = nullptr ); | 314 | explicit ListEdit( Okular::FormFieldChoice * choice, QWidget * parent = nullptr ); | ||
301 | void setFormWidgetsController( FormWidgetsController *controller ) override; | 315 | void setFormWidgetsController( FormWidgetsController *controller ) override; | ||
302 | 316 | | |||
303 | private Q_SLOTS: | 317 | private Q_SLOTS: | ||
304 | void slotSelectionChanged(); | 318 | void slotSelectionChanged(); | ||
305 | void slotHandleFormListChangedByUndoRedo( int pageNumber, | 319 | void slotHandleFormListChangedByUndoRedo( int pageNumber, | ||
306 | Okular::FormFieldChoice * listForm, | 320 | Okular::FormFieldChoice * listForm, | ||
307 | const QList< int > & choices ); | 321 | const QList< int > & choices ); | ||
322 | DECLARE_ADDITIONAL_ACTIONS | ||||
308 | }; | 323 | }; | ||
309 | 324 | | |||
310 | 325 | | |||
311 | class ComboEdit : public QComboBox, public FormWidgetIface | 326 | class ComboEdit : public QComboBox, public FormWidgetIface | ||
312 | { | 327 | { | ||
313 | Q_OBJECT | 328 | Q_OBJECT | ||
314 | 329 | | |||
315 | public: | 330 | public: | ||
Show All 9 Lines | 338 | void slotHandleFormComboChangedByUndoRedo( int pageNumber, | |||
325 | const QString & text, | 340 | const QString & text, | ||
326 | int cursorPos, | 341 | int cursorPos, | ||
327 | int anchorPos | 342 | int anchorPos | ||
328 | ); | 343 | ); | ||
329 | 344 | | |||
330 | private: | 345 | private: | ||
331 | int m_prevCursorPos; | 346 | int m_prevCursorPos; | ||
332 | int m_prevAnchorPos; | 347 | int m_prevAnchorPos; | ||
348 | DECLARE_ADDITIONAL_ACTIONS | ||||
333 | }; | 349 | }; | ||
334 | 350 | | |||
351 | #undef DECLARE_ADDITIONAL_ACTIONS | ||||
352 | | ||||
335 | #endif | 353 | #endif |