PoDoFo 0.9.6
PoDoFo::PdfListField Class Reference

#include <PdfField.h>

Inheritance diagram for PoDoFo::PdfListField:
PoDoFo::PdfComboBox PoDoFo::PdfListBox

Public Member Functions

 PdfListField (const PdfField &rhs)
void InsertItem (const PdfString &rsValue, const PdfString &rsDisplayName=PdfString::StringNull)
void RemoveItem (int nIndex)
const PdfString GetItem (int nIndex) const
const PdfString GetItemDisplayText (int nIndex) const
size_t GetItemCount () const
void SetSelectedItem (int nIndex)
int GetSelectedItem () const
bool IsComboBox () const
void SetSpellcheckingEnabled (bool bSpellcheck)
bool IsSpellcheckingEnabled () const
void SetSorted (bool bSorted)
bool IsSorted () const
void SetMultiSelect (bool bMulti)
bool IsMultiSelect () const

Protected Member Functions

 PdfListField (EPdfField eField, PdfAnnotation *pWidget, PdfAcroForm *pParent)
 PdfListField (EPdfField eField, PdfPage *pPage, const PdfRect &rRect, PdfAcroForm *pParent)
 PdfListField (EPdfField eField, PdfPage *pPage, const PdfRect &rRect, PdfDocument *pDoc)
 PdfListField (EPdfField eField, PdfPage *pPage, const PdfRect &rRect, PdfStreamedDocument *pDoc)

Detailed Description

A list of items in a PDF file. You cannot create this object directly, use PdfComboBox or PdfListBox instead.

See also
PdfComboBox
PdfListBox

Constructor & Destructor Documentation

◆ PdfListField() [1/5]

PoDoFo::PdfListField::PdfListField ( EPdfField eField,
PdfAnnotation * pWidget,
PdfAcroForm * pParent )
protected

Create a new PdfTextField

◆ PdfListField() [2/5]

PoDoFo::PdfListField::PdfListField ( EPdfField eField,
PdfPage * pPage,
const PdfRect & rRect,
PdfAcroForm * pParent )
protected

Create a new PdfTextField

◆ PdfListField() [3/5]

PoDoFo::PdfListField::PdfListField ( EPdfField eField,
PdfPage * pPage,
const PdfRect & rRect,
PdfDocument * pDoc )
protected

Create a new PdfTextField

◆ PdfListField() [4/5]

PoDoFo::PdfListField::PdfListField ( EPdfField eField,
PdfPage * pPage,
const PdfRect & rRect,
PdfStreamedDocument * pDoc )
protected

Create a new PdfTextField

◆ PdfListField() [5/5]

PoDoFo::PdfListField::PdfListField ( const PdfField & rhs)

Create a PdfListField from a PdfField

Parameters
rhsa PdfField that is a list field

Internal usage only.

Member Function Documentation

◆ GetItem()

const PdfString PoDoFo::PdfListField::GetItem ( int nIndex) const
Parameters
nIndexindex of the item
Returns
the value of the item at the specified index

◆ GetItemCount()

size_t PoDoFo::PdfListField::GetItemCount ( ) const
Returns
the number of items in this list

◆ GetItemDisplayText()

const PdfString PoDoFo::PdfListField::GetItemDisplayText ( int nIndex) const
Parameters
nIndexindex of the item
Returns
the display text of the item or if it has no display text its value is returned. This call is equivalent to GetItem() in this case
See also
GetItem

◆ GetSelectedItem()

int PoDoFo::PdfListField::GetSelectedItem ( ) const

Sets the currently selected item

Returns
the selected item or -1 if no item was selected

◆ InsertItem()

void PoDoFo::PdfListField::InsertItem ( const PdfString & rsValue,
const PdfString & rsDisplayName = PdfString::StringNull )

Inserts a new item into the list

Parameters
rsValuethe value of the item
rsDisplayNamean optional display string that is displayed in the viewer instead of the value

◆ IsComboBox()

bool PoDoFo::PdfListField::IsComboBox ( ) const
inline
Returns
true if this PdfListField is a PdfComboBox and false if it is a PdfListBox

◆ IsMultiSelect()

bool PoDoFo::PdfListField::IsMultiSelect ( ) const
inline
Returns
true if multi selection is enabled for this list

◆ IsSorted()

bool PoDoFo::PdfListField::IsSorted ( ) const
inline
Returns
true if sorting is enabled

◆ IsSpellcheckingEnabled()

bool PoDoFo::PdfListField::IsSpellcheckingEnabled ( ) const
inline
Returns
true if spellchecking is enabled for this combobox

◆ RemoveItem()

void PoDoFo::PdfListField::RemoveItem ( int nIndex)

Removes an item for the list

Parameters
nIndexindex of the item to remove

◆ SetMultiSelect()

void PoDoFo::PdfListField::SetMultiSelect ( bool bMulti)
inline

Sets wether multiple items can be selected by the user in the list.

Parameters
bMultiif true multiselect will be enabled

By default multiselection is turned off.

◆ SetSelectedItem()

void PoDoFo::PdfListField::SetSelectedItem ( int nIndex)

Sets the currently selected item

Parameters
nIndexindex of the currently selected item

◆ SetSorted()

void PoDoFo::PdfListField::SetSorted ( bool bSorted)
inline

Enable or disable sorting of items. The sorting does not happen in acrobat reader but whenever adding items using PoDoFo or another PDF editing application.

Parameters
bSortedenable/disable sorting

◆ SetSpellcheckingEnabled()

void PoDoFo::PdfListField::SetSpellcheckingEnabled ( bool bSpellcheck)
inline

Enable/disable spellchecking for this combobox

Parameters
bSpellcheckif true spellchecking will be enabled

combobox are spellchecked by default