Range.h
1 // 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.
9 #pragma once
10 
11 #include <system/text/regularexpressions/regex.h>
12 #include <system/string.h>
13 #include <system/shared_ptr.h>
14 #include <system/object.h>
15 #include <cstdint>
16 
17 #include "Aspose.Words.Cpp/aspose_words_api_defs.h"
18 
19 namespace Aspose { namespace Words { class Node; } }
20 namespace Aspose { namespace Words { class RangeDocumentBuilder; } }
21 namespace Aspose { namespace Words { namespace Fields { class FormFieldCollection; } } }
22 namespace Aspose { namespace Words { class BookmarkCollection; } }
23 namespace Aspose { namespace Words { namespace Fields { class FieldCollection; } } }
24 namespace Aspose { namespace Words { namespace Replacing { class FindReplaceOptions; } } }
25 namespace Aspose { namespace Words { class Document; } }
26 
27 namespace Aspose {
28 
29 namespace Words {
30 
55 class ASPOSE_WORDS_SHARED_CLASS Range : public System::Object
56 {
57  typedef Range ThisType;
58  typedef System::Object BaseType;
59 
60  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
61  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
62 
63  FRIEND_FUNCTION_System_MakeObject;
64  friend class Aspose::Words::Node;
65  friend class Aspose::Words::RangeDocumentBuilder;
66 
67 public:
68 
84  ASPOSE_WORDS_SHARED_API System::String get_Text();
91 
115  ASPOSE_WORDS_SHARED_API void Delete();
135  ASPOSE_WORDS_SHARED_API int32_t Replace(System::String pattern, System::String replacement);
153  ASPOSE_WORDS_SHARED_API int32_t Replace(System::SharedPtr<System::Text::RegularExpressions::Regex> pattern, System::String replacement);
242  ASPOSE_WORDS_SHARED_API int32_t Replace(System::String pattern, System::String replacement, System::SharedPtr<Aspose::Words::Replacing::FindReplaceOptions> options);
319  ASPOSE_WORDS_SHARED_API void UpdateFields();
337  ASPOSE_WORDS_SHARED_API void UnlinkFields();
344  ASPOSE_WORDS_SHARED_API void NormalizeFieldTypes();
347 
348 protected:
349 
351  int32_t get_DocumentChangeCount() const;
352 
354 
355  virtual ASPOSE_WORDS_SHARED_API ~Range();
356 
357  ASPOSE_WORDS_SHARED_API System::Object::shared_members_type GetSharedMembers() override;
358 
359 private:
360 
365  int32_t mDocumentChangeCount;
366 
367 };
368 
369 }
370 }
System::Details::SharedMembersType shared_members_type
void NormalizeFieldTypes()
Changes field type values FieldType of FieldStart, FieldSeparator, FieldEnd in this range so that the...
Base class for all nodes of a Word document.
Definition: Node.h:287
int32_t Replace(System::SharedPtr< System::Text::RegularExpressions::Regex > pattern, System::String replacement, System::SharedPtr< Aspose::Words::Replacing::FindReplaceOptions > options)
Replaces all occurrences of a character pattern specified by a regular expression with another string...
int32_t Replace(System::SharedPtr< System::Text::RegularExpressions::Regex > pattern, System::String replacement)
Replaces all occurrences of a character pattern specified by a regular expression with another string...
Represents a contiguous area in a document.
Definition: Range.h:56
void UpdateFields()
Updates the values of document fields in this range.
System::SharedPtr< Aspose::Words::BookmarkCollection > get_Bookmarks()
Returns a Bookmarks collection that represents all bookmarks in the range.
int32_t Replace(System::String pattern, System::String replacement)
Replaces all occurrences of a character pattern specified by a regular expression with another string...
System::SharedPtr< Aspose::Words::Fields::FieldCollection > get_Fields()
Returns a Fields collection that represents all fields in the range.
@ Words
void Delete()
Deletes all characters of the range.
void UnlinkFields()
Unlinks fields in this range.
@ Document
System::String get_Text()
Gets the text of the range.
@ Node
System::SharedPtr< Aspose::Words::Document > ToDocument()
Constructs a new fully formed document that contains the range.
int32_t Replace(System::String pattern, System::String replacement, System::SharedPtr< Aspose::Words::Replacing::FindReplaceOptions > options)
Replaces all occurrences of a character pattern specified by a regular expression with another string...
System::SharedPtr< Aspose::Words::Fields::FormFieldCollection > get_FormFields()
Returns a FormFields collection that represents all form fields in the range.