2021-05-24 07:25:56 +00:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2007 Pino Toscano <pino@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2007-02-25 00:07:59 +00:00
|
|
|
|
|
|
|
#ifndef _OKULAR_FORM_H_
|
|
|
|
#define _OKULAR_FORM_H_
|
|
|
|
|
2018-05-30 08:04:06 +00:00
|
|
|
#include "annotations.h"
|
2011-06-01 08:31:44 +00:00
|
|
|
#include "area.h"
|
2022-01-03 14:49:10 +00:00
|
|
|
#include "document.h"
|
2014-10-27 21:35:06 +00:00
|
|
|
#include "okularcore_export.h"
|
2019-01-05 22:30:25 +00:00
|
|
|
#include "signatureutils.h"
|
2007-02-25 00:07:59 +00:00
|
|
|
|
2018-08-31 09:23:45 +00:00
|
|
|
#include <QStringList>
|
2007-02-25 00:07:59 +00:00
|
|
|
|
2019-01-05 22:30:25 +00:00
|
|
|
#include <memory>
|
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
namespace Okular
|
|
|
|
{
|
2008-03-20 17:42:17 +00:00
|
|
|
class Action;
|
2007-07-04 11:41:45 +00:00
|
|
|
class Page;
|
|
|
|
class PagePrivate;
|
2007-07-03 17:20:38 +00:00
|
|
|
class FormFieldPrivate;
|
2008-02-11 10:41:04 +00:00
|
|
|
class FormFieldButtonPrivate;
|
2007-07-03 17:20:38 +00:00
|
|
|
class FormFieldTextPrivate;
|
|
|
|
class FormFieldChoicePrivate;
|
2019-01-05 22:30:25 +00:00
|
|
|
class FormFieldSignaturePrivate;
|
2007-07-03 17:20:38 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* @short The base interface of a form field.
|
|
|
|
*
|
|
|
|
* This is the very basic interface to represent a field in a form.
|
|
|
|
*
|
|
|
|
* This is not meant to be used as a direct base for the form fields in a
|
|
|
|
* document, but its abstract subclasses are.
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT FormField
|
2007-02-25 00:07:59 +00:00
|
|
|
{
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @cond PRIVATE
|
2007-07-04 11:41:45 +00:00
|
|
|
friend class Page;
|
|
|
|
friend class PagePrivate;
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @endcond
|
2007-07-04 11:41:45 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* The types of form field.
|
|
|
|
*/
|
|
|
|
enum FieldType {
|
|
|
|
FormButton, ///< A "button". See @ref FormFieldButton::ButtonType.
|
|
|
|
FormText, ///< A field of variable text. See @ref FormFieldText::TextType.
|
|
|
|
FormChoice, ///< A choice field. See @ref FormFieldChoice::ChoiceType.
|
|
|
|
FormSignature ///< A signature.
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
virtual ~FormField();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The type of the field.
|
|
|
|
*/
|
|
|
|
FieldType type() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
2018-11-14 19:12:15 +00:00
|
|
|
* The bounding rect of the field, in normalized coordinates.
|
2007-02-25 00:07:59 +00:00
|
|
|
*/
|
|
|
|
virtual NormalizedRect rect() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The ID of the field.
|
|
|
|
*/
|
|
|
|
virtual int id() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The internal name of the field, to be used when referring to the
|
|
|
|
* field in eg scripts.
|
|
|
|
*/
|
|
|
|
virtual QString name() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The visible name of the field, to be used in the user interface
|
|
|
|
* (eg in error messages, etc).
|
|
|
|
*/
|
|
|
|
virtual QString uiName() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-08-06 17:15:17 +00:00
|
|
|
/**
|
|
|
|
* The fully qualified name of the field, is used in the JavaScript
|
|
|
|
* scripts.
|
|
|
|
*
|
|
|
|
* @since 1.9
|
|
|
|
*/
|
|
|
|
virtual QString fullyQualifiedName() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Whether the field is read-only.
|
|
|
|
*/
|
|
|
|
virtual bool isReadOnly() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2018-03-20 21:59:37 +00:00
|
|
|
/**
|
|
|
|
* Whether the field is read-only.
|
|
|
|
*
|
|
|
|
* @since 1.4
|
|
|
|
*/
|
|
|
|
virtual void setReadOnly(bool value);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Whether this form field is visible.
|
|
|
|
*/
|
|
|
|
virtual bool isVisible() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2018-04-23 21:47:42 +00:00
|
|
|
/**
|
|
|
|
* Whether the field is visible.
|
|
|
|
*
|
|
|
|
* @since 1.5
|
|
|
|
*/
|
|
|
|
virtual void setVisible(bool value);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-06-28 12:39:02 +00:00
|
|
|
/**
|
|
|
|
Whether this field is printable.
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-07-19 20:26:17 +00:00
|
|
|
@since 1.9
|
2019-06-28 12:39:02 +00:00
|
|
|
*/
|
|
|
|
virtual bool isPrintable() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-06-28 12:39:02 +00:00
|
|
|
/**
|
|
|
|
Set this field printable
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-07-19 20:26:17 +00:00
|
|
|
@since 1.9
|
2019-06-28 12:39:02 +00:00
|
|
|
*/
|
|
|
|
virtual void setPrintable(bool value);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-03-20 17:42:17 +00:00
|
|
|
Action *activationAction() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2017-03-02 23:41:06 +00:00
|
|
|
/**
|
|
|
|
* Describes the type of form additional action.
|
|
|
|
*
|
|
|
|
* @since 1.1
|
|
|
|
*/
|
|
|
|
enum AdditionalActionType {
|
|
|
|
FieldModified, ///< An action to be performed when the user modifies the field
|
|
|
|
FormatField, ///< An action to be performed before the field is formatted to display its value
|
|
|
|
ValidateField, ///< An action to be performed when the field value changes
|
|
|
|
CalculateField, ///< An action to be performed when the field needs to be recalculated
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2017-03-02 23:41:06 +00:00
|
|
|
/**
|
|
|
|
* Returns the additional action of the given @p type or @c nullptr if no action has been defined.
|
|
|
|
*
|
|
|
|
* @since 1.1
|
|
|
|
*/
|
|
|
|
Action *additionalAction(AdditionalActionType type) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2018-05-30 08:04:06 +00:00
|
|
|
/* Returns the additional action of the given @p type or @c nullptr if no action has been defined.
|
|
|
|
*
|
|
|
|
* This is for actions of annotation widgets associated with the FormField
|
|
|
|
*
|
|
|
|
* @since 1.5
|
|
|
|
*/
|
|
|
|
Action *additionalAction(Annotation::AdditionalActionType type) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2021-12-29 08:55:56 +00:00
|
|
|
/* Returns all the additional actions for this form
|
|
|
|
*
|
|
|
|
* @since 22.04
|
|
|
|
*/
|
|
|
|
QList<Action *> additionalActions() const;
|
|
|
|
|
2022-01-03 15:01:01 +00:00
|
|
|
/**
|
|
|
|
* Returns the page of this form field
|
|
|
|
*
|
|
|
|
* @since 21.12.2
|
|
|
|
*/
|
|
|
|
Page *page() const;
|
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
protected:
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @cond PRIVATE
|
2021-08-21 23:14:34 +00:00
|
|
|
explicit FormField(FormFieldPrivate &dd);
|
2007-07-03 17:20:38 +00:00
|
|
|
Q_DECLARE_PRIVATE(FormField)
|
|
|
|
FormFieldPrivate *d_ptr;
|
2007-09-01 22:48:28 +00:00
|
|
|
/// @endcond
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-03-20 17:42:17 +00:00
|
|
|
void setActivationAction(Action *action);
|
2017-03-02 23:41:06 +00:00
|
|
|
void setAdditionalAction(AdditionalActionType type, Action *action);
|
2018-05-30 08:04:06 +00:00
|
|
|
void setAdditionalAction(Annotation::AdditionalActionType type, Action *action);
|
2007-02-25 00:07:59 +00:00
|
|
|
|
2020-07-10 22:15:05 +00:00
|
|
|
private:
|
2007-02-25 00:07:59 +00:00
|
|
|
Q_DISABLE_COPY(FormField)
|
2020-07-10 22:15:05 +00:00
|
|
|
};
|
2007-02-25 00:07:59 +00:00
|
|
|
|
2008-02-11 10:41:04 +00:00
|
|
|
/**
|
|
|
|
* @short Interface of a button form field.
|
|
|
|
*
|
|
|
|
* This is the base interface to reimplement to represent a button field, like
|
|
|
|
* a push button, a check box or a radio button.
|
|
|
|
*
|
|
|
|
* @since 0.7 (KDE 4.1)
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT FormFieldButton : public FormField
|
2008-02-11 10:41:04 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* The types of button field.
|
|
|
|
*/
|
|
|
|
enum ButtonType {
|
|
|
|
Push, ///< A simple push button.
|
|
|
|
CheckBox, ///< A check box.
|
|
|
|
Radio ///< A radio button.
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-12-18 11:51:13 +00:00
|
|
|
~FormFieldButton() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-02-11 10:41:04 +00:00
|
|
|
/**
|
|
|
|
The particular type of the button field.
|
|
|
|
*/
|
|
|
|
virtual ButtonType buttonType() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-02-11 10:41:04 +00:00
|
|
|
/**
|
|
|
|
* The caption to be used for the button.
|
|
|
|
*/
|
|
|
|
virtual QString caption() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-02-11 10:41:04 +00:00
|
|
|
/**
|
|
|
|
* The state of the button.
|
|
|
|
*/
|
|
|
|
virtual bool state() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-02-11 10:41:04 +00:00
|
|
|
/**
|
|
|
|
* Sets the state of the button to the new \p state .
|
|
|
|
*/
|
|
|
|
virtual void setState(bool state);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-02-11 10:41:04 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
virtual QList<int> siblings() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-06-06 15:46:21 +00:00
|
|
|
/**
|
|
|
|
* Sets the icon of the Button to the Icon of the field parameter.
|
|
|
|
*
|
2019-07-19 20:26:17 +00:00
|
|
|
* @since 1.9
|
2019-06-06 15:46:21 +00:00
|
|
|
*/
|
|
|
|
virtual void setIcon(Okular::FormField *field);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-02-11 10:41:04 +00:00
|
|
|
protected:
|
|
|
|
FormFieldButton();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2008-02-11 10:41:04 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(FormFieldButton)
|
|
|
|
Q_DISABLE_COPY(FormFieldButton)
|
|
|
|
};
|
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* @short Interface of a text form field.
|
|
|
|
*
|
|
|
|
* This is the base interface to reimplement to represent a text field, ie a
|
|
|
|
* field where the user insert text.
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT FormFieldText : public FormField
|
2007-02-25 00:07:59 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* The types of 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.
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-12-18 11:51:13 +00:00
|
|
|
~FormFieldText() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The particular type of the text field.
|
|
|
|
*/
|
|
|
|
virtual TextType textType() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The text of text field.
|
|
|
|
*/
|
|
|
|
virtual QString text() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Sets the new @p text in the text field.
|
|
|
|
*
|
|
|
|
* The default implementation does nothing.
|
|
|
|
*
|
|
|
|
* Reimplemented only if the setting of new text is supported.
|
|
|
|
*/
|
|
|
|
virtual void setText(const QString &text);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Whether this text field is a password input, eg its text @b must be
|
|
|
|
* replaced with asterisks.
|
|
|
|
*
|
|
|
|
* Always false for @ref FileSelect text fields.
|
|
|
|
*/
|
|
|
|
virtual bool isPassword() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Whether this text field should allow rich text.
|
|
|
|
*/
|
|
|
|
virtual bool isRichText() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The maximum length allowed for the text of text field, or -1 if
|
|
|
|
* there is no limitation for the text.
|
|
|
|
*/
|
|
|
|
virtual int maximumLength() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The alignment of the text within the field.
|
|
|
|
*/
|
|
|
|
virtual Qt::Alignment textAlignment() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Whether the text inserted manually in the field (where possible)
|
|
|
|
* can be spell-checked.
|
|
|
|
*
|
|
|
|
* @note meaningful only if the field is editable.
|
|
|
|
*/
|
|
|
|
virtual bool canBeSpellChecked() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-08-10 21:02:55 +00:00
|
|
|
/**
|
|
|
|
* Set the text which should be rendered by the PDF.
|
|
|
|
*
|
|
|
|
* @since 1.9
|
|
|
|
*/
|
|
|
|
virtual void setAppearanceText(const QString &text) = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
protected:
|
|
|
|
FormFieldText();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-07-03 17:20:38 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(FormFieldText)
|
|
|
|
Q_DISABLE_COPY(FormFieldText)
|
2007-02-25 00:07:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @short Interface of a choice form field.
|
|
|
|
*
|
|
|
|
* This is the base interface to reimplement to represent a choice field, ie a
|
|
|
|
* field where the user can select one (of more) element(s) among a set of
|
|
|
|
* choices.
|
|
|
|
*/
|
2014-10-27 21:35:06 +00:00
|
|
|
class OKULARCORE_EXPORT FormFieldChoice : public FormField
|
2007-02-25 00:07:59 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* The types of choice field.
|
|
|
|
*/
|
|
|
|
enum ChoiceType {
|
|
|
|
ComboBox, ///< A combo box choice field.
|
|
|
|
ListBox ///< A list box choice field.
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-12-18 11:51:13 +00:00
|
|
|
~FormFieldChoice() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The particular type of the choice field.
|
|
|
|
*/
|
|
|
|
virtual ChoiceType choiceType() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The possible choices of the choice field.
|
|
|
|
*/
|
|
|
|
virtual QStringList choices() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Whether this ComboBox is editable, ie the user can type in a custom
|
|
|
|
* value.
|
|
|
|
*
|
|
|
|
* Always false for the other types of choices.
|
|
|
|
*/
|
|
|
|
virtual bool isEditable() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Whether more than one choice of this ListBox can be selected at the
|
|
|
|
* same time.
|
|
|
|
*
|
|
|
|
* Always false for the other types of choices.
|
|
|
|
*/
|
|
|
|
virtual bool multiSelect() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The currently selected choices.
|
|
|
|
*
|
|
|
|
* Always one element in the list in case of single choice elements.
|
|
|
|
*/
|
|
|
|
virtual QList<int> currentChoices() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Sets the selected choices to @p choices .
|
|
|
|
*/
|
|
|
|
virtual void setCurrentChoices(const QList<int> &choices);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-10-31 23:54:14 +00:00
|
|
|
/**
|
|
|
|
The text entered into an editable combo box choice field
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-10-31 23:54:14 +00:00
|
|
|
@since 0.16 (KDE 4.10)
|
|
|
|
*/
|
|
|
|
virtual QString editChoice() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-10-31 23:54:14 +00:00
|
|
|
/**
|
|
|
|
Sets the text entered into an editable combo box choice field
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2012-10-31 23:54:14 +00:00
|
|
|
@since 0.16 (KDE 4.10)
|
|
|
|
*/
|
|
|
|
virtual void setEditChoice(const QString &text);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* The alignment of the text within the field.
|
|
|
|
*/
|
|
|
|
virtual Qt::Alignment textAlignment() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
/**
|
|
|
|
* Whether the text inserted manually in the field (where possible)
|
|
|
|
* can be spell-checked.
|
|
|
|
*
|
|
|
|
* @note meaningful only if the field is editable.
|
|
|
|
*/
|
|
|
|
virtual bool canBeSpellChecked() const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2020-03-21 21:39:45 +00:00
|
|
|
/**
|
|
|
|
* Returns the export value for a given choice
|
|
|
|
*
|
|
|
|
* @since 1.11
|
|
|
|
*/
|
|
|
|
QString exportValueForChoice(const QString &choice) const;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
protected:
|
|
|
|
FormFieldChoice();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2020-03-21 21:39:45 +00:00
|
|
|
/**
|
|
|
|
* The possible choices of the choice field.
|
2020-04-04 09:17:50 +00:00
|
|
|
* The key is the display name of the choice,
|
2020-03-21 21:39:45 +00:00
|
|
|
* The value is the export value (i.e. for use in javascript, etc) of the choice
|
|
|
|
*
|
|
|
|
* @since 1.11
|
|
|
|
*/
|
|
|
|
void setExportValues(const QMap<QString, QString> &values);
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2007-07-03 17:20:38 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(FormFieldChoice)
|
|
|
|
Q_DISABLE_COPY(FormFieldChoice)
|
2007-02-25 00:07:59 +00:00
|
|
|
};
|
|
|
|
|
2019-01-05 22:30:25 +00:00
|
|
|
/**
|
|
|
|
* @short Interface of a signature form field.
|
|
|
|
*
|
|
|
|
* This is the base interface to reimplement to represent a signature field.
|
|
|
|
*/
|
|
|
|
class OKULARCORE_EXPORT FormFieldSignature : public FormField
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/**
|
|
|
|
* The types of signature.
|
|
|
|
*/
|
2022-01-03 14:49:10 +00:00
|
|
|
enum SignatureType {
|
|
|
|
AdbePkcs7sha1,
|
|
|
|
AdbePkcs7detached,
|
|
|
|
EtsiCAdESdetached,
|
|
|
|
UnknownType,
|
|
|
|
UnsignedSignature ///< The signature field has not been signed yet. @since 22.04
|
|
|
|
};
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-12-18 11:51:13 +00:00
|
|
|
~FormFieldSignature() override;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-01-05 22:30:25 +00:00
|
|
|
/**
|
|
|
|
* The signature type
|
|
|
|
*/
|
|
|
|
virtual SignatureType signatureType() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-01-05 22:30:25 +00:00
|
|
|
/**
|
|
|
|
* The signature info
|
2023-04-21 10:50:46 +00:00
|
|
|
* @since 23.08
|
2019-01-05 22:30:25 +00:00
|
|
|
*/
|
2023-04-21 10:50:46 +00:00
|
|
|
virtual SignatureInfo signatureInfo() const = 0;
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2022-01-03 14:49:10 +00:00
|
|
|
/**
|
|
|
|
Signs a field of UnsignedSignature type.
|
|
|
|
|
|
|
|
@since 22.04
|
|
|
|
*/
|
|
|
|
virtual bool sign(const NewSignatureData &data, const QString &newPath) const = 0;
|
|
|
|
|
2019-01-05 22:30:25 +00:00
|
|
|
protected:
|
|
|
|
FormFieldSignature();
|
2020-07-10 22:15:05 +00:00
|
|
|
|
2019-01-05 22:30:25 +00:00
|
|
|
private:
|
|
|
|
Q_DECLARE_PRIVATE(FormFieldSignature)
|
|
|
|
Q_DISABLE_COPY(FormFieldSignature)
|
|
|
|
};
|
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
}
|
|
|
|
|
2019-01-05 22:30:25 +00:00
|
|
|
Q_DECLARE_METATYPE(const Okular::FormFieldSignature *);
|
|
|
|
|
2007-02-25 00:07:59 +00:00
|
|
|
#endif
|