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.
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.
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:
- const TText & currentText -The current text.
- const TTextRange & newRange -The range indicating where new text is to be added, including any backspaces. Note: newRange.GetCount is defined to be the number of deletions, and newRange.GetEnd is defined to be the insertion point relative to currentText.
- const TText & newText -The new text to be added to currentText.
- TText & replacementText -The modified text, after invoking the modifiers on the new text.
- TTextRange & replacementRange -The range of text in currentText that is to be replaced.
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.
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:
- const TTextModifier & modifier -The source object for the assignment.
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:
- 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:
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:
- 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:
Not multithread safe.
Other Considerations:
None.
- TTextModifier ()
- TTextModifier (const TLocalizableName & name)
- TTextModifier (const TTextModifier &)
Interface Category:
API.
Purpose:
- Default constructor. This constructor is protected.
- Constructor for creating a TTextModifier with the specified localizable (human readable) name. This constructor is protected.
- Copy constructor. This constructor is protected.
Calling Context:
- Called by the stream-in operators.
- Called to construct a TTextModifier with the specified localizable (human readable) name.
- 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.