CustomXmlPart.h
1 //////////////////////////////////////////////////////////////////////////
2 // Copyright 2001-2020 Aspose Pty Ltd. All Rights Reserved.
3 //
4 // This file is part of Aspose.Words. The source code in this file
5 // is only intended as a supplement to the documentation, and is provided
6 // "as is", without warranty of any kind, either expressed or implied.
7 //////////////////////////////////////////////////////////////////////////
8 #pragma once
9 
10 
11 #include <system/string.h>
12 #include <system/shared_ptr.h>
13 #include <system/object.h>
14 #include <system/array.h>
15 #include <cstdint>
16 
17 #include "Aspose.Words.Cpp/aspose_words_api_defs.h"
18 
19 namespace Aspose { namespace Words { namespace Validation { class CustomXmlValidator; } } }
20 namespace Aspose { namespace Words { namespace Markup { class CustomXmlSchemaCollection; } } }
21 
22 namespace Aspose {
23 
24 namespace Words {
25 
26 namespace Markup {
27 
28 
29 /// <summary>
30 /// Represents a Custom XML Data Storage Part (custom XML data within a package).
31 /// </summary>
32 /// <remarks>
33 /// <para>A DOCX or DOC document can contain one or more Custom XML Data Storage parts. Aspose.Words preserves and
34 /// allows to create and extract Custom XML Data via the <see cref="Aspose::Words::Document::get_CustomXmlParts" /> collection.</para>
35 ///
36 /// <seealso cref="Aspose::Words::Document::get_CustomXmlParts" />
37 /// <seealso cref="Aspose::Words::Markup::CustomXmlPartCollection" />
38 /// </remarks>
39 class CustomXmlPart : public System::Object
40 {
41  typedef CustomXmlPart ThisType;
42  typedef System::Object BaseType;
43 
44  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
45  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
46 
47  friend class Aspose::Words::Validation::CustomXmlValidator;
48 
49 public:
50 
51  /// <summary>
52  /// Gets or sets the string that identifies this custom XML part within an OOXML document.
53  /// </summary>
54  /// <remarks>
55  /// <para>ISO/IEC 29500 specifies that this value is a GUID, but old versions of Microsoft Word allowed any
56  /// string here. Aspose.Words does the same for ECMA-376 format. But note, that Microsoft Word Online fails
57  /// to open a document created with a non-GUID value. So, a GUID is preferred value for this property.</para>
58  ///
59  /// <para>A valid value must be an identifier that is unique among all custom XML data parts in this document.
60  /// </para>
61  ///
62  /// <para>The default value is an empty string. The value cannot be <c>null</c>.</para>
63  /// </remarks>
64  ASPOSE_WORDS_SHARED_API System::String get_Id() const;
65  /// Setter for Aspose::Words::Markup::CustomXmlPart::get_Id
66  ASPOSE_WORDS_SHARED_API void set_Id(System::String value);
67  /// <summary>
68  /// Specifies the set of XML schemas that are associated with this custom XML part.
69  /// </summary>
70  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Markup::CustomXmlSchemaCollection> get_Schemas() const;
71  /// <summary>
72  /// Gets or sets the XML content of this Custom XML Data Storage Part.
73  /// </summary>
74  /// <remarks>
75  /// <para>The default value is an empty byte array. The value cannot be <c>null</c>.</para>
76  /// </remarks>
77  ASPOSE_WORDS_SHARED_API System::ArrayPtr<uint8_t> get_Data() const;
78  /// Setter for Aspose::Words::Markup::CustomXmlPart::get_Data
79  ASPOSE_WORDS_SHARED_API void set_Data(System::ArrayPtr<uint8_t> value);
80 
81  /// <summary>
82  /// Makes a "deep enough" copy of the object.
83  /// Does not duplicate the bytes of the <see cref="Aspose::Words::Markup::CustomXmlPart::get_Data" /> value.
84  /// </summary>
85  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Markup::CustomXmlPart> Clone();
86 
87  ASPOSE_WORDS_SHARED_API CustomXmlPart();
88 
89 protected:
90 
91  bool ValidateCustomXmlData();
92  ASPOSE_WORDS_SHARED_API System::Object::shared_members_type GetSharedMembers() override;
93 
94 private:
95 
96  System::String mId;
97  System::SharedPtr<Aspose::Words::Markup::CustomXmlSchemaCollection> mSchemas;
98  System::ArrayPtr<uint8_t> mData;
99 
100 };
101 
102 }
103 }
104 }
Definition: IFontData.h:20
@ InsertLineBreaks
Insert line breaks after every 76th character.