PdfXmpMetadata.h
1 #pragma once
2 // Copyright (c) 2001-2024 Aspose Pty Ltd. All Rights Reserved.
3 
4 #include <system/details/pointer_collection_helpers.h>
5 #include <system/collections/idictionary.h>
6 #include <system/array.h>
7 #include <cstdint>
8 
9 #include "Aspose.PDF.Cpp/Facades/Facade.h"
10 #include "Aspose.PDF.Cpp/aspose_pdf_api_defs.h"
11 
12 namespace Aspose
13 {
14 namespace Pdf
15 {
16 class Document;
17 namespace Facades
18 {
19 enum class DefaultMetadataProperties;
20 } // namespace Facades
21 namespace Tests
22 {
23 namespace Facades
24 {
25 class PdfXmpMetadataTests;
26 } // namespace Facades
27 } // namespace Tests
28 class XmpPdfAExtensionObject;
29 class XmpPdfAExtensionSchema;
30 class XmpValue;
31 } // namespace Pdf
32 } // namespace Aspose
33 namespace System
34 {
35 namespace Collections
36 {
37 namespace Generic
38 {
39 template <typename> class ICollection;
40 template <typename> class IEnumerator;
41 template <typename, typename> class KeyValuePair;
42 } // namespace Generic
43 } // namespace Collections
44 } // namespace System
45 
46 namespace Aspose {
47 
48 namespace Pdf {
49 
50 namespace Facades {
51 
55 class ASPOSE_PDF_SHARED_CLASS PdfXmpMetadata final : public Aspose::Pdf::Facades::SaveableFacade, public System::Collections::Generic::IDictionary<System::String, System::SharedPtr<Aspose::Pdf::XmpValue>>
56 {
57  typedef PdfXmpMetadata ThisType;
60 
61  typedef ::System::BaseTypesInfo<BaseType, BaseType1> ThisTypeBaseTypesInfo;
62  ASPOSE_PDF_SHARED_RTTI_INFO_DECL();
63 
64  friend class Aspose::Pdf::Tests::Facades::PdfXmpMetadataTests;
65 
66 public:
67 
75  ASPOSE_PDF_SHARED_API bool get_IsFixedSize() const;
79  ASPOSE_PDF_SHARED_API bool get_IsReadOnly() const override;
85  ASPOSE_PDF_SHARED_API int32_t get_Count() const override;
89  ASPOSE_PDF_SHARED_API bool get_IsSynchronized();
90 
96  ASPOSE_PDF_SHARED_API PdfXmpMetadata();
103  ASPOSE_PDF_SHARED_API PdfXmpMetadata(System::SharedPtr<Aspose::Pdf::Document> document);
104 
112  ASPOSE_PDF_SHARED_API void RegisterNamespaceURI(System::String prefix, System::String namespaceURI);
120  ASPOSE_PDF_SHARED_API System::String GetNamespaceURIByPrefix(System::String prefix);
128  ASPOSE_PDF_SHARED_API System::String GetPrefixByNamespaceURI(System::String namespaceURI);
136  ASPOSE_PDF_SHARED_API void Add(const DefaultMetadataProperties& key, const System::SharedPtr<XmpValue>& value);
144  ASPOSE_PDF_SHARED_API void Add(System::SharedPtr<XmpPdfAExtensionObject> xmpPdfAExtensionObject, System::String namespacePrefix, System::String namespaceUri, System::String schemaDescription);
150  ASPOSE_PDF_SHARED_API void Clear() override;
157  ASPOSE_PDF_SHARED_API void Remove(DefaultMetadataProperties key);
165  ASPOSE_PDF_SHARED_API void Add(const System::String& key, const System::SharedPtr<XmpValue>& value) override;
171  ASPOSE_PDF_SHARED_API void Add(const System::String& key, const System::SharedPtr<System::Object>& value);
179  ASPOSE_PDF_SHARED_API bool Contains(const System::String& key) const;
185  ASPOSE_PDF_SHARED_API bool Contains(const DefaultMetadataProperties& property) const;
198  ASPOSE_PDF_SHARED_API bool Remove(const System::String& key) override;
199 
207  ASPOSE_PDF_SHARED_API System::SharedPtr<XmpValue> idx_get(const System::String& key) const override;
215  ASPOSE_PDF_SHARED_API void idx_set(const System::String& key, System::SharedPtr<XmpValue> value) override;
216 
222  ASPOSE_PDF_SHARED_API void CopyTo(System::ArrayPtr<System::Collections::Generic::KeyValuePair<System::String, System::SharedPtr<XmpValue>>> array, int32_t index) override;
223 
231  ASPOSE_PDF_SHARED_API System::SharedPtr<XmpValue> idx_get(const DefaultMetadataProperties& key) const;
239  ASPOSE_PDF_SHARED_API void idx_set(const DefaultMetadataProperties& key, System::SharedPtr<XmpValue> value);
240 
247  ASPOSE_PDF_SHARED_API System::ArrayPtr<uint8_t> GetXmpMetadata();
255  ASPOSE_PDF_SHARED_API System::ArrayPtr<uint8_t> GetXmpMetadata(System::String name);
261  ASPOSE_PDF_SHARED_API bool ContainsKey(const System::String& key) const override;
268  ASPOSE_PDF_SHARED_API bool TryGetValue(const System::String& key, System::SharedPtr<XmpValue>& value) const override;
273  ASPOSE_PDF_SHARED_API void Add(const System::Collections::Generic::KeyValuePair<System::String, System::SharedPtr<XmpValue>>& item) override;
279  ASPOSE_PDF_SHARED_API bool Contains(const System::Collections::Generic::KeyValuePair<System::String, System::SharedPtr<XmpValue>>& item) const override;
285  ASPOSE_PDF_SHARED_API bool Remove(const System::Collections::Generic::KeyValuePair<System::String, System::SharedPtr<XmpValue>>& item) override;
286  ASPOSE_PDF_SHARED_API void SetTemplateWeakPtr(uint32_t argument) override;
287 
288 protected:
289 
290  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Collections::Generic::ICollection<System::String>> get_KeysInternal() const;
291  ASPOSE_PDF_SHARED_API System::SharedPtr<System::Collections::Generic::ICollection<System::SharedPtr<XmpValue>>> get_ValuesInternal() const;
292 
293  virtual ASPOSE_PDF_SHARED_API ~PdfXmpMetadata();
294 
295 private:
296 
297  static const System::String DefaultXmpNamespacePrefix;
298  static const System::String DefaultXmpNamespaceUri;
299 
308  void RegisterNamespaceURI(System::String prefix, System::String namespaceURI, System::String schemaDescription);
309  System::String getStringKey(DefaultMetadataProperties key) const;
310 
311 };
312 
313 } // namespace Facades
314 } // namespace Pdf
315 } // namespace Aspose
316 
317 
String class used across the library. Is a substitute for C# System.String when translating code...
Definition: string.h:121
Base class for all saveable facades.
Definition: Facade.h:151
Definition: Artifact.h:67
Base facade class.
Definition: Facade.h:57
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
General facade interface that defines common facades methods.
Definition: IFacade.h:33
Definition: AFRelationship.h:4
DefaultMetadataProperties
Enumeration of standard XMP properties.
Definition: DefaultMetadataProperties.h:18
Class for manipulation with XMP metadata.
Definition: PdfXmpMetadata.h:55
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.