Metadata.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/collections/idictionary.h>
5 #include <system/array.h>
6 #include <cstdint>
7 
8 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
9 
10 namespace Aspose
11 {
12 namespace Pdf
13 {
14 class Document;
15 namespace Engine
16 {
17 namespace Data
18 {
19 class IPdfObject;
20 namespace XMP
21 {
22 class XmpDataCollection;
23 } // namespace XMP
24 } // namespace Data
25 } // namespace Engine
26 namespace Tests
27 {
28 class RegressionTests_v7_6;
29 class RegressionTests_v8_4;
30 class RegressionTests_v8_6;
31 } // namespace Tests
32 class XImage;
33 class XmpPdfAExtensionObject;
34 class XmpPdfAExtensionSchema;
35 class XmpValue;
36 } // namespace Pdf
37 } // namespace Aspose
38 namespace System
39 {
40 namespace Collections
41 {
42 namespace Generic
43 {
44 template <typename> class ICollection;
45 template <typename> class IEnumerator;
46 template <typename, typename> class KeyValuePair;
47 } // namespace Generic
48 } // namespace Collections
49 namespace IO
50 {
51 class Stream;
52 } // namespace IO
53 namespace Xml
54 {
55 class XmlNamespaceManager;
56 } // namespace Xml
57 } // namespace System
58 
59 namespace Aspose {
60 
61 namespace Pdf {
62 
66 class ASPOSE_PDF_SHARED_CLASS Metadata final : public System::Collections::Generic::IDictionary<System::String, System::SharedPtr<Aspose::Pdf::XmpValue>>
67 {
68  typedef Metadata ThisType;
70 
71  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
72  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
73 
74  friend class Aspose::Pdf::Document;
75  friend class Aspose::Pdf::XImage;
76  friend class Aspose::Pdf::Tests::RegressionTests_v7_6;
77  friend class Aspose::Pdf::Tests::RegressionTests_v8_4;
78  friend class Aspose::Pdf::Tests::RegressionTests_v8_6;
79 
80 public:
81 
85  ASPOSE_PDF_SHARED_API bool get_IsFixedSize() const;
89  ASPOSE_PDF_SHARED_API bool get_IsReadOnly() const override;
93  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Collections::Generic::ICollection<System::String>> get_Keys() const override;
97  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Collections::Generic::ICollection<System::SharedPtr<XmpValue>>> get_Values() const override;
105  ASPOSE_PDF_SHARED_API int32_t get_Count() const override;
109  ASPOSE_PDF_SHARED_API bool get_IsSynchronized();
113  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Object> get_SyncRoot() const;
117  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Xml::XmlNamespaceManager> get_NamespaceManager();
118 
124  ASPOSE_PDF_SHARED_API void RegisterNamespaceUri(System::String prefix, System::String namespaceUri);
131  ASPOSE_PDF_SHARED_API void RegisterNamespaceUri(System::String prefix, System::String namespaceUri, System::String schemaDescription);
137  ASPOSE_PDF_SHARED_API System::String GetNamespaceUriByPrefix(System::String prefix);
143  ASPOSE_PDF_SHARED_API System::String GetPrefixByNamespaceUri(System::String namespaceUri);
149  ASPOSE_PDF_SHARED_API void Add(const System::String& key, const System::SharedPtr<XmpValue>& value) override;
155  ASPOSE_PDF_SHARED_API void Add(const System::String& key, const System::SharedPtr<System::Object>& value);
161  ASPOSE_PDF_SHARED_API void Add(const System::String& prefix, const System::SharedPtr<XmpPdfAExtensionObject>& value);
165  ASPOSE_PDF_SHARED_API void Clear() override;
171  ASPOSE_PDF_SHARED_API bool Contains(const System::String& key) const;
182  ASPOSE_PDF_SHARED_API bool Remove(const System::String& key) override;
183 
189  ASPOSE_PDF_SHARED_API System::SharedPtr<XmpValue> idx_get(const System::String& key) const override;
195  ASPOSE_PDF_SHARED_API void idx_set(const System::String& key, System::SharedPtr<XmpValue> value) override;
196 
202  ASPOSE_PDF_SHARED_API void CopyTo(System::ArrayPtr<System::Collections::Generic::KeyValuePair<System::String, System::SharedPtr<XmpValue>>> array, int32_t index) override;
208  ASPOSE_PDF_SHARED_API bool ContainsKey(const System::String& key) const override;
215  ASPOSE_PDF_SHARED_API bool TryGetValue(const System::String& key, System::SharedPtr<XmpValue>& value) const override;
220  ASPOSE_PDF_SHARED_API void Add(const System::Collections::Generic::KeyValuePair<System::String, System::SharedPtr<XmpValue>>& item) override;
226  ASPOSE_PDF_SHARED_API bool Contains(const System::Collections::Generic::KeyValuePair<System::String, System::SharedPtr<XmpValue>>& item) const override;
232  ASPOSE_PDF_SHARED_API bool Remove(const System::Collections::Generic::KeyValuePair<System::String, System::SharedPtr<XmpValue>>& item) override;
233 
234 protected:
235 
236  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Collections::Generic::ICollection<System::String>> get_KeysInternal() const;
237  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Collections::Generic::ICollection<System::SharedPtr<XmpValue>>> get_ValuesInternal() const;
238 
244 
245  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Metadata, CODEPORTING_ARGS(System::SharedPtr<System::IO::Stream> stream, System::SharedPtr<Engine::Data::IPdfObject> owner));
246 
248 
249  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Metadata, CODEPORTING_ARGS(System::SharedPtr<Engine::Data::XMP::XmpDataCollection> _data, System::SharedPtr<Engine::Data::IPdfObject> owner));
250 
254  Metadata();
255 
256  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(Metadata, CODEPORTING_ARGS());
262  void Update();
263 
264  virtual ASPOSE_PDF_SHARED_API ~Metadata();
265 
266 private:
267 
269  static const System::String _defaultXmpNamespacePrefix;
270  static const System::String _defaultXmpNamespaceUri;
272 
274 
275 };
276 
277 } // namespace Pdf
278 } // namespace Aspose
279 
280 
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
Provides access to XMP metadata stream.
Definition: Metadata.h:66
Class representing PDF document
Definition: Document.h:625
Definition: Artifact.h:67
Pair of key and value. This type should be allocated on stack and passed to functions by value or by ...
Definition: PdfXmpMetadata.h:41
Definition: signed_info.h:13
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
Definition: AFRelationship.h:4
Class representing image X-Object.
Definition: XImage.h:173
Interface for dictionary-alike containers. Objects of this class should only be allocated using Syste...
Definition: Document.h:592
Whole PDF file will be submitted.