XFA.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/array.h>
5 #include <cstdint>
6 
7 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
8 
9 namespace Aspose
10 {
11 namespace Pdf
12 {
13 namespace Annotations
14 {
15 class WidgetAnnotation;
16 class XfdfWriter;
17 } // namespace Annotations
18 namespace Collections
19 {
20 template <typename, typename> class AsposeHashDictionary;
21 } // namespace Collections
22 class Document;
23 namespace Engine
24 {
25 namespace Interactive
26 {
27 class XDP;
28 } // namespace Interactive
29 namespace IO
30 {
31 namespace ConvertStrategies
32 {
33 namespace ConvertHelpers
34 {
35 class FormExportImportUtils;
36 } // namespace ConvertHelpers
37 } // namespace ConvertStrategies
38 } // namespace IO
39 } // namespace Engine
40 namespace Facades
41 {
42 class Form;
43 } // namespace Facades
44 namespace Forms
45 {
46 class Field;
47 class Form;
48 class XfaField;
49 } // namespace Forms
50 class Page;
51 class Point;
52 namespace Tests
53 {
54 class RegressionTests_v6_8;
55 class RegressionTests_v7_1;
56 class RegressionTests_v7_4;
57 class RegressionTests_v8_6;
58 } // namespace Tests
59 class XfaMerge;
60 } // namespace Pdf
61 } // namespace Aspose
62 namespace System
63 {
64 namespace Collections
65 {
66 namespace Generic
67 {
68 template <typename> class ICollection;
69 } // namespace Generic
70 } // namespace Collections
71 namespace IO
72 {
73 class Stream;
74 } // namespace IO
75 namespace Xml
76 {
77 class XmlDocument;
78 class XmlNamespaceManager;
79 class XmlNode;
80 class XmlNodeList;
81 } // namespace Xml
82 } // namespace System
83 
84 namespace Aspose {
85 
86 namespace Pdf {
87 
88 namespace Forms {
89 
93 class ASPOSE_PDF_SHARED_CLASS XFA final : public System::Object
94 {
95  typedef XFA ThisType;
96  typedef System::Object BaseType;
97 
98  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
99  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
100 
101  friend class Aspose::Pdf::Forms::XfaField;
102  friend class Aspose::Pdf::Document;
106  friend class Aspose::Pdf::Annotations::XfdfWriter;
107  friend class Aspose::Pdf::XfaMerge;
108  friend class Aspose::Pdf::Engine::IO::ConvertStrategies::ConvertHelpers::FormExportImportUtils;
109  friend class Aspose::Pdf::Tests::RegressionTests_v8_6;
110  friend class Aspose::Pdf::Tests::RegressionTests_v6_8;
111  friend class Aspose::Pdf::Tests::RegressionTests_v7_1;
112  friend class Aspose::Pdf::Tests::RegressionTests_v7_4;
113 
114 protected:
115 
120  {
121  typedef PositionValue ThisType;
122  typedef System::Object BaseType;
123 
124  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
125  RTTI_INFO_DECL();
126 
127  public:
128 
132  double get_Value();
133 
135 
136  private:
137 
138  double value;
139  System::String meausreUnit;
141 
142  };
143 
148  {
149  typedef FieldCaption ThisType;
150  typedef System::Object BaseType;
151 
152  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
153  RTTI_INFO_DECL();
154 
155  public:
156 
160  double get_Margin() const;
161  System::String get_Text() const;
162 
164 
165  private:
166 
167  double _reserved;
168  System::String _text;
169 
170  };
171 
172 
173 public:
174 
178  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Xml::XmlNode> get_Template();
182  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Xml::XmlNode> get_Form();
186  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Xml::XmlNode> get_Datasets();
190  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Xml::XmlNode> get_Config();
194  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Xml::XmlDocument> get_XDP();
198  ASPOSE_PDF_SHARED_API System::ArrayPtr<System::String> get_FieldNames();
202  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Xml::XmlNamespaceManager> get_NamespaceManager();
203 
213  ASPOSE_PDF_SHARED_API System::String idx_get(System::String path);
223  ASPOSE_PDF_SHARED_API void idx_set(System::String path, System::String value);
224 
230  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Xml::XmlNode> GetFieldTemplate(System::String fieldName);
235  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Xml::XmlNodeList> GetFieldTemplates();
241  ASPOSE_PDF_SHARED_API void SetFieldImage(System::String fieldName, System::SharedPtr<System::IO::Stream> image);
242 
243 protected:
244 
249 
250  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(XFA, CODEPORTING_ARGS(System::SharedPtr<Document> document));
251  bool IsEmpty();
261  static void FlattenXfaField(System::SharedPtr<System::Xml::XmlNode> field);
262  static void HideXfaField(System::SharedPtr<System::Xml::XmlNode> field);
274  void BeginCachedUpdates();
278  void EndCachedUpdates();
284  System::SharedPtr<Point> GetPageContentArea(System::SharedPtr<Page> page);
286  System::SharedPtr<System::Xml::XmlNode> GetForm(System::String path, bool allowCreate);
298  System::String GetValueByDataRef(System::String dataRef);
304  void SetValueByDataRef(System::String dataRef, System::String value);
305  bool HasNode(System::String path);
308 
309  virtual ASPOSE_PDF_SHARED_API ~XFA();
310 
311 private:
312 
314  System::WeakPtr<Document> _document;
317 
331  System::String ExtractName(System::String name);
333  System::SharedPtr<Field> FindClosestField(System::String path);
335  int32_t Coincidence(System::ArrayPtr<System::String> path1, System::ArrayPtr<System::String> path2);
336 
337 };
338 
339 } // namespace Forms
340 } // namespace Pdf
341 } // namespace Aspose
342 
343 
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
Class representing Acro form object.
Definition: Form.h:115
Class representing form object.
Definition: Form.h:172
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:64
Class representing PDF document
Definition: Document.h:625
Definition: Artifact.h:67
Represents XML form regarding XML Forms Architecture (XFA).
Definition: XFA.h:93
Represent point with fractional coordinates.
Definition: Point.h:38
Describes field caption
Definition: XFA.h:147
Definition: signed_info.h:13
Base class for acro form fields.
Definition: Field.h:130
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
means saving in XML format
Class representing page of PDF document.
Definition: Page.h:375
Definition: AFRelationship.h:4
Subclass of System::SmartPtr which sets itself to weak mode at construction. Please note that this cl...
Definition: TextFragmentState.h:69
Interface of collection of elements. Objects of this class should only be allocated using System::Mak...
Definition: Collection.h:41
Class for parsing and recalculation positions, sizes, coordinates in different units (mm...
Definition: XFA.h:119
Whole PDF file will be submitted.