Class: TInsertionOffset

Declaration: InsertionOffset.h

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.

Member Function: TInsertionOffset::TInsertionOffset

  1. TInsertionOffset ()
  2. TInsertionOffset (const TInsertionOffset & ip)
  3. TInsertionOffset (TTextOffset offset, EPlacement placement =kBeforeOffset)

Interface Category:

API.

Purpose:

  1. Default constructor. Creates an insertion point at offset 0, and the placement value kBeforeOffset.
  2. Copy constructor.
  3. Constructs an insertion offset with the specified values.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to copy an object.
  3. Call to construct an insertion offset with particular values.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TInsertionOffset::~TInsertionOffset

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.

Member Function: TInsertionOffset::operator=

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.

Member Function: TInsertionOffset::Set

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TInsertionOffset::GetOffset

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.

Member Function: TInsertionOffset::GetPlacement

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.

Member Function: TInsertionOffset::Hash

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.

Member Function: TInsertionOffset::operator==

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.

Member Function: TInsertionOffset::operator!=

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.

Member Function: TInsertionOffset::operator>>=

virtual TStream & operator >>=(TStream & toWhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

Calling Context:

Called to stream out data.

Parameters:

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.

Member Function: TInsertionOffset::operator<<=

virtual TStream & operator <<= (TStream & fromWhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

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.

Member Function: TInsertionOffset::operator-=

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:

Return Value:

A reference to this TInsertionOffset.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TInsertionOffset::operator+=

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:

Return Value:

A reference to this TInsertionOffset.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TInsertionOffset::ShiftBy

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TInsertionOffset::SetPlacement

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:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Multithread safe.

Other Considerations:

None.

Member Function: TInsertionOffset::SetOffset

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:

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.