Taxonomy Categories:
Member Functions:
Interface Category:
API.
Inherits From:
MCollectible
Inherited By:
None.
Purpose:
TTransliteratorHandle is a lightweight reference to a TTransliterator. It can be constructed and destroyed freely. It is used by any client who needs to refer to a transliterator in the system, including the typing configuration.
Instantiation:
Allocate on the heap or the stack.
Deriving Classes:
TTransliteratorHandle is a concrete class designed to be used directly. It can be derived to add functionality. There are no special requirements for deriving.
Concurrency:
Not multithread safe.
Resource Use:
No special requirements.
virtual ~ TTransliteratorHandle ()
Interface Category:
API.
Purpose:
Destructor.
Calling Context:
This function is designed to be called directly and has no special requirements.
Parameters:
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TTextCount GetMaxExpandFactor () const
Interface Category:
API.
Purpose:
Returns the maximum expansion possible for this transliterator when doing forward translation. For example, if any single character can turn into four characters, the expansion factor is 4.
Calling Context:
This function is designed to be called directly and has no special requirements.
Parameters:
Return Value:
The expansion factor.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TTextCount GetMaxBackExpandFactor () const
Interface Category:
API.
Purpose:
Return the maximum expansion possible for this transliterator when doing backward translation. For example, if any single character can turn into four characters, the expansion factor is 4.
Calling Context:
This function is designed to be called directly and has no special requirements.
Parameters:
Return Value:
The expansion factor.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
virtual TTransliterator * CopyTransliterator () const
Interface Category:
API.
Purpose:
Access the transliterator referred to by this handle. Returns a copy of the referenced transliterator. Caller owns the storage for the object returned.
Calling Context:
This function is designed to be called directly and has no special requirements.
Parameters:
Return Value:
TTransliterator * -Copy of the transliterator referred to by this handle.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
- virtual void GetName (TLocalizableName & name) const
Interface Category:
API.
Purpose:
Returns the localizable name of the transliterator to which this handle refers.
Calling Context:
This function is designed to be called directly and has no special requirements.
Parameters:
- TLocalizableName & name -The localizable name of the transliterator to which this handle refers.
Return Value:
None.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
TTransliteratorHandle & operator =(const TTransliteratorHandle & tran)
Interface Category:
API.
Purpose:
Assignment operator.
Calling Context:
This function is designed to be called directly and has no special requirements.
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.
virtual TStream & operator <<= (TStream & fromWhere)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
This function is designed to be called directly and has no special requirements.
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.
virtual TStream & operator >>=(TStream & toWhere) const
Interface Category:
API.
Purpose:
Stream-out operator.
Calling Context:
This function is designed to be called directly and has no special requirements.
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.
virtual long Hash () const
Interface Category:
API.
Purpose:
Generates a hash value.
Calling Context:
This function is designed to be called directly and has no special requirements.
Parameters:
Return Value:
The numeric value of the hash.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
None.
- virtual bool TranslateInline (const TText & currentText, const TTextRange & newRange, const TText & newText, TText & replacementText, TTextRange & replacementRange) const
- virtual bool TranslateInline (TText & currentText, const TTextRange & newRange, const TText & newText, TTextRange & replacementRange, TTextCount & numNewChars) const
Interface Category:
API.
Purpose:
- Invoked for inline transliteration such as when the user is typing. Returns the replacement text and range so that the caller can edit the input text.
- Similar to the first function, except that the text is changed directly.
Calling Context:
This function is designed to be called directly and has no special requirements.
Parameters:
- const TText & currentText -The text in the document before user input.
- const TTextRange & newRange -The range in currentText indicating where new text is to be inserted, 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 -New user input.
- TText & replacementText -Text to be inserted into the text to modify it.
- TTextRange & replacementRange -The range in currentText that should be replaced.
- TText & currentText -Text in the document before user input. This argument will be modified directly.
- const TTextRange & newRange -The range in currentText indicating where new text is to be inserted, 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 -New user input.
- TTextRange & replacementRange -The range in currentText that was replaced.
- unsigned long & numNewChars -The number of new characters introduced by the translation process.
Return Value:
Returns true if translation was performed.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Calls corresponding function on the referenced transliterator.
- virtual bool TranslateBack (TText & text) const
- virtual bool TranslateBack (const TText & sourceText, const TTextRange & sourceRange, TText & replacementText, TTextRange & replacementRange) const
- virtual bool TranslateBack (TText & sourceText, const TTextRange & sourceRange, TTextRange & replacementRange, TTextCount & numNewChars) const
Interface Category:
API.
Purpose:
- This function directly translates back the specified text object.
- Given a text object (sourceText) and a range within it (sourceRange), this function returns the replacement (translated back) text and range.
- Given a text object and a range within it, this function calls DoTranslateBack to directly change the text object and return the range replaced and the number of new characters inserted.
Calling Context:
This function is designed to be called directly and has no special requirements. It is also called internally by functions such as TranslateInline.
Parameters:
- TText & text -The text to translate back.
- const TText & sourceText -The text to translate back.
- const TTextRange & sourceRange -The range in the sourceText to translate back.
- TText & replacementText -The replacement text.
- TTextRange & replacementRange -The range in sourceText that should be replaced.
- TText & sourceText -The text to translate back.
- const TTextRange & sourceRange -The range in the sourceText to translate back.
- TTextRange & replacementRange -The range in sourceText that was replaced.
- TTextCount & numNewChars -The number of new characters introduced during the translation.
Return Value:
Returns true if translation back was performed.
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Calls corresponding function on the referenced transliterator.
- virtual bool Translate (TText & text) const
- virtual bool Translate (const TText & sourceText, const TTextRange & sourceRange, TText & replacementText, TTextRange & replacementRange) const
- virtual bool Translate (TText & sourceText, const TTextRange & sourceRange, TTextRange & replacementRange, TTextCount & numNewChars) const
Interface Category:
API.
Purpose:
- This function directly translates the specified text object.
- Given a text object (sourceText) and a range within it (sourceRange), this function returns the replacement text and range.
- Given a text object and a range within it, this function directly changes the text object and returns the range replaced and the number of new characters inserted.
Calling Context:
This function is designed to be called directly and has no special requirements. It is also called internally by functions such as TranslateInline.
Parameters:
- TText & text -The text to translate.
- const TText & sourceText -The text to translate.
- const TTextRange & sourceRange -The range in the sourceText to translate.
- TText & replacementText -The replacement text.
- TTextRange & replacementRange -The range in sourceText that should be replaced.
- TText & sourceText -The text to translate.
- const TTextRange & sourceRange -The range in the sourceText to translate.
- TTextRange & replacementRange -The range in sourceText that was replaced.
- TTextCount & numNewChars -The number of new characters introduced during the translation.
Return Value:
Returns true if translation was performed
Exceptions:
Throws no exceptions, passes all exceptions through.
Concurrency:
Not multithread safe.
Other Considerations:
Calls corresponding function on the referenced transliterator.
- TTransliteratorHandle ()
- TTransliteratorHandle (const TTransliterator * transliterator)
- TTransliteratorHandle (const TLocalizableName & name)
- TTransliteratorHandle (const TTransliteratorHandle & tran)
Interface Category:
API.
Purpose:
- Default constructor.
- Constructs a handle object for the argument transliterator. Does not own the argument.
- Constructs a handle object with a particular name. Will attempt to find a transliterator object with that name and construct a handle for it. If not found, an empty handle will be constructed.
- Copy constructor.
Calling Context:
- Called by the stream-in operators.
- This function is designed to be called directly and has no special requirements.
- This function is designed to be called directly and has no special requirements.
- Called to copy an object.
Parameters:
- Takes no parameters.
- const TTransliterator * transliterator -The transliterator for which to construct a handle.
- const TLocalizableName & name -The name of the transliterator for which to construct a handle.
- const TTransliteratorHandle & tran -The object to copy.
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.