Class: TTextModifier

Declaration: TextModifier.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TTextInputMethod TTransliteratorModifier

Purpose:

TTextModifier is an abstract base class that defines the interface for modifying user input text.

Instantiation:

Abstract class; do not instantiate directly.

Deriving Classes:

All simple deterministic linguistic services that are invoked at the time of text entry should descend from this class. Taligent provides the derived class TTransliteratorModifier.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TTextModifier::~TTextModifier

virtual ~ TTextModifier ()

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextModifier::Modify

virtual bool Modify (const TText & currentText, const TTextRange & newRange, const TText & newText, TText & replacementText, TTextRange & replacementRange)

Interface Category:

API.

Purpose:

Given the current text, the new text to be added to the current text, and the newRange indicating where the new text is to be added, this function generates the replacement text by applying the modifier particular to thisobject to the new text. The modified text is returned in the replacementText parameter. This function also generates the replacement range, which indicates the range of text in currentText that is to be replaced by the modified text.

Calling Context:

Called by the typing configuration on each of its text modifiers.

Parameters:

Return Value:

Returns true if a modification was made, and thus replacementText was generated.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This is a pure virtual function and needs to be overridden.

Member Function: TTextModifier::IsInteractive

virtual bool IsInteractive () const

Interface Category:

API.

Purpose:

Tells whether or not the modifier requires human intervention to complete processing. Transliterators typically do not require any human intervention except typing. Input member functions usually require that the user select from options.

Calling Context:

Called directly by clients to determine if the modifier requires human intervention for complete processing.

Parameters:

Return Value:

Returns true if the modifier requires human intervention to complete processing.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextModifier::GetLocalizableName

virtual void GetLocalizableName (TLocalizableName & name) const

Interface Category:

API.

Purpose:

Returns the localizable name for this modifier.

Calling Context:

Called directly by clients who need a human readable name for the modifier.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextModifier::SetLocalizableName

virtual void SetLocalizableName (const TLocalizableName & name)

Interface Category:

API.

Purpose:

Sets the localizable name for this modifier.

Calling Context:

Called by derived classes to change the localizable name or directly by clients.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextModifier::Hash

virtual long Hash () const

Interface Category:

API.

Purpose:

Returns a hash value for the localizable name of this text modifier.

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:

Not multithread safe.

Other Considerations:

Overrides inherited MCollectible function.

Member Function: TTextModifier::operator=

TTextModifier & operator =(const TTextModifier & modifier)

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextModifier::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:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextModifier::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:

Not multithread safe.

Other Considerations:

None.

Member Function: TTextModifier::TTextModifier

  1. TTextModifier ()
  2. TTextModifier (const TLocalizableName & name)
  3. TTextModifier (const TTextModifier &)

Interface Category:

API.

Purpose:

  1. Default constructor. This constructor is protected.
  2. Constructor for creating a TTextModifier with the specified localizable (human readable) name. This constructor is protected.
  3. Copy constructor. This constructor is protected.

Calling Context:

  1. Called by the stream-in operators.
  2. Called to construct a TTextModifier with the specified localizable (human readable) name.
  3. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not 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.