search/mag_sel search/close
DocumentProperty.h
1 // Copyright 2001-2021 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.
9 #pragma once
10 
11 #include <system/date_time.h>
12 #include <system/array.h>
13 #include <cstdint>
14 
15 #include <Aspose.Words.Cpp/Properties/PropertyType.h>
16 #include <Aspose.Words.Cpp/aspose_words_api_defs.h>
17 
18 namespace Aspose { namespace Words { namespace Properties { class BuiltInDocumentProperties; } } }
19 namespace Aspose { namespace Words { namespace Properties { class DocumentPropertyCollection; } } }
20 namespace Aspose { namespace Words { namespace Properties { class CustomDocumentProperties; } } }
21 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Reader { class DocxCustomPropertiesReader; } } } } }
22 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Reader { class DocxReader; } } } } }
23 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Writer { class DocxCustomPropertiesWriter; } } } } }
24 namespace Aspose { namespace Words { namespace RW { namespace Doc { class DocPropertiesFiler; } } } }
25 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Reader { class HtmlReader; } } } } }
26 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtMetaWriter; } } } } }
27 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfUserPropertiesHandler; } } } } }
28 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Writer { class RtfInfoGroupWriter; } } } } }
29 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Reader { class WmlDocPropertiesReader; } } } } }
30 namespace Aspose { namespace Words { namespace RW { namespace Nrx { namespace Writer { class NrxDocPropertiesWriter; } } } } }
31 
32 namespace Aspose {
33 
34 namespace Words {
35 
36 namespace Properties {
37 
74 class ASPOSE_WORDS_SHARED_CLASS DocumentProperty : public System::Object
75 {
76  typedef DocumentProperty ThisType;
77  typedef System::Object BaseType;
78 
79  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
80  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
81 
85  friend class Aspose::Words::RW::Docx::Reader::DocxCustomPropertiesReader;
86  friend class Aspose::Words::RW::Docx::Reader::DocxReader;
87  friend class Aspose::Words::RW::Docx::Writer::DocxCustomPropertiesWriter;
88  friend class Aspose::Words::RW::Doc::DocPropertiesFiler;
89  friend class Aspose::Words::RW::Html::Reader::HtmlReader;
90  friend class Aspose::Words::RW::Odt::Writer::OdtMetaWriter;
91  friend class Aspose::Words::RW::Rtf::Reader::RtfUserPropertiesHandler;
92  friend class Aspose::Words::RW::Rtf::Writer::RtfInfoGroupWriter;
93  friend class Aspose::Words::RW::Wml::Reader::WmlDocPropertiesReader;
94  friend class Aspose::Words::RW::Nrx::Writer::NrxDocPropertiesWriter;
95 
96 public:
97 
134  ASPOSE_WORDS_SHARED_API System::String get_Name() const;
135 
172  ASPOSE_WORDS_SHARED_API System::SharedPtr<System::Object> get_Value();
173 
175  ASPOSE_WORDS_SHARED_API void set_Value(System::SharedPtr<System::Object> value);
176 
269  ASPOSE_WORDS_SHARED_API Aspose::Words::Properties::PropertyType get_Type() const;
270 
295  ASPOSE_WORDS_SHARED_API System::String get_LinkSource() const;
296 
321  ASPOSE_WORDS_SHARED_API bool get_IsLinkToContent();
322 
368  ASPOSE_WORDS_SHARED_API System::String ToString() const override;
369 
392  ASPOSE_WORDS_SHARED_API int32_t ToInt();
393 
416  ASPOSE_WORDS_SHARED_API double ToDouble();
417 
453  ASPOSE_WORDS_SHARED_API System::DateTime ToDateTime();
454 
479  ASPOSE_WORDS_SHARED_API bool ToBool();
480 
506  ASPOSE_WORDS_SHARED_API System::ArrayPtr<uint8_t> ToByteArray();
507 
508 protected:
509 
510  System::SharedPtr<System::Object> get_DefaultValueInternal() const;
511  void set_DefaultValueInternal(System::SharedPtr<System::Object> value);
512  System::SharedPtr<System::Object> get_ValueInternal() const;
513  void set_ValueInternal(System::SharedPtr<System::Object> value);
514  System::String get_LinkTarget() const;
515  void set_LinkTarget(System::String value);
516 
517  static const int32_t MinUserPropId;
518 
520 
521  MEMBER_FUNCTION_MAKE_OBJECT_DECLARATION(DocumentProperty, CODEPORTING_ARGS(System::String name, System::SharedPtr<System::Object> value));
522  void FromString(System::String value);
523  void FromInt(int32_t value);
524  void FromDouble(double value);
525  void FromDateTime(System::DateTime value);
526  void FromBool(bool value);
527  void FromByteArray(System::ArrayPtr<uint8_t> data);
529  static Aspose::Words::Properties::PropertyType GetPropertyTypeFromValue(System::SharedPtr<System::Object> value);
530  static System::SharedPtr<System::Object> GetDefaultValueForPropertyType(Aspose::Words::Properties::PropertyType propType);
531 
532 private:
533 
534  System::String mName;
536  System::String mLinkTarget;
537  System::SharedPtr<System::Object> mDefaultValueInternal;
538 
539 };
540 
541 }
542 }
543 }