• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdegraphics API Reference
  • KDE Home
  • Contact Us
 

okular

  • sources
  • kde-4.12
  • kdegraphics
  • okular
  • core
form.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2007 by Pino Toscano <pino@kde.org> *
3  * *
4  * This program is free software; you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation; either version 2 of the License, or *
7  * (at your option) any later version. *
8  ***************************************************************************/
9 
10 #ifndef _OKULAR_FORM_H_
11 #define _OKULAR_FORM_H_
12 
13 #include "okular_export.h"
14 #include "area.h"
15 
16 #include <QtCore/QStringList>
17 
18 namespace Okular {
19 
20 class Action;
21 class Page;
22 class PagePrivate;
23 class FormFieldPrivate;
24 class FormFieldButtonPrivate;
25 class FormFieldTextPrivate;
26 class FormFieldChoicePrivate;
27 
36 class OKULAR_EXPORT FormField
37 {
39  friend class Page;
40  friend class PagePrivate;
42 
43  public:
47  enum FieldType
48  {
49  FormButton,
50  FormText,
51  FormChoice,
52  FormSignature
53  };
54 
55  virtual ~FormField();
56 
60  FieldType type() const;
61 
65  virtual NormalizedRect rect() const = 0;
66 
70  virtual int id() const = 0;
71 
76  virtual QString name() const = 0;
77 
82  virtual QString uiName() const = 0;
83 
87  virtual bool isReadOnly() const;
88 
92  virtual bool isVisible() const;
93 
94  Action* activationAction() const;
95 
96  protected:
98  FormField( FormFieldPrivate &dd );
99  Q_DECLARE_PRIVATE( FormField )
100  FormFieldPrivate *d_ptr;
102 
103  void setActivationAction( Action *action );
104 
105  private:
106  Q_DISABLE_COPY( FormField )
107 };
108 
109 
118 class OKULAR_EXPORT FormFieldButton : public FormField
119 {
120  public:
124  enum ButtonType
125  {
126  Push,
127  CheckBox,
128  Radio
129  };
130 
131  virtual ~FormFieldButton();
132 
136  virtual ButtonType buttonType() const = 0;
137 
141  virtual QString caption() const = 0;
142 
146  virtual bool state() const = 0;
147 
151  virtual void setState( bool state );
152 
159  virtual QList< int > siblings() const = 0;
160 
161  protected:
162  FormFieldButton();
163 
164  private:
165  Q_DECLARE_PRIVATE( FormFieldButton )
166  Q_DISABLE_COPY( FormFieldButton )
167 };
168 
169 
176 class OKULAR_EXPORT FormFieldText : public FormField
177 {
178  public:
182  enum TextType
183  {
184  Normal,
185  Multiline,
186  FileSelect
187  };
188 
189  virtual ~FormFieldText();
190 
194  virtual TextType textType() const = 0;
195 
199  virtual QString text() const = 0;
200 
208  virtual void setText( const QString& text );
209 
216  virtual bool isPassword() const;
217 
221  virtual bool isRichText() const;
222 
227  virtual int maximumLength() const;
228 
232  virtual Qt::Alignment textAlignment() const;
233 
240  virtual bool canBeSpellChecked() const;
241 
242  protected:
243  FormFieldText();
244 
245  private:
246  Q_DECLARE_PRIVATE( FormFieldText )
247  Q_DISABLE_COPY( FormFieldText )
248 };
249 
250 
258 class OKULAR_EXPORT FormFieldChoice : public FormField
259 {
260  public:
264  enum ChoiceType
265  {
266  ComboBox,
267  ListBox
268  };
269 
270  virtual ~FormFieldChoice();
271 
275  virtual ChoiceType choiceType() const = 0;
276 
280  virtual QStringList choices() const = 0;
281 
288  virtual bool isEditable() const;
289 
296  virtual bool multiSelect() const;
297 
303  virtual QList< int > currentChoices() const = 0;
304 
308  virtual void setCurrentChoices( const QList< int >& choices );
309 
315  virtual QString editChoice() const;
316 
322  virtual void setEditChoice( const QString& text );
323 
327  virtual Qt::Alignment textAlignment() const;
328 
335  virtual bool canBeSpellChecked() const;
336 
337  protected:
338  FormFieldChoice();
339 
340  private:
341  Q_DECLARE_PRIVATE( FormFieldChoice )
342  Q_DISABLE_COPY( FormFieldChoice )
343 };
344 
345 }
346 
347 #endif
Okular::FormFieldText::TextType
TextType
The types of text field.
Definition: form.h:182
Okular::FormFieldPrivate
Definition: form_p.h:22
Okular::FormField::FormChoice
A choice field. See FormFieldChoice::ChoiceType.
Definition: form.h:51
Okular::PagePrivate
Definition: page_p.h:55
Okular::FormFieldButton::CheckBox
A check box.
Definition: form.h:127
Okular::NormalizedRect
NormalizedRect is a helper class which stores the coordinates of a normalized rect, which is a rectangle of.
Definition: area.h:105
Okular::FormField::FieldType
FieldType
The types of form field.
Definition: form.h:47
area.h
Okular::FormField::FormText
A field of variable text. See FormFieldText::TextType.
Definition: form.h:50
Okular::FormFieldChoice::ComboBox
A combo box choice field.
Definition: form.h:266
Okular::FormField::FormButton
A "button". See FormFieldButton::ButtonType.
Definition: form.h:49
okular_export.h
Okular::FormFieldText
Interface of a text form field.
Definition: form.h:176
Okular::FormFieldButton::ButtonType
ButtonType
The types of button field.
Definition: form.h:124
Okular::FormFieldText::Normal
A simple singleline text field.
Definition: form.h:184
Okular::FormFieldChoice
Interface of a choice form field.
Definition: form.h:258
Okular::Page
Collector for all the data belonging to a page.
Definition: page.h:49
Okular::FormFieldButton::Push
A simple push button.
Definition: form.h:126
Okular::FormFieldChoice::ChoiceType
ChoiceType
The types of choice field.
Definition: form.h:264
Okular::Action
Encapsulates data that describes an action.
Definition: action.h:43
OKULAR_EXPORT
#define OKULAR_EXPORT
Definition: okular_export.h:30
Okular::FormFieldText::Multiline
A multiline text field.
Definition: form.h:185
Okular::FormFieldButton
Interface of a button form field.
Definition: form.h:118
Okular::FormField
The base interface of a form field.
Definition: form.h:36
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:45:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

okular

Skip menu "okular"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdegraphics API Reference

Skip menu "kdegraphics API Reference"
  •     libkdcraw
  •     libkexiv2
  •     libkipi
  •     libksane
  • okular

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal