35#ifndef _POPPLER_QT5_FORM_H_
36#define _POPPLER_QT5_FORM_H_
42#include <QtCore/QDateTime>
43#include <QtCore/QVector>
44#include <QtCore/QList>
45#include <QtCore/QRectF>
46#include <QtCore/QStringList>
47#include <QtCore/QSharedPointer>
48#include "poppler-export.h"
49#include "poppler-annotation.h"
50#include "poppler-qt5.h"
55class FormWidgetButton;
57class FormWidgetChoice;
58class FormWidgetSignature;
66class FormFieldIconData;
74class POPPLER_QT5_EXPORT FormFieldIcon
77 friend class FormFieldIconData;
80 explicit FormFieldIcon(FormFieldIconData *data);
81 FormFieldIcon(
const FormFieldIcon &ffIcon);
84 FormFieldIcon &operator=(
const FormFieldIcon &ffIcon);
87 FormFieldIconData *d_ptr;
97 friend class FormFieldData;
221 explicit FormField(std::unique_ptr<FormFieldData> dd);
223 std::unique_ptr<FormFieldData> m_formData;
505class CertificateInfoPrivate;
506class POPPLER_QT5_EXPORT CertificateInfo
525 KuDigitalSignature = 0x80,
526 KuNonRepudiation = 0x40,
527 KuKeyEncipherment = 0x20,
528 KuDataEncipherment = 0x10,
529 KuKeyAgreement = 0x08,
530 KuKeyCertSign = 0x04,
532 KuEncipherOnly = 0x01,
535 Q_DECLARE_FLAGS(KeyUsageExtensions, KeyUsageExtension)
679 CertificateInfo(
const CertificateInfo &other);
680 CertificateInfo &operator=(
const CertificateInfo &other);
683 Q_DECLARE_PRIVATE(CertificateInfo)
685 QSharedPointer<CertificateInfoPrivate> d_ptr;
687Q_DECLARE_OPERATORS_FOR_FLAGS(CertificateInfo::KeyUsageExtensions)
694class SignatureValidationInfoPrivate;
695class POPPLER_QT5_EXPORT SignatureValidationInfo
733 HashAlgorithmUnknown,
817 SignatureValidationInfo(
const SignatureValidationInfo &other);
818 SignatureValidationInfo &operator=(
const SignatureValidationInfo &other);
821 Q_DECLARE_PRIVATE(SignatureValidationInfo)
822 friend class FormFieldSignature;
823 QSharedPointer<SignatureValidationInfoPrivate> d_ptr;
831class AsyncObjectPrivate;
832class POPPLER_QT5_EXPORT AsyncObject :
public QObject
840 ~AsyncObject()
override;
845 std::unique_ptr<AsyncObjectPrivate> d;
AdditionalActionType
Describes the flags from an annotations 'AA' dictionary.
Definition poppler-annotation.h:482
Definition poppler-form.h:507
POPPLER_QT5_DEPRECATED QByteArray publicKey() const
The raw public key value, though it might also be empty depending on the signature types involved.
PublicKeyType publicKeyType() const
The public key type.
bool isSelfSigned() const
Returns true if certificate is self-signed otherwise returns false.
QByteArray certificateData() const
The DER encoded certificate.
QString issuerInfo(EntityInfoKey key) const
Information about the issuer.
CertificateType certificateType() const
QString subjectInfo(EntityInfoKey key) const
Information about the subject.
CertificateType
The type of the certificate.
Definition poppler-form.h:543
KeyLocation keyLocation() const
The storage location for this key.
bool checkPassword(const QString &password) const
Checks if the given password is the correct one for this certificate.
int version() const
The certificate version string.
int publicKeyStrength() const
The strength of public key in bits.
bool isNull() const
Returns true if certificate has no contents; otherwise returns false.
QDateTime validityEnd() const
The date-time when certificate expires.
QByteArray serialNumber() const
The certificate serial number.
KeyUsageExtension
Certificate key usage extensions.
Definition poppler-form.h:524
PublicKeyType
The algorithm of public key.
Definition poppler-form.h:513
KeyUsageExtensions keyUsageExtensions() const
The uses allowed for the certificate.
QDateTime validityStart() const
The date-time when certificate becomes valid.
EntityInfoKey
Predefined keys for elements in an entity's distinguished name.
Definition poppler-form.h:552
KeyLocation
A signing key can be located in different places sometimes.
Definition poppler-form.h:570
QString nickName() const
The certificate internal database nickname.
A form field that represents a text input.
Definition poppler-form.h:308
void setAppearanceText(const QString &text)
Sets the text inside the Appearance Stream to the specified text.
TextType
The particular type of this text field.
Definition poppler-form.h:314
@ Multiline
A multiline text field.
Definition poppler-form.h:316
@ Normal
A simple singleline text field.
Definition poppler-form.h:315
@ FileSelect
An input field to select the path of a file on disk.
Definition poppler-form.h:317
void setText(const QString &text)
Sets the text associated with the text field to the specified text.
QString text() const
The text associated with the text field.
double getFontSize() const
The font size of the text in the form field.
void setFontSize(int fontSize)
Set the font size of the text in the form field (currently only as integer).
bool canBeSpellChecked() const
Whether the text inserted manually in the field (where possible) can be spell-checked.
bool isPassword() const
Whether this text field is a password input, eg its text must be replaced with asterisks.
TextType textType() const
The text type of the text field.
Qt::Alignment textAlignment() const
The horizontal alignment for the text of this text field.
FormType type() const override
The type of the field.
int maximumLength() const
The maximum length for the text of this field, or -1 if not set.
bool isRichText() const
Whether this text field should allow rich text.
Encapsulates data that describes a link.
Definition poppler-link.h:185
Holds data for a new signature.
Definition poppler-qt5.h:2271
A page in a document.
Definition poppler-qt5.h:463
Definition poppler-form.h:696
QString signerName() const
The signer name associated with the signature.
QList< qint64 > signedRangeBounds() const
Get the bounds of the ranges of the document which are signed.
QByteArray signature() const
Get the signature binary data.
HashAlgorithm hashAlgorithm() const
The hash algorithm used for the signature.
bool signsTotalDocument() const
Checks whether the signature authenticates the total document except for the signature itself.
CertificateInfo certificateInfo() const
The signer certificate info.
CertificateStatus
The verification result of the certificate.
Definition poppler-form.h:716
@ CertificateVerificationInProgress
The certificate is not yet verified but is in progress in the background. See validateAsync.
Definition poppler-form.h:724
@ CertificateUntrustedIssuer
The issuer of this certificate has been marked as untrusted by the user.
Definition poppler-form.h:718
@ CertificateUnknownIssuer
The certificate trust chain has not finished in a trusted root certificate.
Definition poppler-form.h:719
@ CertificateGenericError
The certificate could not be verified.
Definition poppler-form.h:722
@ CertificateRevoked
The certificate was revoked by the issuing certificate authority.
Definition poppler-form.h:720
@ CertificateTrusted
The certificate is considered trusted.
Definition poppler-form.h:717
@ CertificateNotVerified
The certificate is not yet verified.
Definition poppler-form.h:723
@ CertificateExpired
The signing time is outside the validity bounds of this certificate.
Definition poppler-form.h:721
HashAlgorithm
The hash algorithm of the signature.
Definition poppler-form.h:732
time_t signingTime() const
The signing time associated with the signature.
SignatureStatus
The verification result of the signature.
Definition poppler-form.h:702
@ SignatureNotVerified
The signature is not yet verified.
Definition poppler-form.h:709
@ SignatureDigestMismatch
The document content was changed after the signature was applied.
Definition poppler-form.h:705
@ SignatureGenericError
The signature could not be verified.
Definition poppler-form.h:707
@ SignatureDecodingError
The signature CMS/PKCS7 structure is malformed.
Definition poppler-form.h:706
@ SignatureValid
The signature is cryptographically valid.
Definition poppler-form.h:703
@ SignatureNotFound
The requested signature is not present in the document.
Definition poppler-form.h:708
@ SignatureInvalid
The signature is cryptographically invalid.
Definition poppler-form.h:704
SignatureStatus signatureStatus() const
The signature status of the signature.
QString signerSubjectDN() const
The signer subject distinguished name associated with the signature.
QString reason() const
Get signing reason.
CertificateStatus certificateStatus() const
The certificate status of the signature.
QString location() const
Get signing location.
The Poppler Qt5 binding.
Definition poppler-annotation.h:51
QVector< CertificateInfo > getAvailableSigningCertificates()
Return vector of suitable signing certificates.
bool hasCryptoSignBackendFeature(CryptoSignBackend backend, CryptoSignBackendFeature feature)
Queries if a backend supports or not supports a given feature.
bool arePgpSignaturesAllowed()
void setPgpSignaturesAllowed(bool allowed)
Allow pgp signatures in pdf files (standard-extension, experimental) Not supported for NSS backend.
QString getNSSDir()
Gets the current NSS CertDB directory.
std::optional< CryptoSignBackend > activeCryptoSignBackend()
Returns current active backend or nullopt if none is active.
void setNSSPasswordCallback(const std::function< char *(const char *)> &f)
Sets the callback for NSS password requests.
bool setActiveCryptoSignBackend(CryptoSignBackend backend)
Sets active backend.
bool POPPLER_QT5_DEPRECATED hasNSSSupport()
Returns is poppler was compiled with NSS support.
void setNSSDir(const QString &pathURL)
Set a custom NSS CertDB directory.
CryptoSignBackend
Possible compiled in backends for signature handling.
Definition poppler-form.h:996
CryptoSignBackendFeature
Definition poppler-form.h:1027
@ BackendAsksPassphrase
If the backend itself out of band requests passwords or if the host applicaion somehow must do it.
Definition poppler-form.h:1030
QVector< CryptoSignBackend > availableCryptoSignBackends()
The available compiled-in backends.
Combination of an error data and type of error string.
Definition poppler-qt5.h:136