WidgetAnnotation.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/shared_ptr.h>
5 #include <cstdint>
6 
7 #include "Aspose.PDF.Cpp/InteractiveFeatures/Annotations/Annotation.h"
8 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
9 
10 namespace Aspose
11 {
12 namespace Pdf
13 {
14 namespace Annotations
15 {
16 class AnnotationActionCollection;
17 class AnnotationCollection;
18 class AnnotationSelector;
19 enum class AnnotationType;
20 class DefaultAppearance;
21 enum class HighlightingMode;
22 class PdfAction;
23 } // namespace Annotations
24 class Document;
25 namespace Engine
26 {
27 namespace Data
28 {
29 class IPdfObject;
30 class IPdfPrimitive;
31 class ITrailerable;
32 } // namespace Data
33 } // namespace Engine
34 namespace Forms
35 {
36 class BarcodeField;
37 class ButtonField;
38 class CheckboxField;
39 class ChoiceOption;
40 class Field;
41 class Form;
42 class ListBoxField;
43 } // namespace Forms
44 namespace InteractiveFeatures
45 {
46 namespace Forms
47 {
48 class WidgetWrapper;
49 } // namespace Forms
50 } // namespace InteractiveFeatures
51 class OperatorCollection;
52 class Page;
53 class PageCollection;
54 namespace Plugins
55 {
56 class FormComboBoxFieldSetOptions;
57 class FormTextBoxFieldSetOptions;
58 } // namespace Plugins
59 class Rectangle;
60 namespace Tests
61 {
62 namespace Annotations
63 {
64 class AnnotationTests;
65 } // namespace Annotations
66 class RegressionTests_v22_07;
67 } // namespace Tests
68 namespace Text
69 {
70 class Font;
71 } // namespace Text
72 class XForm;
73 } // namespace Pdf
74 } // namespace Aspose
75 namespace System
76 {
77 namespace Drawing
78 {
79 class Color;
80 } // namespace Drawing
81 class String;
82 } // namespace System
83 
84 namespace Aspose {
85 
86 namespace Pdf {
87 
88 namespace Annotations {
89 
93 class ASPOSE_PDF_SHARED_CLASS WidgetAnnotation : public Aspose::Pdf::Annotations::Annotation
94 {
95  typedef WidgetAnnotation ThisType;
97 
98  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
99  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
100 
102  friend class Aspose::Pdf::Document;
108  friend class Aspose::Pdf::Forms::ChoiceOption;
112  friend class Aspose::Pdf::InteractiveFeatures::Forms::WidgetWrapper;
115  friend class Aspose::Pdf::Tests::Annotations::AnnotationTests;
116  friend class Aspose::Pdf::Tests::RegressionTests_v22_07;
117 
118 public:
119 
123  ASPOSE_PDF_SHARED_API System::SharedPtr<PdfAction> get_OnActivated();
127  ASPOSE_PDF_SHARED_API void set_OnActivated(System::SharedPtr<PdfAction> value);
131  ASPOSE_PDF_SHARED_API System::SharedPtr<AnnotationActionCollection> get_Actions() const;
135  ASPOSE_PDF_SHARED_API HighlightingMode get_Highlighting();
139  ASPOSE_PDF_SHARED_API void set_Highlighting(HighlightingMode value);
143  ASPOSE_PDF_SHARED_API System::SharedPtr<Aspose::Pdf::Forms::Field> get_Parent();
147  ASPOSE_PDF_SHARED_API System::SharedPtr<Aspose::Pdf::Annotations::DefaultAppearance> get_DefaultAppearance();
151  ASPOSE_PDF_SHARED_API void set_DefaultAppearance(System::SharedPtr<Aspose::Pdf::Annotations::DefaultAppearance> value);
155  ASPOSE_PDF_SHARED_API bool get_ReadOnly();
159  ASPOSE_PDF_SHARED_API void set_ReadOnly(bool value);
163  ASPOSE_PDF_SHARED_API bool get_Required();
167  ASPOSE_PDF_SHARED_API void set_Required(bool value);
171  ASPOSE_PDF_SHARED_API bool get_Exportable();
175  ASPOSE_PDF_SHARED_API void set_Exportable(bool value);
179  ASPOSE_PDF_SHARED_API Aspose::Pdf::Annotations::AnnotationType get_AnnotationType() override;
180 
185  ASPOSE_PDF_SHARED_API void Accept(System::SharedPtr<AnnotationSelector> visitor) override;
186 
191  ASPOSE_PDF_SHARED_API WidgetAnnotation(System::SharedPtr<Document> doc);
192 
197  ASPOSE_PDF_SHARED_API System::String GetCheckedStateName();
198 
199 protected:
200 
201  static const int32_t _ReadOnly;
202  static const int32_t _Required;
203  static const int32_t _NoExport;
204  int32_t ff;
205 
209  ASPOSE_PDF_SHARED_API void set_Parent(System::SharedPtr<Aspose::Pdf::Forms::Field> value);
213  bool get_IsCertified();
214 
221 
222  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(WidgetAnnotation, CODEPORTING_ARGS(System::SharedPtr<Aspose::Pdf::Engine::Data::IPdfObject> engineAnnot, System::SharedPtr<Document> document));
223 
230 
231  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(WidgetAnnotation, CODEPORTING_ARGS(System::SharedPtr<Aspose::Pdf::Page> page, System::SharedPtr<Rectangle> rect));
232 
234 
235  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(WidgetAnnotation, CODEPORTING_ARGS(System::SharedPtr<Document> doc, System::SharedPtr<Rectangle> rect));
236 
238 
239  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(WidgetAnnotation, CODEPORTING_ARGS());
245  ASPOSE_PDF_SHARED_API void Initialize(System::SharedPtr<Aspose::Pdf::Engine::Data::ITrailerable> trailer, System::SharedPtr<Rectangle> rect) override;
246  static int32_t getFieldFlag(System::SharedPtr<Aspose::Pdf::Engine::Data::IPdfPrimitive> field);
247  void setFieldFlag(int32_t bit, bool set);
254  ASPOSE_PDF_SHARED_API System::SharedPtr<XForm> PrepareAppearance(System::String key, System::SharedPtr<Annotation> annotation) override;
259  ASPOSE_PDF_SHARED_API void ClearAppearance(System::SharedPtr<OperatorCollection> appearance) override;
260  ASPOSE_PDF_SHARED_API void UpdateAppearance(System::SharedPtr<Annotation> annotation) override;
261  ASPOSE_PDF_SHARED_API System::Drawing::Color GetBackgroundColor() override;
262 
263  virtual ASPOSE_PDF_SHARED_API ~WidgetAnnotation();
264 
265 private:
266 
267  System::SharedPtr<PdfAction> onActivated;
271 
278 
279 };
280 
281 } // namespace Annotations
282 } // namespace Pdf
283 } // namespace Aspose
284 
285 
static const int32_t _NoExport
Definition: WidgetAnnotation.h:203
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
HighlightingMode
Enumerates the annotation�s highlighting mode, the visual effect to be used when the mouse button is...
Definition: HighlightingMode.h:18
Class representing form object.
Definition: Form.h:172
Class representing PDF document
Definition: Document.h:625
Definition: Artifact.h:67
static const int32_t _ReadOnly
Definition: WidgetAnnotation.h:201
Class represents barcode field.
Definition: BarcodeField.h:49
static const int32_t _Required
Definition: WidgetAnnotation.h:202
Class represnets push button field.
Definition: ButtonField.h:73
int32_t ff
Definition: WidgetAnnotation.h:204
Class representing widget annotation.
Definition: WidgetAnnotation.h:93
Definition: signed_info.h:13
Base class for acro form fields.
Definition: Field.h:130
Specifies that the member is a field.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
AnnotationType
Enumeration of annotation types.
Definition: AnnotationType.h:18
Definition: AFRelationship.h:4
Represents a color. This type should be allocated on stack and passed to functions by value or by ref...
Definition: color.h:23
Class represents ListBox field.
Definition: ListBoxField.h:54
Defies a method that enables object cloning - creating a copy of an object. Objects of this class sho...
Definition: icloneable.h:15
Represents options for set properties in TextBoxField by FormEditor plugin.
Definition: FormTextBoxFieldSetOptions.h:29
Class representing annotation collection.
Definition: AnnotationCollection.h:56
The coordinates are in the page coordinate context.
Collection of PDF document pages.
Definition: PageCollection.h:135
Class representing annotation object.
Definition: Annotation.h:303
Represents a abstract base object can be added to the page(doc.Paragraphs.Add()). ...
Definition: BaseParagraph.h:66
Represents options for set properties in ComboBoxField by FormEditor plugin.
Definition: FormComboBoxFieldSetOptions.h:41
Class representing checkbox field
Definition: CheckboxField.h:86
Whole PDF file will be submitted.