Collection.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/object_ext.h>
5 #include <system/nullable.h>
6 #include <system/enum.h>
7 #include <system/collections/icomparer.h>
8 #include <system/array.h>
9 #include <cstdint>
10 
11 #include "Aspose.PDF.Cpp/EmbeddedFileCollection.h"
12 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
13 
14 namespace Aspose
15 {
16 namespace Pdf
17 {
18 class Collection;
19 class CollectionField;
20 class CollectionItem;
21 class CollectionSort;
22 class Document;
23 namespace Engine
24 {
25 namespace Data
26 {
27 class IPdfDictionary;
28 class IPdfName;
29 } // namespace Data
30 } // namespace Engine
31 class FileSpecification;
32 } // namespace Pdf
33 } // namespace Aspose
34 namespace System
35 {
36 namespace Collections
37 {
38 namespace Generic
39 {
40 template <typename, typename> class Dictionary;
41 template <typename> class ICollection;
42 template <typename> class IList;
43 } // namespace Generic
44 } // namespace Collections
45 } // namespace System
46 
47 namespace Aspose {
48 
49 namespace Pdf {
50 
54 enum class FieldValueType
55 {
59  None,
63  Text,
67  Number,
71  Date
72 };
73 
78 {
82  None = 0,
86  S,
90  D,
94  N,
99  F,
104  Desc,
109  ModDate,
114  CreationDate,
119  Size,
125 };
126 
133 class FileSpecificationComparer : public System::Collections::Generic::IComparer<System::SharedPtr<Aspose::Pdf::FileSpecification>>
134 {
137 
138  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
139  RTTI_INFO_DECL();
140 
141 public:
142 
148 
155  int32_t Compare(const System::SharedPtr<FileSpecification>& first, const System::SharedPtr<FileSpecification>& second) const override;
156 
157 private:
158 
160 
161  int32_t CompareByCollectionItemFields(const System::SharedPtr<FileSpecification>& first, const System::SharedPtr<FileSpecification>& second) const;
162  int32_t CompareCollectionItems(const System::SharedPtr<CollectionItem>& first, const System::SharedPtr<CollectionItem>& second, const System::String& name, bool ascOrder) const;
163  bool TryCompareDateValues(const System::SharedPtr<CollectionItem>& first, const System::SharedPtr<CollectionItem>& second, const System::String& name, int32_t& result) const;
164  bool TryCompareIntValues(const System::SharedPtr<CollectionItem>& first, const System::SharedPtr<CollectionItem>& second, const System::String& name, int32_t& result) const;
165  bool TryCompareDoubleValues(const System::SharedPtr<CollectionItem>& first, const System::SharedPtr<CollectionItem>& second, const System::String& name, int32_t& result) const;
166  bool TryCompareTextValues(const System::SharedPtr<CollectionItem>& first, const System::SharedPtr<CollectionItem>& second, const System::String& name, int32_t& result) const;
167  int32_t CompareByAlternateStrategy(const System::SharedPtr<FileSpecification>& first, const System::SharedPtr<FileSpecification>& second) const;
168 
169 };
170 
174 class ASPOSE_PDF_SHARED_CLASS CollectionSchema : public System::Object
175 {
176  typedef CollectionSchema ThisType;
177  typedef System::Object BaseType;
178 
179  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
180  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
181 
183 
184 public:
185 
194 
202  ASPOSE_PDF_SHARED_API bool HasName(System::String name);
208  ASPOSE_PDF_SHARED_API System::SharedPtr<CollectionField> GetCollectionField(System::String name);
209 
210 protected:
211 
216 
218 
224 
226 
227 private:
228 
231 
232  System::SharedPtr<CollectionField> CreateCollectionField(System::String key);
233 
234 };
235 
240 {
241  typedef CollectionFieldSubtypeConverter ThisType;
242  typedef System::Object BaseType;
243 
244  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
245  RTTI_INFO_DECL();
246 
247 public:
248 
266  static CollectionFieldSubtype Convert(System::String name);
275  static System::String Convert(CollectionFieldSubtype suptype);
281  static FieldValueType ConvertToFieldType(CollectionFieldSubtype subtype);
282 
283 };
284 
288 class ASPOSE_PDF_SHARED_CLASS CollectionField : public System::Object
289 {
290  typedef CollectionField ThisType;
291  typedef System::Object BaseType;
292 
293  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
294  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
295 
297 
298 public:
299 
304  ASPOSE_PDF_SHARED_API FieldValueType get_FiledType() const;
310  ASPOSE_PDF_SHARED_API CollectionFieldSubtype get_Subtype() const;
314  ASPOSE_PDF_SHARED_API System::String get_N() const;
319  ASPOSE_PDF_SHARED_API System::Nullable<int32_t> get_O() const;
323  ASPOSE_PDF_SHARED_API bool get_V() const;
328  ASPOSE_PDF_SHARED_API bool get_E() const;
329 
330 protected:
331 
337 
339 
340 private:
341 
343  FieldValueType pr_FiledType;
344 
349  ASPOSE_PDF_SHARED_API void set_FiledType(FieldValueType value);
350 
351  CollectionFieldSubtype pr_Subtype;
352 
358  ASPOSE_PDF_SHARED_API void set_Subtype(CollectionFieldSubtype value);
359 
360  System::String pr_N;
361 
365  ASPOSE_PDF_SHARED_API void set_N(System::String value);
366 
368 
373  ASPOSE_PDF_SHARED_API void set_O(System::Nullable<int32_t> value);
374 
375  bool pr_V;
376 
380  ASPOSE_PDF_SHARED_API void set_V(bool value);
381 
382  bool pr_E;
383 
388  ASPOSE_PDF_SHARED_API void set_E(bool value);
389 
390  void InitValues();
391  void InitSubype();
392 
393 };
394 
399 {
400  typedef CollectionSort ThisType;
401  typedef System::Object BaseType;
402 
403  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
404  RTTI_INFO_DECL();
405 
406 public:
407 
420  const System::ArrayPtr<System::String>& get_S() const;
434  const System::ArrayPtr<bool>& get_A() const;
435 
439  CollectionSort();
445 
446 private:
447 
450 
463  void set_S(System::ArrayPtr<System::String> value);
464 
466 
480  void set_A(System::ArrayPtr<bool> value);
481 
482  void InitValues();
483  void InitA();
484  void InitS();
485 
486 };
487 
491 class ASPOSE_PDF_SHARED_CLASS Collection : public Aspose::Pdf::EmbeddedFileCollection
492 {
493  typedef Collection ThisType;
494  typedef Aspose::Pdf::EmbeddedFileCollection BaseType;
495 
496  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
497  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
498 
499  friend class Aspose::Pdf::Document;
500 
501 public:
502 
506  ASPOSE_PDF_SHARED_API System::SharedPtr<CollectionSchema> get_Schema();
510  ASPOSE_PDF_SHARED_API System::String get_DefaultEntry();
511 
515  ASPOSE_PDF_SHARED_API Collection();
516 
522 
523 protected:
524 
529 
535 
537 
538  virtual ASPOSE_PDF_SHARED_API ~Collection();
539 
540 private:
541 
545 
547 
548 };
549 
550 } // namespace Pdf
551 } // namespace Aspose
552 
553 template<>
554 struct EnumMetaInfo<Aspose::Pdf::CollectionFieldSubtype>
555 {
556  static const ASPOSE_PDF_SHARED_API std::array<std::pair<Aspose::Pdf::CollectionFieldSubtype, const char_t*>, 10>& values();
557 };
558 
559 
560 
MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Collection, CODEPORTING_ARGS(System::SharedPtr< Document > document))
MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Document, CODEPORTING_ARGS(PdfVersion version))
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
Represents a comparator class for a file specification. The comparator compares according to the spec...
Definition: Collection.h:133
Represents a document collection schema field class.
Definition: Collection.h:288
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
FieldValueType
Represents the type of a field value in a schema collection.
Definition: Collection.h:54
(PDF 2.0) The field data is the length of the embedded file stream, as identified by the Length entry...
Represents a number type.
Class representing embedded files collection.
Definition: EmbeddedFileCollection.h:98
Represents a date type.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: fwd.h:22
Represents a text type.
Definition: AFRelationship.h:4
MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(CollectionSchema, CODEPORTING_ARGS())
A number type. The field data shall be stored as a PDF number.
Interface of collection of elements. Objects of this class should only be allocated using System::Mak...
Definition: Collection.h:41
The field data shall be the file name of the embedded file stream, as identified by the UF entry of t...
Interface that compares two objects in greater-equal-less sense. Objects of this class should only be...
Definition: icomparer.h:19
The field data shall be the modification date of the embedded file stream, as identified by the ModDa...
A text type. The field data shall be stored as a PDF text string.
The field data shall be the size of the embedded file, as identified by the Size entry in the embedde...
Represents class for Collection(12.3.5 Collections).
Definition: Collection.h:491
A date type. The field data shall be stored as a PDF date string.
Represents a class for converting CollectionFieldSubtype values.
Definition: Collection.h:239
The field data shall be the file name of the embedded file stream, as identified by the UF entry of t...
CollectionFieldSubtype
Represents the subtype parameter of a field in a sceme collection.
Definition: Collection.h:77
Represents a class for a collection sort definition.
Definition: Collection.h:398
Represents a class that describes the "Schema" of a document collection.
Definition: Collection.h:174
The field data shall be the creation date of the embedded file stream, as identified by the CreationD...
Interface of indexed container of elements. Objects of this class should only be allocated using Syst...
Definition: Collection.h:42
Whole PDF file will be submitted.