Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MCollectible
Inherited By:
None.
Purpose:
Conceptually represents the position of an insertion point within a text object. TInsertionOffset encapsulates the position of the insertion point as an offset into the text object, along with information indicating whether the insertion point is associated with the character before or after this offset.
This class is used by Line Layout to return information to the user about where mouse hits occur, to give control over highlighting, and in other measurement functions.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
You should not need to derive this class.
Concurrency:
Multithread safe.
Resource Use:
No special requirements.
- TInsertionOffset ()
- TInsertionOffset (const TInsertionOffset & ip)
- TInsertionOffset (TTextOffset offset, EPlacement placement =kBeforeOffset)
Interface Category:
API.
Purpose:
- Default constructor. Creates an insertion point at offset 0, and the placement value kBeforeOffset.
- Copy constructor.
- Constructs an insertion offset with the specified values.
Calling Context:
- Called by the stream-in operators.
- Called to copy an object.
- Call to construct an insertion offset with particular values.
Parameters:
- Takes no parameters.
- const TInsertionOffset & ip -The object to copy.
- TTextOffset offset -The offset within the text object of the insertion point.
- EPlacement placement =kBeforeOffset -Whether the insertion point is associated with the character before or after the offset.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual ~ TInsertionOffset ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
Called to destroy an object.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
TInsertionOffset & operator =(const TInsertionOffset & x)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
Called when an object is assigned to another compatible object.
Parameters:
Return Value:
A non-const reference to the left-hand side object.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void Set (TTextOffset offset, EPlacement placement =kBeforeOffset)
Interface Category:
API.
Purpose:
Allows resetting of the position of an insertion offset after it is constructed.
Calling Context:
Used to reset the contents of an insertion point after it is created.
Parameters:
- TTextOffset offset -The offset within the text object of the insertion point's position.
- EPlacement placement =kBeforeOffset -Whether the insertion point is associated with the character before or after the offset.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TTextOffset GetOffset () const
Interface Category:
API.
Purpose:
Returns the offset within the text instance of the insertion point.
Calling Context:
Called to get the offset of the insertion point.
Parameters:
Return Value:
The offset of the insertion point.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Member Function: TInsertionOffset::operatorTTextOffset
virtual operator TTextOffset () const
Interface Category:
API.
Purpose:
Converts a TInsertionOffset object into a TTextOffset object.
Calling Context:
Called to convert a TInsertionOffset object into a TTextOffset object.
Parameters:
Return Value:
A TTextOffset instance.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual EPlacement GetPlacement () const
Interface Category:
API.
Purpose:
Queries whether the insertion point is associated with the character before or after the offset within the text object.
Calling Context:
Call to determine the exact position of the insertion point within the text object.
Parameters:
Return Value:
Enum value indicating the placement of the insertion point.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual long Hash () const
Interface Category:
API.
Purpose:
Overrides inherited MCollectible function.
Calling Context:
Same as for base class.
Parameters:
Return Value:
The numeric value of the hash.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool operator ==(const TInsertionOffset & x) const
Interface Category:
API.
Purpose:
Equality operator.
Calling Context:
Call to compare two instances of this class.
Parameters:
Return Value:
Returns true if the objects are not equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual bool operator != (const TInsertionOffset & x) const
Interface Category:
API.
Purpose:
Inequality operator.
Calling Context:
Call to compare two objects of this class.
Parameters:
Return Value:
Returns true if the objects are not equal.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TStream & operator >>=(TStream & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
Called to stream out data.
Parameters:
- TStream & toWhere -The stream the object streams itself out to.
Return Value:
Returns a reference to the stream the object streams itself out to.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TStream & operator <<= (TStream & fromWhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & fromWhere -The stream the object streams itself in from.
Return Value:
Returns a reference to the stream the object streams itself in from.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TInsertionOffset & operator -=(TTextOffset)
Interface Category:
API.
Purpose:
Decreases the current offset by a given amount.
Calling Context:
Called to decrease the current offset.
Parameters:
- TTextOffset -The amount to decrease the current offset by.
Return Value:
A reference to this TInsertionOffset.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual TInsertionOffset & operator += (TTextOffset)
Interface Category:
API.
Purpose:
Increases the current offset by a given amount.
Calling Context:
Called to increase the current offset.
Parameters:
- TTextOffset -The amount to increase the current offset by.
Return Value:
A reference to this TInsertionOffset.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void ShiftBy (TTextOffset)
Interface Category:
API.
Purpose:
Increases the current offset by a given amount.
Calling Context:
Called to increase the current offset.
Parameters:
- TTextOffset -The amount to increase the current offset by.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void SetPlacement (EPlacement)
Interface Category:
API.
Purpose:
Sets the placement of the insertion point to the given value. The placement indicates whether an insertion point is conceptually associated with the character before or after its offset in a text object.
Calling Context:
Called to change the placement of the insertion point.
Parameters:
- EPlacement -The new placement.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
virtual void SetOffset (TTextOffset)
Interface Category:
API.
Purpose:
Sets the insertion offset to a new value.
Calling Context:
Called to change the insertion offset to a new value.
Parameters:
- TTextOffset -The new value to set this insertion offset to.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Multithread safe.
Other Considerations:
None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.