BuiltInDocumentProperties.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/enum_helpers.h>
15 #include <system/date_time.h>
16 #include <system/array.h>
17 #include <mutex>
18 #include <memory>
19 #include <cstdint>
20 
21 #include "Aspose.Words.Cpp/Model/Properties/DocumentSecurity.h"
22 #include "Aspose.Words.Cpp/Model/Properties/DocumentPropertyCollection.h"
23 #include "Aspose.Words.Cpp/aspose_words_api_defs.h"
24 
25 namespace Aspose { namespace Words { namespace ApsBuilder { namespace Dml { namespace Text { class DmlTextShapeToShapeConvertor; } } } } }
26 namespace Aspose { namespace Words { namespace RW { namespace Dml { namespace Reader { class DmlChartAxisReader; } } } } }
27 namespace Aspose { namespace Words { namespace Drawing { namespace Charts { namespace Core { class DmlChartSpace; } } } } }
28 namespace Aspose { namespace Words { class Document; } }
29 namespace Aspose { namespace Words { namespace Validation { class DocumentValidator; } } }
30 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtMetaReader; } } } } }
31 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Reader { class DocxExtentedPropertiesReader; } } } } }
32 namespace Aspose { namespace Words { namespace RW { namespace Doc { class DocPropertiesFiler; } } } }
33 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Reader { class Parser; } } } } }
34 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfInfoGroupHandler; } } } } }
35 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Reader { class WmlDocPropertiesReader; } } } } }
36 namespace Aspose { namespace Words { namespace Model { namespace Nrx { class Hlinks; } } } }
37 namespace Aspose { namespace Collections { class StringToStringDictionary; } }
38 namespace Aspose { namespace Collections { class StringToIntDictionary; } }
39 namespace Aspose { namespace Words { namespace Properties { class DocumentProperty; } } }
40 
41 namespace Aspose {
42 
43 namespace Words {
44 
45 namespace Properties {
46 
47 
48 /// <summary>
49 /// A collection of built-in document properties.
50 /// </summary>
51 /// <remarks>
52 /// <para>Provides access to <see cref="Aspose::Words::Properties::DocumentProperty" /> objects by their names (using an indexer) and
53 /// via a set of typed properties that return values of appropriate types.</para>
54 ///
55 /// <seealso cref="Aspose::Words::Document" />
56 /// <seealso cref="Aspose::Words::Document::get_BuiltInDocumentProperties" />
57 /// <seealso cref="Aspose::Words::Document::get_CustomDocumentProperties" />
58 /// </remarks>
59 /// <remarks>
60 /// <p>The names of the properties are case-insensitive.</p>
61 /// <p>The properties in the collection are sorted alphabetically by name.</p>
62 /// </remarks>
63 class BuiltInDocumentProperties : public Aspose::Words::Properties::DocumentPropertyCollection
64 {
65  typedef BuiltInDocumentProperties ThisType;
66  typedef Aspose::Words::Properties::DocumentPropertyCollection BaseType;
67 
68  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
69  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
70 
72  friend class Aspose::Words::ApsBuilder::Dml::Text::DmlTextShapeToShapeConvertor;
73  friend class Aspose::Words::RW::Dml::Reader::DmlChartAxisReader;
74  friend class Aspose::Words::Drawing::Charts::Core::DmlChartSpace;
75  friend class Aspose::Words::Document;
76  friend class Aspose::Words::Validation::DocumentValidator;
77  friend class Aspose::Words::RW::Odt::Reader::OdtMetaReader;
78  friend class Aspose::Words::RW::Docx::Reader::DocxExtentedPropertiesReader;
79  friend class Aspose::Words::RW::Doc::DocPropertiesFiler;
80  friend class Aspose::Words::RW::Doc::Reader::Parser;
81  friend class Aspose::Words::RW::Rtf::Reader::RtfInfoGroupHandler;
82  friend class Aspose::Words::RW::Wml::Reader::WmlDocPropertiesReader;
83 
84 public:
85  using Aspose::Words::Properties::DocumentPropertyCollection::idx_get;
86 
87 public:
88 
89  /// <summary>
90  /// Gets or sets the name of the document's author.
91  /// </summary>
92  ASPOSE_WORDS_SHARED_API System::String get_Author();
93  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Author
94  ASPOSE_WORDS_SHARED_API void set_Author(System::String value);
95  /// <summary>
96  /// Represents an estimate of the number of bytes in the document.
97  /// </summary>
98  /// <remarks>
99  /// <para>Microsoft Word does not always set this property.</para>
100  ///
101  /// <para>Aspose.Words does not update this property.</para>
102  /// </remarks>
103  ASPOSE_WORDS_SHARED_API int32_t get_Bytes();
104  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Bytes
105  ASPOSE_WORDS_SHARED_API void set_Bytes(int32_t value);
106  /// <summary>
107  /// Represents an estimate of the number of characters in the document.
108  /// </summary>
109  /// <remarks>
110  /// <para>Aspose.Words updates this property when you call <see cref="Aspose::Words::Document::UpdateWordCount" />.</para>
111  /// </remarks>
112  ASPOSE_WORDS_SHARED_API int32_t get_Characters();
113  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Characters
114  ASPOSE_WORDS_SHARED_API void set_Characters(int32_t value);
115  /// <summary>
116  /// Represents an estimate of the number of characters (including spaces) in the document.
117  /// </summary>
118  /// <remarks>
119  /// <para>Aspose.Words updates this property when you call <see cref="Aspose::Words::Document::UpdateWordCount" />.</para>
120  /// </remarks>
121  ASPOSE_WORDS_SHARED_API int32_t get_CharactersWithSpaces();
122  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_CharactersWithSpaces
123  ASPOSE_WORDS_SHARED_API void set_CharactersWithSpaces(int32_t value);
124  /// <summary>
125  /// Gets or sets the document comments.
126  /// </summary>
127  ASPOSE_WORDS_SHARED_API System::String get_Comments();
128  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Comments
129  ASPOSE_WORDS_SHARED_API void set_Comments(System::String value);
130  /// <summary>
131  /// Gets or sets the category of the document.
132  /// </summary>
133  ASPOSE_WORDS_SHARED_API System::String get_Category();
134  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Category
135  ASPOSE_WORDS_SHARED_API void set_Category(System::String value);
136  /// <summary>
137  /// Gets or sets the company property.
138  /// </summary>
139  ASPOSE_WORDS_SHARED_API System::String get_Company();
140  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Company
141  ASPOSE_WORDS_SHARED_API void set_Company(System::String value);
142  /// <summary>
143  /// Gets or sets date of the document creation in UTC.
144  /// </summary>
145  /// <remarks>
146  /// <para>For documents originated from RTF format this property returns local time of the author's machine at the moment of document creation.</para>
147  /// <para>Aspose.Words does not update this property.</para>
148  /// </remarks>
149  ASPOSE_WORDS_SHARED_API System::DateTime get_CreatedTime();
150  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_CreatedTime
151  ASPOSE_WORDS_SHARED_API void set_CreatedTime(System::DateTime value);
152  /// <summary>
153  /// Specifies the base string used for evaluating relative hyperlinks in this document.
154  /// </summary>
155  /// <remarks>
156  /// <para>Aspose.Words does not use this property.</para>
157  /// </remarks>
158  ASPOSE_WORDS_SHARED_API System::String get_HyperlinkBase();
159  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_HyperlinkBase
160  ASPOSE_WORDS_SHARED_API void set_HyperlinkBase(System::String value);
161  /// <summary>
162  /// Gets or sets the document keywords.
163  /// </summary>
164  ASPOSE_WORDS_SHARED_API System::String get_Keywords();
165  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Keywords
166  ASPOSE_WORDS_SHARED_API void set_Keywords(System::String value);
167  /// <summary>
168  /// Gets or sets the date when the document was last printed in UTC.
169  /// </summary>
170  /// <remarks>
171  /// <para>For documents originated from RTF format this property returns the local time of last print operation.</para>
172  /// <para>If the document was never printed, this property will return DateTime.MinValue.</para>
173  ///
174  /// <para>Aspose.Words does not update this property.</para>
175  /// </remarks>
176  ASPOSE_WORDS_SHARED_API System::DateTime get_LastPrinted();
177  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_LastPrinted
178  ASPOSE_WORDS_SHARED_API void set_LastPrinted(System::DateTime value);
179  /// <summary>
180  /// Gets or sets the name of the last author.
181  /// </summary>
182  /// <remarks>
183  /// <para>Aspose.Words does not update this property.</para>
184  /// </remarks>
185  ASPOSE_WORDS_SHARED_API System::String get_LastSavedBy();
186  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_LastSavedBy
187  ASPOSE_WORDS_SHARED_API void set_LastSavedBy(System::String value);
188  /// <summary>
189  /// Gets or sets the time of the last save in UTC.
190  /// </summary>
191  /// <remarks>
192  /// <para>For documents originated from RTF format this property returns the local time of last save operation.</para>
193  /// <para>Aspose.Words does not update this property.</para>
194  /// </remarks>
195  ASPOSE_WORDS_SHARED_API System::DateTime get_LastSavedTime();
196  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_LastSavedTime
197  ASPOSE_WORDS_SHARED_API void set_LastSavedTime(System::DateTime value);
198  /// <summary>
199  /// Represents an estimate of the number of lines in the document.
200  /// </summary>
201  /// <remarks>
202  /// <para>Aspose.Words updates this property when you call <see cref="Aspose::Words::Document::UpdateWordCount(bool)" />.</para>
203  /// </remarks>
204  ASPOSE_WORDS_SHARED_API int32_t get_Lines();
205  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Lines
206  ASPOSE_WORDS_SHARED_API void set_Lines(int32_t value);
207  /// <summary>
208  /// Indicates whether hyperlinks in a document are up-to-date.
209  /// </summary>
210  /// <remarks>
211  /// <para>Aspose.Words does not update this property.</para>
212  /// </remarks>
213  ASPOSE_WORDS_SHARED_API bool get_LinksUpToDate();
214  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_LinksUpToDate
215  ASPOSE_WORDS_SHARED_API void set_LinksUpToDate(bool value);
216  /// <summary>
217  /// Gets or sets the manager property.
218  /// </summary>
219  ASPOSE_WORDS_SHARED_API System::String get_Manager();
220  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Manager
221  ASPOSE_WORDS_SHARED_API void set_Manager(System::String value);
222  /// <summary>
223  /// Gets or sets the name of the application.
224  /// </summary>
225  ASPOSE_WORDS_SHARED_API System::String get_NameOfApplication();
226  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_NameOfApplication
227  ASPOSE_WORDS_SHARED_API void set_NameOfApplication(System::String value);
228  /// <summary>
229  /// Represents an estimate of the number of pages in the document.
230  /// </summary>
231  /// <remarks>
232  /// <para>Aspose.Words updates this property when you call <see cref="Aspose::Words::Document::UpdatePageLayout" />.</para>
233  /// </remarks>
234  ASPOSE_WORDS_SHARED_API int32_t get_Pages();
235  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Pages
236  ASPOSE_WORDS_SHARED_API void set_Pages(int32_t value);
237  /// <summary>
238  /// Represents an estimate of the number of paragraphs in the document.
239  /// </summary>
240  /// <remarks>
241  /// <para>Aspose.Words updates this property when you call <see cref="Aspose::Words::Document::UpdateWordCount" />.</para>
242  /// </remarks>
243  ASPOSE_WORDS_SHARED_API int32_t get_Paragraphs();
244  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Paragraphs
245  ASPOSE_WORDS_SHARED_API void set_Paragraphs(int32_t value);
246  /// <summary>
247  /// Gets or sets the document revision number.
248  /// </summary>
249  /// <remarks>
250  /// <para>Aspose.Words does not update this property.</para>
251  /// </remarks>
252  ASPOSE_WORDS_SHARED_API int32_t get_RevisionNumber();
253  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_RevisionNumber
254  ASPOSE_WORDS_SHARED_API void set_RevisionNumber(int32_t value);
255  /// <summary>
256  /// Specifies the security level of a document as a numeric value.
257  /// </summary>
258  /// <remarks>
259  /// <para>Use this property for informational purposes only because Microsoft Word does not always
260  /// set this property. This property is available in DOC and OOXML documents only.</para>
261  ///
262  /// <para>To protect or unprotect a document use the
263  /// <see cref="Aspose::Words::Document::Protect(Aspose::Words::ProtectionType, System::String)" /> and <see cref="Aspose::Words::Document::Unprotect" /> methods.</para>
264  ///
265  /// <para>Aspose.Words updates this property to a correct value before saving a document.</para>
266  /// </remarks>
267  ASPOSE_WORDS_SHARED_API Aspose::Words::Properties::DocumentSecurity get_Security();
268  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Security
269  ASPOSE_WORDS_SHARED_API void set_Security(Aspose::Words::Properties::DocumentSecurity value);
270  /// <summary>
271  /// Gets or sets the subject of the document.
272  /// </summary>
273  ASPOSE_WORDS_SHARED_API System::String get_Subject();
274  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Subject
275  ASPOSE_WORDS_SHARED_API void set_Subject(System::String value);
276  /// <summary>
277  /// Gets or sets the informational name of the document template.
278  /// </summary>
279  /// <remarks>
280  /// <para>In Microsoft Word, this property is for informational purposes only and
281  /// usually contains only the file name of the template without the path.</para>
282  ///
283  /// <para>Empty string means the document is attached to the Normal template.</para>
284  ///
285  /// <para>To get or set the actual name of the attached template, use the
286  /// <see cref="Aspose::Words::Document::get_AttachedTemplate" /> property.</para>
287  ///
288  /// <seealso cref="Aspose::Words::Document::get_AttachedTemplate" />
289  /// </remarks>
290  ASPOSE_WORDS_SHARED_API System::String get_Template();
291  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Template
292  ASPOSE_WORDS_SHARED_API void set_Template(System::String value);
293  /// <summary>
294  /// <para>Gets or sets the thumbnail of the document.</para>
295  /// </summary>
296  /// <remarks>
297  /// <para>For now this property is used only when a document is being exported to ePub,
298  /// it's not read from and written to other document formats.</para>
299  ///
300  /// <para>Image of arbitrary format can be set to this property, but the format is checked during export.
301  /// <see cref="System::InvalidOperationException" /> is thrown if the image is invalid or its format is unsupported for
302  /// specific format of document.</para>
303  ///
304  /// <para>Only gif, jpeg and png images can be used for ePub publication.</para>
305  /// </remarks>
306  ASPOSE_WORDS_SHARED_API System::ArrayPtr<uint8_t> get_Thumbnail();
307  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Thumbnail
308  ASPOSE_WORDS_SHARED_API void set_Thumbnail(System::ArrayPtr<uint8_t> value);
309  /// <summary>
310  /// Gets or sets the title of the document.
311  /// </summary>
312  ASPOSE_WORDS_SHARED_API System::String get_Title();
313  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Title
314  ASPOSE_WORDS_SHARED_API void set_Title(System::String value);
315  /// <summary>
316  /// Gets or sets the total editing time in minutes.
317  /// </summary>
318  ASPOSE_WORDS_SHARED_API int32_t get_TotalEditingTime();
319  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_TotalEditingTime
320  ASPOSE_WORDS_SHARED_API void set_TotalEditingTime(int32_t value);
321  /// <summary>
322  /// Gets or sets the ContentStatus of the document.
323  /// </summary>
324  ASPOSE_WORDS_SHARED_API System::String get_ContentType();
325  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_ContentType
326  ASPOSE_WORDS_SHARED_API void set_ContentType(System::String value);
327  /// <summary>
328  /// Gets or sets the ContentStatus of the document.
329  /// </summary>
330  ASPOSE_WORDS_SHARED_API System::String get_ContentStatus();
331  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_ContentStatus
332  ASPOSE_WORDS_SHARED_API void set_ContentStatus(System::String value);
333  /// <summary>
334  /// Represents the version number of the application that created the document.
335  /// </summary>
336  /// <remarks>
337  /// <para>When a document was created by Microsoft Word, then high 16 bit represent
338  /// the major version and low 16 bit represent the build number.</para>
339  /// </remarks>
340  ASPOSE_WORDS_SHARED_API int32_t get_Version();
341  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Version
342  ASPOSE_WORDS_SHARED_API void set_Version(int32_t value);
343  /// <summary>
344  /// Represents an estimate of the number of words in the document.
345  /// </summary>
346  /// <remarks>
347  /// <para>Aspose.Words updates this property when you call <see cref="Aspose::Words::Document::UpdateWordCount" />.</para>
348  /// </remarks>
349  ASPOSE_WORDS_SHARED_API int32_t get_Words();
350  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_Words
351  ASPOSE_WORDS_SHARED_API void set_Words(int32_t value);
352  /// <summary>
353  /// Specifies document headings and their names.
354  /// </summary>
355  /// <remarks>
356  /// <para>Every heading pair occupies two elements in this array.</para>
357  ///
358  /// <para>The first element of the pair is a <see cref="System::String" /> and specifies the heading name.
359  /// The second element of the pair is an <see cref="System::Int32" /> and specifies the count of document
360  /// parts for this heading in the <see cref="Aspose::Words::Properties::BuiltInDocumentProperties::get_TitlesOfParts" /> property.</para>
361  ///
362  /// <para>The total sum of counts for all heading pairs in this property must be equal to the
363  /// number of elements in the <see cref="Aspose::Words::Properties::BuiltInDocumentProperties::get_TitlesOfParts" /> property.</para>
364  ///
365  /// <para>Aspose.Words does not update this property.</para>
366  ///
367  /// <seealso cref="Aspose::Words::Properties::BuiltInDocumentProperties::get_TitlesOfParts" />
368  /// </remarks>
369  ASPOSE_WORDS_SHARED_API System::ArrayPtr<System::SharedPtr<System::Object>> get_HeadingPairs();
370  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_HeadingPairs
371  ASPOSE_WORDS_SHARED_API void set_HeadingPairs(System::ArrayPtr<System::SharedPtr<System::Object>> value);
372  /// <summary>
373  /// Each string in the array specifies the name of a part in the document.
374  /// </summary>
375  /// <remarks>
376  /// <para>Aspose.Words does not update this property.</para>
377  ///
378  /// <seealso cref="Aspose::Words::Properties::BuiltInDocumentProperties::get_HeadingPairs" />
379  /// </remarks>
380  ASPOSE_WORDS_SHARED_API System::ArrayPtr<System::String> get_TitlesOfParts();
381  /// Setter for Aspose::Words::Properties::BuiltInDocumentProperties::get_TitlesOfParts
382  ASPOSE_WORDS_SHARED_API void set_TitlesOfParts(System::ArrayPtr<System::String> value);
383 
384  ///
385  /// <summary>
386  /// Returns a <see cref="Aspose::Words::Properties::DocumentProperty" /> object by the name of the property.
387  /// </summary>
388  /// <remarks>
389  /// <para>The string names of the properties correspond to the names of the typed
390  /// properties available from <see cref="Aspose::Words::Properties::BuiltInDocumentProperties" />.</para>
391  ///
392  /// <para>If you request a property that is not present in the document, but the name
393  /// of the property is recognized as a valid built-in name, a new <see cref="Aspose::Words::Properties::DocumentProperty" />
394  /// is created, added to the collection and returned. The newly created property is assigned
395  /// a default value (empty string, zero, false or DateTime.MinValue depending on the type
396  /// of the built-in property).</para>
397  ///
398  /// <para>If you request a property that is not present in the document and the name
399  /// is not recognized as a built-in name, a null is returned.</para>
400  /// </remarks>
401  /// <param name="name">The case-insensitive name of the property to retrieve.</param>
402  virtual ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Properties::DocumentProperty> idx_get(System::String name);
403 
404 protected:
405 
406  bool get_IsWord2007OrLower();
407 
408  System::SharedPtr<Aspose::Words::Model::Nrx::Hlinks> Hlinks;
409 
410  BuiltInDocumentProperties();
411 
412  void SetTotalEditingTimeSafe(int32_t value);
413  void TrimSpaces();
414  virtual ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Properties::DocumentPropertyCollection> Create();
415 
416  virtual ASPOSE_WORDS_SHARED_API ~BuiltInDocumentProperties();
417 
418  ASPOSE_WORDS_SHARED_API System::Object::shared_members_type GetSharedMembers() override;
419 
420 private:
421 
422  static System::SharedPtr<Aspose::Collections::StringToStringDictionary>& gOldNameToNewName();
423  static System::SharedPtr<Aspose::Collections::StringToIntDictionary>& gNameToPropertyType();
424  static System::String MakeEmptyStringIfAllSpaces(System::String value);
425 
426  static void __StaticConstructor__();
427 
428 };
429 
430 }
431 }
432 }
Definition: IFontData.h:20
@ InsertLineBreaks
Insert line breaks after every 76th character.
Definition: Border.h:65
#define FRIEND_FUNCTION_System_MakeObject
Macro to befriend MakeObject function.
Definition: smart_ptr.h:1366
System::ArrayPtr< uint8_t > ToByteArray()
Returns the property value as byte array.