PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfChoiceField.h
1// SPDX-FileCopyrightText: 2007 Dominik Seichter <domseichter@web.de>
2// SPDX-FileCopyrightText: 2020 Francesco Pretto <ceztko@gmail.com>
3// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
4
5#ifndef PDF_CHOICE_FIELD_H
6#define PDF_CHOICE_FIELD_H
7
8#include "PdfField.h"
9
10namespace PoDoFo
11{
12 // TODO: Multiselect
19 class PODOFO_API PdChoiceField : public PdfField
20 {
21 friend class PdfListBox;
22 friend class PdfComboBox;
23
24 private:
26 std::shared_ptr<PdfField>&& parent);
27
28 PdChoiceField(PdfAnnotationWidget& widget, PdfFieldType fieldType,
29 std::shared_ptr<PdfField>&& parent);
30
32
33 public:
39 void InsertItem(const PdfString& value, nullable<const PdfString&> displayName = { });
40
44 void RemoveItem(unsigned index);
45
48 PdfString GetItem(unsigned index) const;
49
56 nullable<const PdfString&> GetItemDisplayText(int index) const;
57
59 unsigned GetItemCount() const;
60
63 void SetSelectedIndex(int index);
64
68 int GetSelectedIndex() const;
69
72 bool IsComboBox() const;
73
79 void SetSpellCheckingEnabled(bool spellCheck);
80
82 bool IsSpellCheckingEnabled() const;
83
90 void SetSorted(bool sorted);
91
93 bool IsSorted() const;
94
101 void SetMultiSelect(bool multi);
102
105 bool IsMultiSelect() const;
106
107 void SetCommitOnSelectionChange(bool commit);
108 bool IsCommitOnSelectionChange() const;
109 };
110}
111
112#endif // PDF_CHOICE_FIELD_H
A list of items in a PDF file.
Definition PdfChoiceField.h:20
A combo box with a drop down list of items.
Definition PdfComboBox.h:14
A list box.
Definition PdfListBox.h:14
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:31
A string that can be written to a PDF document.
Definition PdfString.h:21
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13
PdfFieldType
The type of PDF field.
Definition PdfDeclarations.h:610