PoDoFo 1.1.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
20 class PODOFO_API PdChoiceField : public PdfField
21 {
22 friend class PdfListBox;
23 friend class PdfComboBox;
24
25 private:
27 std::shared_ptr<PdfField>&& parent);
28
29 PdChoiceField(PdfAnnotationWidget& widget, PdfFieldType fieldType,
30 std::shared_ptr<PdfField>&& parent);
31
33
34 public:
42 void InsertItem(const PdfString& value, nullable<const PdfString&> displayName = { });
43
49 void RemoveItem(unsigned index);
50
55 PdfString GetItem(unsigned index) const;
56
65 nullable<const PdfString&> GetItemDisplayText(int index) const;
66
70 unsigned GetItemCount() const;
71
75 void SetSelectedIndex(int index);
76
81 int GetSelectedIndex() const;
82
87 bool IsComboBox() const;
88
96 void SetSpellCheckingEnabled(bool spellCheck);
97
101 bool IsSpellCheckingEnabled() const;
102
111 void SetSorted(bool sorted);
112
116 bool IsSorted() const;
117
126 void SetMultiSelect(bool multi);
127
132 bool IsMultiSelect() const;
133
134 void SetCommitOnSelectionChange(bool commit);
135 bool IsCommitOnSelectionChange() const;
136 };
137}
138
139#endif // PDF_CHOICE_FIELD_H
A list of items in a PDF file.
Definition PdfChoiceField.h:21
A combo box with a drop down list of items.
Definition PdfComboBox.h:15
A list box.
Definition PdfListBox.h:15
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:33
A string that can be written to a PDF document.
Definition PdfString.h:22
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:35
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:665