PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfButton.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_BUTTON_H
6#define PDF_BUTTON_H
7
8#include "PdfField.h"
9
10namespace PoDoFo
11{
12 class PODOFO_API PdfButton : public PdfField
13 {
14 friend class PdfPushButton;
15 friend class PdfToggleButton;
16
17 private:
18 PdfButton(PdfAcroForm& acroform, PdfFieldType fieldType,
19 std::shared_ptr<PdfField>&& parent);
20
21 PdfButton(PdfAnnotationWidget& widget, PdfFieldType fieldType,
22 std::shared_ptr<PdfField>&& parent);
23
24 PdfButton(PdfObject& obj, PdfAcroForm* acroform, PdfFieldType fieldType);
25
26 public:
28 bool IsPushButton() const;
29
31 bool IsCheckBox() const;
32
34 bool IsRadioButton() const;
35
39 void SetCaption(nullable<const PdfString&> text);
40
42 nullable<const PdfString&> GetCaption() const;
43 };
44
45 class PODOFO_API PdfToggleButton : public PdfButton
46 {
47 friend class PdfCheckBox;
48 friend class PdfRadioButton;
49
50 private:
51 PdfToggleButton(PdfAcroForm& acroform, PdfFieldType fieldType,
52 std::shared_ptr<PdfField>&& parent);
53
54 PdfToggleButton(PdfAnnotationWidget& widget, PdfFieldType fieldType,
55 std::shared_ptr<PdfField>&& parent);
56
57 PdfToggleButton(PdfObject& obj, PdfAcroForm* acroform, PdfFieldType fieldType);
58
59 public:
63 void SetChecked(bool isChecked);
64
66 bool IsChecked() const;
67
72 void SetAppearanceChecked(const PdfXObject& xobj);
73
78 void SetAppearanceUnchecked(const PdfXObject& xobj);
79 };
80}
81
82#endif // PDF_BUTTON_H
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13