Okular::FormFieldChoice

Search for usage in LXR

Okular::FormFieldChoice Class Referenceabstract

#include <form.h>

Inheritance diagram for Okular::FormFieldChoice:

Public Types

enum  ChoiceType { ComboBox , ListBox }
 
- Public Types inherited from Okular::FormField
enum  AdditionalActionType { FieldModified , FormatField , ValidateField , CalculateField }
 
enum  FieldType { FormButton , FormText , FormChoice , FormSignature }
 

Public Member Functions

virtual bool canBeSpellChecked () const
 
virtual QStringList choices () const =0
 
virtual ChoiceType choiceType () const =0
 
virtual QList< int > currentChoices () const =0
 
virtual QString editChoice () const
 
QString exportValueForChoice (const QString &choice) const
 
virtual bool isEditable () const
 
virtual bool multiSelect () const
 
virtual void setAppearanceChoiceText (const QString &text)=0
 
void setAppearanceValue (const QVariant &value) override
 
virtual void setCurrentChoices (const QList< int > &choices)
 
virtual void setEditChoice (const QString &text)
 
void setValue (const QVariant &value) override
 
virtual Qt::Alignment textAlignment () const
 
QVariant value () const override
 
- Public Member Functions inherited from Okular::FormField
ActionactivationAction () const
 
ActionadditionalAction (AdditionalActionType type) const
 
ActionadditionalAction (Annotation::AdditionalActionType type) const
 
QList< Action * > additionalActions () const
 
void commitFormattedValue (const QString &value)
 
QString committedFormattedValue () const
 
QString committedValue () const
 
void commitValue (const QString &value)
 
virtual QString fullyQualifiedName () const =0
 
virtual int id () const =0
 
virtual bool isPrintable () const
 
virtual bool isReadOnly () const
 
virtual bool isVisible () const
 
virtual QString name () const =0
 
Pagepage () const
 
virtual NormalizedRect rect () const =0
 
virtual void setPrintable (bool value)
 
virtual void setReadOnly (bool value)
 
virtual void setVisible (bool value)
 
FieldType type () const
 
virtual QString uiName () const =0
 

Protected Member Functions

void setExportValues (const QMap< QString, QString > &values)
 
- Protected Member Functions inherited from Okular::FormField
void setActivationAction (Action *action)
 
void setAdditionalAction (AdditionalActionType type, Action *action)
 
void setAdditionalAction (Annotation::AdditionalActionType type, Action *action)
 

Detailed Description

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.

Definition at line 420 of file form.h.

Member Enumeration Documentation

◆ ChoiceType

The types of choice field.

Enumerator
ComboBox 

A combo box choice field.

ListBox 

A list box choice field.

Definition at line 426 of file form.h.

Constructor & Destructor Documentation

◆ ~FormFieldChoice()

FormFieldChoice::~FormFieldChoice ( )
override

Definition at line 332 of file form.cpp.

◆ FormFieldChoice()

FormFieldChoice::FormFieldChoice ( )
protected

Definition at line 327 of file form.cpp.

Member Function Documentation

◆ canBeSpellChecked()

bool FormFieldChoice::canBeSpellChecked ( ) const
virtual

Whether the text inserted manually in the field (where possible) can be spell-checked.

Note
meaningful only if the field is editable.

Definition at line 364 of file form.cpp.

◆ choices()

virtual QStringList Okular::FormFieldChoice::choices ( ) const
pure virtual

The possible choices of the choice field.

◆ choiceType()

virtual ChoiceType Okular::FormFieldChoice::choiceType ( ) const
pure virtual

The particular type of the choice field.

◆ currentChoices()

virtual QList< int > Okular::FormFieldChoice::currentChoices ( ) const
pure virtual

The currently selected choices.

Always one element in the list in case of single choice elements.

◆ editChoice()

QString FormFieldChoice::editChoice ( ) const
virtual

The text entered into an editable combo box choice field.

Since
0.16 (KDE 4.10)

Definition at line 350 of file form.cpp.

◆ exportValueForChoice()

QString FormFieldChoice::exportValueForChoice ( const QString & choice) const

Returns the export value for a given choice.

Since
1.11

Definition at line 375 of file form.cpp.

◆ isEditable()

bool FormFieldChoice::isEditable ( ) const
virtual

Whether this ComboBox is editable, ie the user can type in a custom value.

Always false for the other types of choices.

Definition at line 336 of file form.cpp.

◆ multiSelect()

bool FormFieldChoice::multiSelect ( ) const
virtual

Whether more than one choice of this ListBox can be selected at the same time.

Always false for the other types of choices.

Definition at line 341 of file form.cpp.

◆ setAppearanceChoiceText()

virtual void Okular::FormFieldChoice::setAppearanceChoiceText ( const QString & text)
pure virtual

Sets the text which should be rendered by the PDF in the position of choice FormField.

Since
24.12

◆ setAppearanceValue()

void FormFieldChoice::setAppearanceValue ( const QVariant & value)
overridevirtual

Sets the appearance value associated with the form field.

Since
24.12

Reimplemented from Okular::FormField.

Definition at line 413 of file form.cpp.

◆ setCurrentChoices()

void FormFieldChoice::setCurrentChoices ( const QList< int > & choices)
virtual

Sets the selected choices to choices .

Definition at line 346 of file form.cpp.

◆ setEditChoice()

void FormFieldChoice::setEditChoice ( const QString & text)
virtual

Sets the text entered into an editable combo box choice field.

Since
0.16 (KDE 4.10)

Definition at line 355 of file form.cpp.

◆ setExportValues()

void FormFieldChoice::setExportValues ( const QMap< QString, QString > & values)
protected

The possible choices of the choice field.

The key is the display name of the choice, The value is the export value (i.e. for use in javascript, etc) of the choice

Since
1.11

Definition at line 369 of file form.cpp.

◆ setValue()

void FormFieldChoice::setValue ( const QVariant & value)
overridevirtual

Sets the value asssociated with the choice form field.

It does not set anything for ListBox for now, only for the ComboBox.

Expected type of value is QString.

Since
24.12

Reimplemented from Okular::FormField.

Definition at line 381 of file form.cpp.

◆ textAlignment()

Qt::Alignment FormFieldChoice::textAlignment ( ) const
virtual

The alignment of the text within the field.

Definition at line 359 of file form.cpp.

◆ value()

QVariant FormFieldChoice::value ( ) const
overridevirtual

Returns the value associated with the choice form field.

In case of ComboBox, if there is any selection, then the selected value is returned, else the value entered in editText of the comboBox. Returns empty string for ListBox for now.

Since
24.12

Reimplemented from Okular::FormField.

Definition at line 400 of file form.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:47:55 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.