BookmarkStart.h
1 //////////////////////////////////////////////////////////////////////////
2 // Copyright 2001-2019 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 <cstdint>
15 
16 #include "Aspose.Words.Cpp/Model/Revisions/DisplacedByType.h"
17 #include "Aspose.Words.Cpp/Model/Nodes/NodeType.h"
18 #include "Aspose.Words.Cpp/Model/Nodes/Node.h"
19 #include "Aspose.Words.Cpp/Model/Nodes/IDisplaceableByCustomXml.h"
20 #include "Aspose.Words.Cpp/Model/Bookmarks/IBookmarkNode.h"
21 #include "Aspose.Words.Cpp/aspose_words_api_defs.h"
22 
23 namespace Aspose { namespace Words { class NodeRange; } }
24 namespace Aspose { namespace Words { class Bookmark; } }
25 namespace Aspose { namespace Words { namespace Validation { class BookmarkValidator; } } }
26 namespace Aspose { namespace Words { class DocumentBuilder; } }
27 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfContentHandler; } } } } }
28 namespace Aspose { namespace Words { class NodeImporter; } }
29 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Writer { class DocxDocumentWriterBase; } } } } }
30 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtParagraphReader; } } } } }
31 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Reader { class DocxBookmarkReader; } } } } }
32 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Reader { class ModelBuilder; } } } } }
33 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Writer { class DocWriter; } } } } }
34 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Writer { class RtfWriter; } } } } }
35 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Reader { class WmlAnnotationReader; } } } } }
36 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Writer { class WmlWriter; } } } } }
37 namespace Aspose { namespace Words { class DocumentBase; } }
38 namespace Aspose { namespace Words { class DocumentVisitor; } }
39 
40 namespace Aspose {
41 
42 namespace Words {
43 
44 
45 /// <summary>
46 /// Represents a start of a bookmark in a Word document.
47 /// </summary>
48 /// <remarks>
49 /// <p>A complete bookmark in a Word document consists of a <see cref="Aspose::Words::BookmarkStart" />
50 /// and a matching <see cref="Aspose::Words::BookmarkEnd" /> with the same bookmark name.</p>
51 /// <p>
52 /// <see cref="Aspose::Words::BookmarkStart" /> and <see cref="Aspose::Words::BookmarkEnd" /> are just markers inside a document
53 /// that specify where the bookmark starts and ends.</p>
54 /// <p>Use the <see cref="Aspose::Words::BookmarkStart::get_Bookmark" /> class as a "facade" to work with a bookmark
55 /// as a single object.</p>
56 /// </remarks>
57 class BookmarkStart : public Aspose::Words::Node, public Aspose::Words::IBookmarkNode, public Aspose::Words::IDisplaceableByCustomXml
58 {
59  typedef BookmarkStart ThisType;
60  typedef Aspose::Words::Node BaseType;
61  typedef Aspose::Words::IBookmarkNode BaseType1;
62  typedef Aspose::Words::IDisplaceableByCustomXml BaseType2;
63 
64  typedef ::System::BaseTypesInfo<BaseType, BaseType1, BaseType2> ThisTypeBaseTypesInfo;
65  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
66 
68  friend class Aspose::Words::NodeRange;
69  friend class Aspose::Words::Bookmark;
70  friend class Aspose::Words::Validation::BookmarkValidator;
71  friend class Aspose::Words::DocumentBuilder;
72  friend class Aspose::Words::RW::Rtf::Reader::RtfContentHandler;
73  friend class Aspose::Words::NodeImporter;
74  friend class Aspose::Words::RW::Docx::Writer::DocxDocumentWriterBase;
75  friend class Aspose::Words::RW::Odt::Reader::OdtParagraphReader;
76  friend class Aspose::Words::RW::Docx::Reader::DocxBookmarkReader;
77  friend class Aspose::Words::RW::Doc::Reader::ModelBuilder;
78  friend class Aspose::Words::RW::Doc::Writer::DocWriter;
79  friend class Aspose::Words::RW::Rtf::Writer::RtfWriter;
80  friend class Aspose::Words::RW::Wml::Reader::WmlAnnotationReader;
81  friend class Aspose::Words::RW::Wml::Writer::WmlWriter;
82 
83 public:
84 
85  /// <summary>
86  /// Returns <see cref="Aspose::Words::NodeType::BookmarkStart" />.
87  /// </summary>
88  virtual ASPOSE_WORDS_SHARED_API Aspose::Words::NodeType get_NodeType() const;
89  /// <summary>
90  /// Gets the facade object that encapsulates this bookmark start and end.
91  /// </summary>
92  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Bookmark> get_Bookmark();
93  ASPOSE_WORDS_SHARED_API Aspose::Words::Revisions::DisplacedByType get_DisplacedByCustomXml();
94  ASPOSE_WORDS_SHARED_API void set_DisplacedByCustomXml(Aspose::Words::Revisions::DisplacedByType value);
95  /// <summary>
96  /// Gets or sets the bookmark name.
97  /// </summary>
98  /// <remarks>
99  /// <para>Cannot be null.</para>
100  /// </remarks>
101  ASPOSE_WORDS_SHARED_API System::String get_Name();
102  /// Setter for Aspose::Words::BookmarkStart::get_Name
103  ASPOSE_WORDS_SHARED_API void set_Name(System::String value);
104 
105  /// <summary>
106  /// Initializes a new instance of the <see cref="Aspose::Words::BookmarkStart" /> class.
107  /// </summary>
108  /// <param name="doc">The owner document.</param>
109  /// <param name="name">The name of the bookmark. Cannot be null.</param>
110  ASPOSE_WORDS_SHARED_API BookmarkStart(System::SharedPtr<Aspose::Words::DocumentBase> doc, System::String name);
111 
112  /// <summary>
113  /// Accepts a visitor.
114  /// </summary>
115  /// <remarks>
116  /// <p>Calls <see cref="Aspose::Words::DocumentVisitor::VisitBookmarkStart(System::SharedPtr&lt;Aspose::Words::BookmarkStart&gt;)" />.</p>
117  /// <p>For more info see the Visitor design pattern.</p>
118  /// </remarks>
119  /// <param name="visitor">The visitor that will visit the node.</param>
120  /// <returns>False if the visitor requested the enumeration to stop.</returns>
121  virtual ASPOSE_WORDS_SHARED_API bool Accept(System::SharedPtr<Aspose::Words::DocumentVisitor> visitor);
122  /// <summary>
123  /// Returns an empty string.
124  /// </summary>
125  /// <returns>An empty string.</returns>
126  virtual ASPOSE_WORDS_SHARED_API System::String GetText();
127 
128 protected:
129 
130  int32_t get_Flags() const;
131  bool get_IsColumn();
132  int32_t get_FirstColumn();
133  void set_FirstColumn(int32_t value);
134  int32_t get_LastColumn();
135  void set_LastColumn(int32_t value);
136  Aspose::Words::Revisions::DisplacedByType get_DisplacedBy() const;
137  void set_DisplacedBy(Aspose::Words::Revisions::DisplacedByType value);
138 
139  BookmarkStart(System::SharedPtr<Aspose::Words::DocumentBase> doc);
140  BookmarkStart(System::SharedPtr<Aspose::Words::DocumentBase> doc, System::String name, int32_t flags);
141 
142  System::String GetNameInternal();
143  void SetNameInternal(System::String name);
144  ASPOSE_WORDS_SHARED_API System::Object::shared_members_type GetSharedMembers() override;
145 
146 private:
147 
148  System::String mName;
149  int32_t mFlags;
150  Aspose::Words::Revisions::DisplacedByType mDisplacedBy;
151 
152  ThisType* CppMemberwiseClone() ASPOSE_CONST override { return new ThisType(*this); }
153 
154 };
155 
156 }
157 }
Definition: IFontData.h:19
Insert line breaks after every 76th character.
#define ASPOSE_CONST
Makes methods labelled as ASPOSE_CONST const.
Definition: defines.h:43
#define FRIEND_FUNCTION_System_MakeObject
Macro to befriend MakeObject function.
Definition: smart_ptr.h:1366