Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
CPDF_FormField Class Reference

#include <cpdf_formfield.h>

+ Collaboration diagram for CPDF_FormField:

Public Types

enum  Type {
  kUnknown , kPushButton , kRadioButton , kCheckBox ,
  kText , kRichText , kFile , kListBox ,
  kComboBox , kSign
}
 

Public Member Functions

 CPDF_FormField (CPDF_InteractiveForm *pForm, RetainPtr< CPDF_Dictionary > pDict)
 
 ~CPDF_FormField ()
 
WideString GetFullName () const
 
Type GetType () const
 
RetainPtr< const CPDF_ObjectGetFieldAttr (const ByteString &name) const
 
RetainPtr< const CPDF_DictionaryGetFieldDict () const
 
bool ResetField ()
 
int CountControls () const
 
CPDF_FormControlGetControl (int index) const
 
int GetControlIndex (const CPDF_FormControl *pControl) const
 
FormFieldType GetFieldType () const
 
CPDF_AAction GetAdditionalAction () const
 
WideString GetAlternateName () const
 
WideString GetMappingName () const
 
uint32_t GetFieldFlags () const
 
void SetFieldFlags (uint32_t dwFlags)
 
bool IsRequired () const
 
bool IsNoExport () const
 
WideString GetValue () const
 
WideString GetDefaultValue () const
 
bool SetValue (const WideString &value, NotificationOption notify)
 
int GetMaxLen () const
 
int CountSelectedItems () const
 
int GetSelectedIndex (int index) const
 
bool ClearSelection (NotificationOption notify)
 
bool IsItemSelected (int index) const
 
bool SetItemSelection (int index, NotificationOption notify)
 
int GetDefaultSelectedItem () const
 
int CountOptions () const
 
WideString GetOptionLabel (int index) const
 
WideString GetOptionValue (int index) const
 
int FindOption (const WideString &csOptValue) const
 
bool CheckControl (int iControlIndex, bool bChecked, NotificationOption notify)
 
int GetTopVisibleIndex () const
 
int CountSelectedOptions () const
 
int GetSelectedOptionIndex (int index) const
 
bool IsSelectedOption (const WideString &wsOptValue) const
 
bool IsSelectedIndex (int iOptIndex) const
 
void SelectOption (int iOptIndex)
 
bool UseSelectedIndicesObject () const
 
WideString GetCheckValue (bool bDefault) const
 

Static Public Member Functions

static absl::optional< FormFieldTypeIntToFormFieldType (int value)
 
static WideString GetFullNameForDict (const CPDF_Dictionary *pFieldDict)
 
static RetainPtr< const CPDF_ObjectGetFieldAttrForDict (const CPDF_Dictionary *pFieldDict, const ByteString &name)
 
static RetainPtr< CPDF_ObjectGetMutableFieldAttrForDict (CPDF_Dictionary *pFieldDict, const ByteString &name)
 

Detailed Description

Definition at line 57 of file cpdf_formfield.h.

Member Enumeration Documentation

◆ Type

Enumerator
kUnknown 
kPushButton 
kRadioButton 
kCheckBox 
kText 
kRichText 
kFile 
kListBox 
kComboBox 
kSign 

Definition at line 59 of file cpdf_formfield.h.

Constructor & Destructor Documentation

◆ CPDF_FormField()

CPDF_FormField::CPDF_FormField ( CPDF_InteractiveForm * pForm,
RetainPtr< CPDF_Dictionary > pDict )

Definition at line 123 of file cpdf_formfield.cpp.

References CPDF_FormField().

Referenced by CPDF_FormField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~CPDF_FormField()

CPDF_FormField::~CPDF_FormField ( )
default

Member Function Documentation

◆ CheckControl()

bool CPDF_FormField::CheckControl ( int iControlIndex,
bool bChecked,
NotificationOption notify )

Definition at line 638 of file cpdf_formfield.cpp.

References CPDF_FormControl::CheckControl(), CountControls(), GetControl(), CPDF_FormControl::GetExportValue(), CPDF_FormControl::GetOnStateName(), CPDF_Object::GetString(), CPDF_FormControl::IsChecked(), fxcrt::ByteString::operator=(), fxcrt::ByteString::operator==(), and fxcrt::WideString::operator==().

Referenced by ResetField(), and CPDFSDK_Widget::SetCheck().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ClearSelection()

bool CPDF_FormField::ClearSelection ( NotificationOption notify)

Definition at line 507 of file cpdf_formfield.cpp.

References GetOptionLabel(), GetSelectedIndex(), kNotify, and fxcrt::WideString::operator=().

Referenced by CPDFSDK_Widget::ClearSelection(), and ResetField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CountControls()

int CPDF_FormField::CountControls ( ) const

Definition at line 260 of file cpdf_formfield.cpp.

Referenced by CJS_PublicMethods::AFSimple_Calculate(), CheckControl(), FPDFAnnot_GetFormControlCount(), GetCheckValue(), CPDFSDK_InteractiveForm::GetWidgets(), ResetField(), CPDFSDK_InteractiveForm::ResetFieldAppearance(), and CPDFSDK_InteractiveForm::UpdateField().

+ Here is the caller graph for this function:

◆ CountOptions()

int CPDF_FormField::CountOptions ( ) const

Definition at line 595 of file cpdf_formfield.cpp.

References GetType().

Referenced by CPDFSDK_Widget::CountOptions(), FindOption(), FPDFAnnot_GetOptionCount(), FPDFAnnot_GetOptionLabel(), FPDFAnnot_IsOptionSelected(), GetDefaultSelectedItem(), GetSelectedIndex(), IsItemSelected(), CPDFSDK_AppStream::SetAsListBox(), SetItemSelection(), and UseSelectedIndicesObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CountSelectedItems()

int CPDF_FormField::CountSelectedItems ( ) const

Definition at line 461 of file cpdf_formfield.cpp.

References CPDF_Object::AsArray(), CPDF_Object::GetString(), fxcrt::ByteString::IsEmpty(), CPDF_Object::IsNumber(), and CPDF_Object::IsString().

Referenced by CJS_PublicMethods::AFSimple_Calculate(), CPDFSDK_InteractiveForm::OnFormat(), and CPDFSDK_AppStream::SetAsListBox().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CountSelectedOptions()

int CPDF_FormField::CountSelectedOptions ( ) const

Definition at line 734 of file cpdf_formfield.cpp.

Referenced by GetSelectedIndex().

+ Here is the caller graph for this function:

◆ FindOption()

int CPDF_FormField::FindOption ( const WideString & csOptValue) const

Definition at line 630 of file cpdf_formfield.cpp.

References CountOptions(), GetOptionValue(), and fxcrt::WideString::operator==().

+ Here is the call graph for this function:

◆ GetAdditionalAction()

CPDF_AAction CPDF_FormField::GetAdditionalAction ( ) const

Definition at line 303 of file cpdf_formfield.cpp.

Referenced by FPDFAnnot_GetFormAdditionalActionJavaScript(), CPDFSDK_Widget::GetAAction(), CPDFSDK_InteractiveForm::OnCalculate(), CPDFSDK_InteractiveForm::OnFormat(), CPDFSDK_InteractiveForm::OnKeyStrokeCommit(), and CPDFSDK_InteractiveForm::OnValidate().

+ Here is the caller graph for this function:

◆ GetAlternateName()

WideString CPDF_FormField::GetAlternateName ( ) const

Definition at line 309 of file cpdf_formfield.cpp.

References fxcrt::WideString::WideString().

Referenced by FPDFAnnot_GetFormFieldAlternateName().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCheckValue()

WideString CPDF_FormField::GetCheckValue ( bool bDefault) const

Definition at line 692 of file cpdf_formfield.cpp.

References CountControls(), GetControl(), CPDF_FormControl::GetExportValue(), CPDF_FormControl::IsChecked(), CPDF_FormControl::IsDefaultChecked(), and fxcrt::WideString::operator=().

Referenced by CPDF_InteractiveForm::ExportToFDF().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetControl()

CPDF_FormControl * CPDF_FormField::GetControl ( int index) const

Definition at line 264 of file cpdf_formfield.cpp.

Referenced by CJS_PublicMethods::AFSimple_Calculate(), CheckControl(), GetCheckValue(), CPDFSDK_InteractiveForm::GetWidgets(), ResetField(), CPDFSDK_InteractiveForm::ResetFieldAppearance(), and CPDFSDK_InteractiveForm::UpdateField().

+ Here is the caller graph for this function:

◆ GetControlIndex()

int CPDF_FormField::GetControlIndex ( const CPDF_FormControl * pControl) const

Definition at line 268 of file cpdf_formfield.cpp.

Referenced by FPDFAnnot_GetFormControlIndex(), and CPDFSDK_Widget::SetCheck().

+ Here is the caller graph for this function:

◆ GetDefaultSelectedItem()

int CPDF_FormField::GetDefaultSelectedItem ( ) const

Definition at line 580 of file cpdf_formfield.cpp.

References CountOptions(), GetOptionValue(), GetType(), fxcrt::WideString::IsEmpty(), and fxcrt::WideString::operator==().

Referenced by ResetField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetDefaultValue()

WideString CPDF_FormField::GetDefaultValue ( ) const

Definition at line 366 of file cpdf_formfield.cpp.

◆ GetFieldAttr()

RetainPtr< const CPDF_Object > CPDF_FormField::GetFieldAttr ( const ByteString & name) const

Definition at line 173 of file cpdf_formfield.cpp.

◆ GetFieldAttrForDict()

RetainPtr< const CPDF_Object > CPDF_FormField::GetFieldAttrForDict ( const CPDF_Dictionary * pFieldDict,
const ByteString & name )
static

Definition at line 87 of file cpdf_formfield.cpp.

◆ GetFieldDict()

RetainPtr< const CPDF_Dictionary > CPDF_FormField::GetFieldDict ( ) const

Definition at line 178 of file cpdf_formfield.cpp.

Referenced by CPDF_InteractiveForm::ExportToFDF().

+ Here is the caller graph for this function:

◆ GetFieldFlags()

uint32_t CPDF_FormField::GetFieldFlags ( ) const

Definition at line 321 of file cpdf_formfield.cpp.

Referenced by CPDF_InteractiveForm::ExportToFDF(), FPDFAnnot_GetFormFieldFlags(), and CPDFSDK_Widget::GetFieldFlags().

+ Here is the caller graph for this function:

◆ GetFieldType()

◆ GetFullName()

WideString CPDF_FormField::GetFullName ( ) const

Definition at line 169 of file cpdf_formfield.cpp.

Referenced by FPDFAnnot_GetFormFieldName().

+ Here is the caller graph for this function:

◆ GetFullNameForDict()

WideString CPDF_FormField::GetFullNameForDict ( const CPDF_Dictionary * pFieldDict)
static

Definition at line 102 of file cpdf_formfield.cpp.

References CPDF_Dictionary::GetDictFor(), CPDF_Dictionary::GetUnicodeTextFor(), fxcrt::WideString::IsEmpty(), pdfium::form_fields::kParent, pdfium::form_fields::kT, fxcrt::operator+(), fxcrt::operator+(), and fxcrt::WideString::operator=().

Referenced by CPDF_InteractiveForm::ExportToFDF(), CPDF_InteractiveForm::GetFieldByDict(), and TEST().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMappingName()

WideString CPDF_FormField::GetMappingName ( ) const

Definition at line 315 of file cpdf_formfield.cpp.

References fxcrt::WideString::WideString().

+ Here is the call graph for this function:

◆ GetMaxLen()

int CPDF_FormField::GetMaxLen ( ) const

Definition at line 445 of file cpdf_formfield.cpp.

Referenced by CPDFSDK_Widget::GetMaxLen().

+ Here is the caller graph for this function:

◆ GetMutableFieldAttrForDict()

RetainPtr< CPDF_Object > CPDF_FormField::GetMutableFieldAttrForDict ( CPDF_Dictionary * pFieldDict,
const ByteString & name )
static

Definition at line 94 of file cpdf_formfield.cpp.

◆ GetOptionLabel()

WideString CPDF_FormField::GetOptionLabel ( int index) const

Definition at line 622 of file cpdf_formfield.cpp.

Referenced by ClearSelection(), FPDFAnnot_GetOptionLabel(), CPDFSDK_Widget::GetOptionLabel(), CPDFSDK_Widget::GetSelectExportText(), CPDFSDK_InteractiveForm::OnFormat(), ResetField(), and CPDFSDK_AppStream::SetAsListBox().

+ Here is the caller graph for this function:

◆ GetOptionValue()

WideString CPDF_FormField::GetOptionValue ( int index) const

Definition at line 626 of file cpdf_formfield.cpp.

Referenced by FindOption(), GetDefaultSelectedItem(), GetSelectedIndex(), CPDFSDK_Widget::GetSelectExportText(), IsItemSelected(), SetItemSelection(), and UseSelectedIndicesObject().

+ Here is the caller graph for this function:

◆ GetSelectedIndex()

int CPDF_FormField::GetSelectedIndex ( int index) const

Definition at line 472 of file cpdf_formfield.cpp.

References fxcrt::WideString::WideString(), CPDF_Object::AsArray(), CountOptions(), CountSelectedOptions(), CPDF_Object::GetInteger(), GetOptionValue(), GetSelectedOptionIndex(), CPDF_Object::GetUnicodeText(), CPDF_Object::IsNumber(), CPDF_Object::IsString(), fxcrt::WideString::operator=(), and fxcrt::WideString::operator==().

Referenced by ClearSelection(), CPDFSDK_Widget::GetSelectedIndex(), CPDFSDK_InteractiveForm::OnFormat(), and CPDFSDK_AppStream::SetAsListBox().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSelectedOptionIndex()

int CPDF_FormField::GetSelectedOptionIndex ( int index) const

Definition at line 739 of file cpdf_formfield.cpp.

Referenced by GetSelectedIndex().

+ Here is the caller graph for this function:

◆ GetTopVisibleIndex()

int CPDF_FormField::GetTopVisibleIndex ( ) const

Definition at line 729 of file cpdf_formfield.cpp.

Referenced by CPDFSDK_Widget::GetTopVisibleIndex(), and CPDFSDK_AppStream::SetAsListBox().

+ Here is the caller graph for this function:

◆ GetType()

Type CPDF_FormField::GetType ( ) const
inline

Definition at line 85 of file cpdf_formfield.h.

Referenced by CPDF_InteractiveForm::CheckRequiredFields(), CountOptions(), CPDF_InteractiveForm::ExportToFDF(), GetDefaultSelectedItem(), IsItemSelected(), SetItemSelection(), and UseSelectedIndicesObject().

+ Here is the caller graph for this function:

◆ GetValue()

WideString CPDF_FormField::GetValue ( ) const

Definition at line 362 of file cpdf_formfield.cpp.

Referenced by CJS_PublicMethods::AFSimple_Calculate(), FPDFAnnot_GetFormFieldValue(), CPDFSDK_Widget::GetValue(), CPDFSDK_InteractiveForm::OnCalculate(), and CPDFSDK_InteractiveForm::OnFormat().

+ Here is the caller graph for this function:

◆ IntToFormFieldType()

absl::optional< FormFieldType > CPDF_FormField::IntToFormFieldType ( int value)
static

Definition at line 78 of file cpdf_formfield.cpp.

References kUnknown.

◆ IsItemSelected()

bool CPDF_FormField::IsItemSelected ( int index) const

Definition at line 523 of file cpdf_formfield.cpp.

References CountOptions(), GetOptionValue(), GetType(), IsSelectedIndex(), and IsSelectedOption().

Referenced by FPDFAnnot_IsOptionSelected(), and CPDFSDK_Widget::IsOptionSelected().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsNoExport()

bool CPDF_FormField::IsNoExport ( ) const
inline

Definition at line 105 of file cpdf_formfield.h.

Referenced by CPDF_InteractiveForm::CheckRequiredFields().

+ Here is the caller graph for this function:

◆ IsRequired()

bool CPDF_FormField::IsRequired ( ) const
inline

Definition at line 104 of file cpdf_formfield.h.

Referenced by CPDF_InteractiveForm::CheckRequiredFields().

+ Here is the caller graph for this function:

◆ IsSelectedIndex()

bool CPDF_FormField::IsSelectedIndex ( int iOptIndex) const

Definition at line 770 of file cpdf_formfield.cpp.

References CPDF_ArrayLocker::CPDF_ArrayLocker().

Referenced by IsItemSelected().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsSelectedOption()

bool CPDF_FormField::IsSelectedOption ( const WideString & wsOptValue) const

Definition at line 752 of file cpdf_formfield.cpp.

References CPDF_ArrayLocker::CPDF_ArrayLocker().

Referenced by IsItemSelected().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResetField()

bool CPDF_FormField::ResetField ( )

Definition at line 182 of file cpdf_formfield.cpp.

References CheckControl(), ClearSelection(), CountControls(), GetControl(), GetDefaultSelectedItem(), GetOptionLabel(), CPDF_FormControl::IsDefaultChecked(), kCheckBox, kComboBox, kDoNotNotify, kFile, kListBox, kRadioButton, kRichText, pdfium::form_fields::kRV, kText, fxcrt::WideString::operator=(), fxcrt::WideString::operator==(), and SetItemSelection().

Referenced by CPDF_InteractiveForm::ResetForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SelectOption()

void CPDF_FormField::SelectOption ( int iOptIndex)

Definition at line 789 of file cpdf_formfield.cpp.

◆ SetFieldFlags()

void CPDF_FormField::SetFieldFlags ( uint32_t dwFlags)

Definition at line 327 of file cpdf_formfield.cpp.

◆ SetItemSelection()

bool CPDF_FormField::SetItemSelection ( int index,
NotificationOption notify )

Definition at line 533 of file cpdf_formfield.cpp.

References CountOptions(), GetOptionValue(), GetType(), kNotify, and UseSelectedIndicesObject().

Referenced by ResetField(), and CPDFSDK_Widget::SetOptionSelection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetValue()

bool CPDF_FormField::SetValue ( const WideString & value,
NotificationOption notify )

Definition at line 440 of file cpdf_formfield.cpp.

Referenced by CPDFSDK_InteractiveForm::OnCalculate(), and CPDFSDK_Widget::SetValue().

+ Here is the caller graph for this function:

◆ UseSelectedIndicesObject()

bool CPDF_FormField::UseSelectedIndicesObject ( ) const

Definition at line 804 of file cpdf_formfield.cpp.

References CPDF_ArrayLocker::CPDF_ArrayLocker(), CountOptions(), GetOptionValue(), and GetType().

Referenced by SetItemSelection().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: