Aspose::Words::EditableRange Class Reference

Detailed Description

Represents a single editable range.

EditableRange is a "facade" object that encapsulates two nodes EditableRangeStart and EditableRangeEnd in a document tree and allows to work with an editable range as a single object.

#include <Aspose.Words.Cpp/Model/EditableRanges/EditableRange.h>

+ Inheritance diagram for Aspose::Words::EditableRange:

Public Member Functions

SharedPtr< EditableRangeEndget_EditableRangeEnd ()
 Gets the node that represents the end of the editable range. More...
 
SharedPtr< EditableRangeStartget_EditableRangeStart () const
 Gets the node that represents the start of the editable range. More...
 
EditorType get_EditorGroup ()
 Returns or sets an alias (or editing group) which shall be used to determine if the current user shall be allowed to edit this editable range. More...
 
int32_t get_Id ()
 Gets the editable range identifier. More...
 
String get_SingleUser ()
 Returns or sets the single user for editable range. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void Remove ()
 Removes the editable range from the document. Does not remove content inside the editable range. More...
 
void set_EditorGroup (EditorType value)
 Setter for get_EditorGroup. More...
 
void set_SingleUser (String value)
 Setter for get_SingleUser. More...
 
- Public Member Functions inherited from Object
ASPOSECPP_SHARED_API Object ()
 
ASPOSECPP_SHARED_API Object (Object const &x)
 
virtual ASPOSECPP_SHARED_API ~Object ()
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 
Detail::SmartPtrCounter * GetCounter ()
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 
ASPOSECPP_SHARED_API void Lock ()
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 
Objectoperator= (Object const &x)
 
bool ReferenceEquals (String const &str, std::nullptr_t)
 
bool ReferenceEquals (String const &str1, String const &str2)
 
int RemovedSharedRefs (int count)
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 
int SharedCount () const
 
ObjectSharedRefAdded ()
 
int SharedRefRemovedSafe ()
 
virtual ASPOSECPP_SHARED_API String ToString () const
 
ASPOSECPP_SHARED_API void Unlock ()
 
Detail::SmartPtrCounter * WeakRefAdded ()
 
void WeakRefRemoved ()
 

Static Public Member Functions

static const TypeInfoType ()
 
- Static Public Member Functions inherited from Object
bool Equals (double const &objA, double const &objB)
 
bool Equals (float const &objA, float const &objB)
 
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 
static const TypeInfoType ()
 

Additional Inherited Members

- Public Types inherited from Object
typedef SmartPtr< Objectptr
 
typedef System::Details::SharedMembersType shared_members_type
 

Member Function Documentation

◆ get_EditableRangeEnd()

System::SharedPtr<Aspose::Words::EditableRangeEnd> Aspose::Words::EditableRange::get_EditableRangeEnd ( )

Gets the node that represents the end of the editable range.

◆ get_EditableRangeStart()

System::SharedPtr<Aspose::Words::EditableRangeStart> Aspose::Words::EditableRange::get_EditableRangeStart ( ) const

Gets the node that represents the start of the editable range.

◆ get_EditorGroup()

Aspose::Words::EditorType Aspose::Words::EditableRange::get_EditorGroup ( )

Returns or sets an alias (or editing group) which shall be used to determine if the current user shall be allowed to edit this editable range.

Single user and editor group cannot be set simultaneously for the specific editable range, if the one is set, the other will be clear.

Examples

Shows how to add editing group for editable ranges

SharedPtr<EditableRangeStart> startRange1 = builder->StartEditableRange();
builder->Writeln(u"EditableRange_1_1");
builder->Writeln(u"EditableRange_1_2");
// Sets the editor for editable range region
startRange1->get_EditableRange()->set_EditorGroup(EditorType::Everyone);

◆ get_Id()

int32_t Aspose::Words::EditableRange::get_Id ( )

Gets the editable range identifier.

The region must be demarcated using the EditableRangeStart and EditableRangeEnd

Editable range identifiers are supposed to be unique across a document and Aspose.Words automatically maintains editable range identifiers when loading, saving and combining documents.

◆ get_SingleUser()

System::String Aspose::Words::EditableRange::get_SingleUser ( )

Returns or sets the single user for editable range.

This editor can be stored in one of the following forms:

DOMAIN\Username - for users whose access shall be authenticated using the current user's domain credentials.

user@domain.com - for users whose access shall be authenticated using the user's e-mail address as credentials.

user - for users whose access shall be authenticated using the current user's machine credentials.

Single user and editor group cannot be set simultaneously for the specific editable range, if the one is set, the other will be clear.

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::EditableRange::GetType ( ) const
overridevirtual

Reimplemented from System::Object.

◆ Is()

virtual bool Aspose::Words::EditableRange::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from System::Object.

◆ Remove()

void Aspose::Words::EditableRange::Remove ( )

Removes the editable range from the document. Does not remove content inside the editable range.

Examples

Shows how to remove an editable range from a document.

auto doc = MakeObject<Document>(MyDir + u"Document.docx");
auto builder = MakeObject<DocumentBuilder>(doc);
// Create an EditableRange so we can remove it. Does not have to be well-formed
SharedPtr<EditableRangeStart> edRange1Start = builder->StartEditableRange();
SharedPtr<EditableRange> editableRange1 = edRange1Start->get_EditableRange();
builder->Writeln(u"Paragraph inside editable range");
SharedPtr<EditableRangeEnd> edRange1End = builder->EndEditableRange();
// Remove the range that was just made
editableRange1->Remove();

◆ set_EditorGroup()

void Aspose::Words::EditableRange::set_EditorGroup ( Aspose::Words::EditorType  value)

◆ set_SingleUser()

void Aspose::Words::EditableRange::set_SingleUser ( System::String  value)

◆ Type()

static const System::TypeInfo& Aspose::Words::EditableRange::Type ( )
static
@ Everyone
Specifies that all users that open the document shall be allowed to edit editable ranges using this e...