PoDoFo  1.0.0-dev
Public Member Functions | Friends | List of all members
PoDoFo::PdChoiceField Class Reference

A list of items in a PDF file. More...

#include <PdfChoiceField.h>

Inheritance diagram for PoDoFo::PdChoiceField:
PoDoFo::PdfComboBox PoDoFo::PdfListBox

Public Member Functions

void InsertItem (const PdfString &value, nullable< const PdfString & > displayName={ })
 Inserts a new item into the list. More...
 
void RemoveItem (unsigned index)
 Removes an item for the list. More...
 
PdfString GetItem (unsigned index) const
 
nullable< const PdfString & > GetItemDisplayText (int index) const
 
unsigned GetItemCount () const
 
void SetSelectedIndex (int index)
 Sets the currently selected item. More...
 
int GetSelectedIndex () const
 Sets the currently selected item. More...
 
bool IsComboBox () const
 
void SetSpellCheckingEnabled (bool spellCheck)
 Enable/disable spellchecking for this combobox. More...
 
bool IsSpellCheckingEnabled () const
 
void SetSorted (bool sorted)
 Enable or disable sorting of items. More...
 
bool IsSorted () const
 
void SetMultiSelect (bool multi)
 Sets whether multiple items can be selected by the user in the list. More...
 
bool IsMultiSelect () const
 
void SetCommitOnSelectionChange (bool commit)
 
bool IsCommitOnSelectionChange () const
 

Friends

class PdfListBox
 
class PdfComboBox
 

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

Member Function Documentation

◆ GetItem()

PdfString PdChoiceField::GetItem ( unsigned  index) const
Parameters
indexindex of the item
Returns
the value of the item at the specified index

◆ GetItemCount()

unsigned PdChoiceField::GetItemCount ( ) const
Returns
the number of items in this list

◆ GetItemDisplayText()

nullable< const PdfString & > PdChoiceField::GetItemDisplayText ( int  index) const
Parameters
indexindex 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

◆ GetSelectedIndex()

int PdChoiceField::GetSelectedIndex ( ) const

Sets the currently selected item.

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

◆ InsertItem()

void PdChoiceField::InsertItem ( const PdfString value,
nullable< const PdfString & >  displayName = { } 
)

Inserts a new item into the list.

Parameters
valuethe value of the item
displayNamean optional display string that is displayed in the viewer instead of the value

◆ IsComboBox()

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

◆ IsMultiSelect()

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

◆ IsSorted()

bool PdChoiceField::IsSorted ( ) const
Returns
true if sorting is enabled

◆ IsSpellCheckingEnabled()

bool PdChoiceField::IsSpellCheckingEnabled ( ) const
Returns
true if spellchecking is enabled for this combobox

◆ RemoveItem()

void PdChoiceField::RemoveItem ( unsigned  index)

Removes an item for the list.

Parameters
indexindex of the item to remove

◆ SetMultiSelect()

void PdChoiceField::SetMultiSelect ( bool  multi)

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

Parameters
multiif true multiselect will be enabled

By default multiselection is turned off.

◆ SetSelectedIndex()

void PdChoiceField::SetSelectedIndex ( int  index)

Sets the currently selected item.

Parameters
indexindex of the currently selected item

◆ SetSorted()

void PdChoiceField::SetSorted ( bool  sorted)

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
sortedenable/disable sorting

◆ SetSpellCheckingEnabled()

void PdChoiceField::SetSpellCheckingEnabled ( bool  spellCheck)

Enable/disable spellchecking for this combobox.

Parameters
spellCheckif true spellchecking will be enabled

combobox are spellchecked by default


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