BookmarkStart.h
1 #pragma once
2 // Copyright (c) 2001-2020 Aspose Pty Ltd. All Rights Reserved.
3 // 11/07/2005 by Roman Korchagin
4 
5 #include <system/string.h>
6 #include <system/shared_ptr.h>
7 #include <system/object.h>
8 #include <cstdint>
9 
10 #include "Aspose.Words.Cpp/Model/Revisions/DisplacedByType.h"
11 #include "Aspose.Words.Cpp/Model/Nodes/NodeType.h"
12 #include "Aspose.Words.Cpp/Model/Nodes/Node.h"
13 #include "Aspose.Words.Cpp/Model/Nodes/IDisplaceableByCustomXml.h"
14 #include "Aspose.Words.Cpp/Model/Bookmarks/IBookmarkNode.h"
15 #include "Aspose.Words.Cpp/aspose_words_api_defs.h"
16 
17 namespace Aspose { namespace Words { class NodeRange; } }
18 namespace Aspose { namespace Words { class Bookmark; } }
19 namespace Aspose { namespace Words { namespace Validation { class BookmarkValidator; } } }
20 namespace Aspose { namespace Words { class DocumentBuilder; } }
21 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfContentHandler; } } } } }
22 namespace Aspose { namespace Words { class NodeImporter; } }
23 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Writer { class DocxDocumentWriterBase; } } } } }
24 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtParagraphReader; } } } } }
25 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Reader { class DocxBookmarkReader; } } } } }
26 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Reader { class ModelBuilder; } } } } }
27 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Writer { class DocWriter; } } } } }
28 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Writer { class RtfWriter; } } } } }
29 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Reader { class WmlAnnotationReader; } } } } }
30 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Writer { class WmlWriter; } } } } }
31 namespace Aspose { namespace Words { class DocumentBase; } }
32 namespace Aspose { namespace Words { class DocumentVisitor; } }
33 
34 namespace Aspose {
35 
36 namespace Words {
37 
38 /// <summary>
39 /// Represents a start of a bookmark in a Word document.
40 /// </summary>
41 /// <remarks>
42 /// <p>A complete bookmark in a Word document consists of a <see cref="BookmarkStart"/>
43 /// and a matching <see cref="BookmarkEnd"/> with the same bookmark name.</p>
44 ///
45 /// <p><see cref="BookmarkStart"/> and <see cref="BookmarkEnd"/> are just markers inside a document
46 /// that specify where the bookmark starts and ends.</p>
47 ///
48 /// <p>Use the <see cref="Bookmark"/> class as a "facade" to work with a bookmark
49 /// as a single object.</p>
50 /// </remarks>
52 {
53  typedef BookmarkStart ThisType;
54  typedef Aspose::Words::Node BaseType;
55  typedef Aspose::Words::IBookmarkNode BaseType1;
56  typedef Aspose::Words::IDisplaceableByCustomXml BaseType2;
57 
58  typedef ::System::BaseTypesInfo<BaseType, BaseType1, BaseType2> ThisTypeBaseTypesInfo;
60 
62  friend class Aspose::Words::NodeRange;
63  friend class Aspose::Words::Bookmark;
64  friend class Aspose::Words::Validation::BookmarkValidator;
65  friend class Aspose::Words::DocumentBuilder;
66  friend class Aspose::Words::RW::Rtf::Reader::RtfContentHandler;
67  friend class Aspose::Words::NodeImporter;
68  friend class Aspose::Words::RW::Docx::Writer::DocxDocumentWriterBase;
69  friend class Aspose::Words::RW::Odt::Reader::OdtParagraphReader;
70  friend class Aspose::Words::RW::Docx::Reader::DocxBookmarkReader;
71  friend class Aspose::Words::RW::Doc::Reader::ModelBuilder;
72  friend class Aspose::Words::RW::Doc::Writer::DocWriter;
73  friend class Aspose::Words::RW::Rtf::Writer::RtfWriter;
74  friend class Aspose::Words::RW::Wml::Reader::WmlAnnotationReader;
75  friend class Aspose::Words::RW::Wml::Writer::WmlWriter;
76 
77 public:
78 
81  ASPOSE_WORDS_SHARED_API Aspose::Words::Revisions::DisplacedByType get_DisplacedByCustomXml();
82  ASPOSE_WORDS_SHARED_API void set_DisplacedByCustomXml(Aspose::Words::Revisions::DisplacedByType value);
84  ASPOSE_WORDS_SHARED_API void set_Name(System::String value);
85 
87 
88  virtual ASPOSE_WORDS_SHARED_API bool Accept(System::SharedPtr<Aspose::Words::DocumentVisitor> visitor);
89  virtual ASPOSE_WORDS_SHARED_API System::String GetText();
90 
91 protected:
92 
93  int32_t get_Flags() const;
94  bool get_IsColumn();
95  int32_t get_FirstColumn();
96  void set_FirstColumn(int32_t value);
97  int32_t get_LastColumn();
98  void set_LastColumn(int32_t value);
99  Aspose::Words::Revisions::DisplacedByType get_DisplacedBy() const;
100  void set_DisplacedBy(Aspose::Words::Revisions::DisplacedByType value);
101 
102  BookmarkStart(System::SharedPtr<Aspose::Words::DocumentBase> doc);
103  BookmarkStart(System::SharedPtr<Aspose::Words::DocumentBase> doc, System::String name, int32_t flags);
104 
105  System::String GetNameInternal();
106  void SetNameInternal(System::String name);
107 
108  virtual ASPOSE_WORDS_SHARED_API ~BookmarkStart();
109 
110  ASPOSE_WORDS_SHARED_API System::Object::shared_members_type GetSharedMembers() override;
111 
112 private:
113 
114  System::String mName;
115  int32_t mFlags;
116  Aspose::Words::Revisions::DisplacedByType mDisplacedBy;
117 
118  ThisType* CppMemberwiseClone() ASPOSE_CONST override { return new ThisType(*this); }
119 
120 };
121 
122 } // namespace Words
123 } // namespace Aspose
virtual bool Accept(System::SharedPtr< Aspose::Words::DocumentVisitor > visitor)
Base class for all nodes of a Word document.
Definition: Node.h:202
Aspose::Words::Revisions::DisplacedByType get_DisplacedByCustomXml()
Definition: Hyphenation.h:12
Definition: Hyphenation.h:12
Common interface for nodes which position can be displaced by custom XML (structured document tag).
Definition: IDisplaceableByCustomXml.h:17
Represents a single bookmark.
Definition: Bookmark.h:46
BookmarkStart(System::SharedPtr< Aspose::Words::DocumentBase > doc, System::String name)
void set_DisplacedByCustomXml(Aspose::Words::Revisions::DisplacedByType value)
@ InsertLineBreaks
Insert line breaks after every 76th character.
Provides the abstract base class for a main document and a glossary document of a Word document.
Definition: DocumentBase.h:203
Allows to efficiently perform repeated import of nodes from one document to another.
Definition: NodeImporter.h:90
#define ASPOSE_WORDS_SHARED_API
Definition: aspose_words_api_defs.h:3
#define ASPOSE_CONST
Makes methods labelled as ASPOSE_CONST const.
Definition: defines.h:43
void set_Name(System::String value)
System::Details::SharedMembersType shared_members_type
structure to keep list of shared pointers contained in object.
Definition: object.h:68
System::String get_Name()
Provides methods to insert text, images and other content, specify font, paragraph and section format...
Definition: DocumentBuilder.h:128
NodeType
Specifies the type of a Word document node.
Definition: NodeType.h:21
Common interface for BookmarkStart and BookmarkEnd.
Definition: IBookmarkNode.h:15
virtual Aspose::Words::NodeType get_NodeType() const
#define FRIEND_FUNCTION_System_MakeObject
Macro to befriend MakeObject function.
Definition: smart_ptr.h:1366
Base class for custom document visitors.
Definition: DocumentVisitor.h:83
#define ASPOSE_WORDS_SHARED_RTTI_INFO_DECL()
Definition: aspose_words_api_defs.h:5
Represents a start of a bookmark in a Word document.
Definition: BookmarkStart.h:51
System::SharedPtr< Aspose::Words::Bookmark > get_Bookmark()
virtual System::String GetText()