/usr/include/poppler/qt5/poppler-form.h is in libpoppler-qt5-dev 0.24.5-2ubuntu4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 | /* poppler-form.h: qt interface to poppler
* Copyright (C) 2007-2008, Pino Toscano <pino@kde.org>
* Copyright (C) 2008, 2011, Albert Astals Cid <aacid@kde.org>
* Copyright (C) 2012, Adam Reichold <adamreichold@myopera.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _POPPLER_QT5_FORM_H_
#define _POPPLER_QT5_FORM_H_
#include <QtCore/QRectF>
#include <QtCore/QStringList>
#include "poppler-export.h"
class Page;
class FormWidget;
class FormWidgetButton;
class FormWidgetText;
class FormWidgetChoice;
namespace Poppler {
class DocumentData;
class Link;
class FormFieldData;
/**
The base class representing a form field.
\since 0.6
*/
class POPPLER_QT5_EXPORT FormField {
public:
/**
The different types of form field.
*/
enum FormType {
FormButton, ///< A button field. See \ref Poppler::FormFieldButton::ButtonType "ButtonType"
FormText, ///< A text field. See \ref Poppler::FormFieldText::TextType "TextType"
FormChoice, ///< A single choice field. See \ref Poppler::FormFieldChoice::ChoiceType "ChoiceType"
FormSignature ///< A signature field.
};
virtual ~FormField();
/**
The type of the field.
*/
virtual FormType type() const = 0;
/**
\return The size of the field, in normalized coordinates, i.e.
[0..1] with regard to the dimensions (cropbox) of the page
*/
QRectF rect() const;
/**
The ID of the field.
*/
int id() const;
/**
The internal name of the field.
*/
QString name() const;
/**
The internal fully qualified name of the field.
\since 0.18
*/
QString fullyQualifiedName() const;
/**
The name of the field to be used in user interface (eg messages to
the user).
*/
QString uiName() const;
/**
Whether this form field is read-only.
*/
bool isReadOnly() const;
/**
Whether this form field is visible.
*/
bool isVisible() const;
/**
The activation action of this form field.
\note It may be null.
*/
Link* activationAction() const;
protected:
/// \cond PRIVATE
FormField(FormFieldData &dd);
FormFieldData *m_formData;
/// \endcond
private:
Q_DISABLE_COPY(FormField)
};
/**
A form field that represents a "button".
\since 0.8
*/
class POPPLER_QT5_EXPORT FormFieldButton : public FormField {
public:
/**
* The types of button field.
*/
enum ButtonType
{
Push, ///< A simple push button.
CheckBox, ///< A check box.
Radio ///< A radio button.
};
/// \cond PRIVATE
FormFieldButton(DocumentData *doc, ::Page *p, ::FormWidgetButton *w);
/// \endcond
virtual ~FormFieldButton();
virtual FormType type() const;
/**
The particular type of the button field.
*/
ButtonType buttonType() const;
/**
* The caption to be used for the button.
*/
QString caption() const;
/**
The state of the button.
*/
bool state() const;
/**
Sets the state of the button to the new \p state .
*/
void setState( bool state );
/**
The list with the IDs of siblings (ie, buttons belonging to the same
group as the current one.
Valid only for \ref Radio buttons, an empty list otherwise.
*/
QList<int> siblings() const;
private:
Q_DISABLE_COPY(FormFieldButton)
};
/**
A form field that represents a text input.
\since 0.6
*/
class POPPLER_QT5_EXPORT FormFieldText : public FormField {
public:
/**
The particular type of this text field.
*/
enum TextType {
Normal, ///< A simple singleline text field.
Multiline, ///< A multiline text field.
FileSelect ///< An input field to select the path of a file on disk.
};
/// \cond PRIVATE
FormFieldText(DocumentData *doc, ::Page *p, ::FormWidgetText *w);
/// \endcond
virtual ~FormFieldText();
virtual FormType type() const;
/**
The text type of the text field.
*/
TextType textType() const;
/**
The text associated with the text field.
*/
QString text() const;
/**
Sets the text associated with the text field to the specified
\p text.
*/
void setText( const QString& text );
/**
Whether this text field is a password input, eg its text \b must be
replaced with asterisks.
Always false for \ref FileSelect text fields.
*/
bool isPassword() const;
/**
Whether this text field should allow rich text.
*/
bool isRichText() const;
/**
The maximum length for the text of this field, or -1 if not set.
*/
int maximumLength() const;
/**
The horizontal alignment for the text of this text field.
*/
Qt::Alignment textAlignment() const;
/**
Whether the text inserted manually in the field (where possible)
can be spell-checked.
*/
bool canBeSpellChecked() const;
private:
Q_DISABLE_COPY(FormFieldText)
};
/**
A form field that represents a choice field.
\since 0.6
*/
class POPPLER_QT5_EXPORT FormFieldChoice : public FormField {
public:
/**
The particular type of this choice field.
*/
enum ChoiceType {
ComboBox, ///< A simple singleline text field.
ListBox ///< A multiline text field.
};
/// \cond PRIVATE
FormFieldChoice(DocumentData *doc, ::Page *p, ::FormWidgetChoice *w);
/// \endcond
virtual ~FormFieldChoice();
virtual FormType type() const;
/**
The choice type of the choice field.
*/
ChoiceType choiceType() const;
/**
The possible choices of the choice field.
*/
QStringList choices() const;
/**
Whether this FormFieldChoice::ComboBox is editable, i.e. the user
can type in a custom value.
Always false for the other types of choices.
*/
bool isEditable() const;
/**
Whether more than one choice of this FormFieldChoice::ListBox
can be selected at the same time.
Always false for the other types of choices.
*/
bool multiSelect() const;
/**
The currently selected choices.
*/
QList<int> currentChoices() const;
/**
Sets the selected choices to \p choice.
*/
void setCurrentChoices( const QList<int> &choice );
/**
The text entered into an editable combo box choice field. Otherwise a null string.
\since 0.22
*/
QString editChoice() const;
/**
Sets the text entered into an editable combo box choice field. Otherwise does nothing.
\since 0.22
*/
void setEditChoice(const QString& text);
/**
The horizontal alignment for the text of this text field.
*/
Qt::Alignment textAlignment() const;
/**
Whether the text inserted manually in the field (where possible)
can be spell-checked.
Returns false if the field is not an editable text field.
*/
bool canBeSpellChecked() const;
private:
Q_DISABLE_COPY(FormFieldChoice)
};
}
#endif
|