PoDoFo 1.0.0-dev
Loading...
Searching...
No Matches
PdfButton.h
1
7#ifndef PDF_BUTTON_H
8#define PDF_BUTTON_H
9
10#include "PdfField.h"
11
12namespace PoDoFo
13{
14 class PODOFO_API PdfButton : public PdfField
15 {
16 friend class PdfPushButton;
17 friend class PdfToggleButton;
18
19 private:
20 PdfButton(PdfAcroForm& acroform, PdfFieldType fieldType,
21 const std::shared_ptr<PdfField>& parent);
22
23 PdfButton(PdfAnnotationWidget& widget, PdfFieldType fieldType,
24 const std::shared_ptr<PdfField>& parent);
25
26 PdfButton(PdfObject& obj, PdfAcroForm* acroform, PdfFieldType fieldType);
27
28 public:
32 bool IsPushButton() const;
33
37 bool IsCheckBox() const;
38
42 bool IsRadioButton() const;
43
48 void SetCaption(nullable<const PdfString&> text);
49
53 nullable<const PdfString&> GetCaption() const;
54 };
55
56 class PODOFO_API PdfToggleButton : public PdfButton
57 {
58 friend class PdfCheckBox;
59 friend class PdfRadioButton;
60
61 private:
62 PdfToggleButton(PdfAcroForm& acroform, PdfFieldType fieldType,
63 const std::shared_ptr<PdfField>& parent);
64
65 PdfToggleButton(PdfAnnotationWidget& widget, PdfFieldType fieldType,
66 const std::shared_ptr<PdfField>& parent);
67
68 PdfToggleButton(PdfObject& obj, PdfAcroForm* acroform, PdfFieldType fieldType);
69
70 public:
75 void SetChecked(bool isChecked);
76
80 bool IsChecked() const;
81
87 void SetAppearanceChecked(const PdfXObject& xobj);
88
94 void SetAppearanceUnchecked(const PdfXObject& xobj);
95 };
96}
97
98#endif // PDF_BUTTON_H
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition basetypes.h:16