PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfTextBox.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_TEXTBOX_H
6#define PDF_TEXTBOX_H
7
8#include "PdfField.h"
9
10namespace PoDoFo
11{
18 class PODOFO_API PdfTextBox final : public PdfField
19 {
20 friend class PdfField;
21 private:
22 enum
23 {
24 PdfTextBox_MultiLine = 0x0001000,
25 PdfTextBox_Password = 0x0002000,
26 PdfTextBox_FileSelect = 0x0100000,
27 PdfTextBox_NoSpellcheck = 0x0400000,
28 PdfTextBox_NoScroll = 0x0800000,
29 PdfTextBox_Comb = 0x1000000,
30 PdfTextBox_RichText = 0x2000000
31 };
32
33 private:
34 PdfTextBox(PdfAcroForm& acroform, std::shared_ptr<PdfField>&& parent);
35
36 PdfTextBox(PdfAnnotationWidget& widget, std::shared_ptr<PdfField>&& parent);
37
38 PdfTextBox(PdfObject& obj, PdfAcroForm* acroform);
39
40 public:
44 void SetText(nullable<const PdfString&> text);
45
47 nullable<const PdfString&> GetText() const;
48
51 void SetMaxLen(int64_t maxLen);
52
55 int64_t GetMaxLen() const;
56
62 void SetMultiLine(bool multiLine);
63
65 bool IsMultiLine() const;
66
73 void SetPasswordField(bool password);
74
77 bool IsPasswordField() const;
78
85 void SetFileField(bool file);
86
88 bool IsFileField() const;
89
95 void SetSpellCheckingEnabled(bool spellcheck);
96
98 bool IsSpellCheckingEnabled() const;
99
105 void SetScrollBarsEnabled(bool scroll);
106
108 bool IsScrollBarsEnabled() const;
109
119 void SetCombs(bool combs);
120
122 bool IsCombs() const;
123
129 void SetRichText(bool richText);
130
132 bool IsRichText() const;
133
134 PdfTextBox* GetParent();
135 const PdfTextBox* GetParent() const;
136
137 private:
138 void init();
139 };
140}
141
142#endif // PDF_TEXTBOX_H
This class represents a PDF indirect Object in memory.
Definition PdfObject.h:31
A text field in a PDF file.
Definition PdfTextBox.h:19
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