1.26.2.1
Gameface
cohtml::ITextTransformationManager Class Reference

Implement this interface to support text transformations. The class is used when the text-transform proeperty is used. Most languages require Unicode support to implement casing and cohtml delegates this work to the embedder. OS-specific APIs in Win32, Mac OS X and cross-platform libraries like ICU can implement the required functionality. An instance must be optionally set in SystemSettings. More...

Classes

struct  TransformationResult
 

Public Types

enum  CaseOperation { CaseOperation::Uppercase, CaseOperation::Lowercase, CaseOperation::Capitalize }
 The type of text transformation that is required Examples: Uppercase -> "my text" becomes "MY TEXT", each character is uppercase Lowercase -> "My Text" becomes "my text", each character is lowercase Capitalize -> "my text" becomes "My Text", each first character of each word is uppercase. More...
 

Public Member Functions

 ITextTransformationManager ()
 
virtual ~ITextTransformationManager ()
 
virtual bool CaseMapCharacters (CaseOperation operation, const char *utf8Text, unsigned bytesCount, char *transformed, unsigned transformedBytesCount) const
 Called when a text needs casing transformations. More...
 
virtual bool CaseMapCharacters (CaseOperation operation, const char *utf8Text, unsigned bytesCount, TransformationResult *transformed) const
 Called when a text needs casing transformations. More...
 

Detailed Description

Implement this interface to support text transformations. The class is used when the text-transform proeperty is used. Most languages require Unicode support to implement casing and cohtml delegates this work to the embedder. OS-specific APIs in Win32, Mac OS X and cross-platform libraries like ICU can implement the required functionality. An instance must be optionally set in SystemSettings.

Warning
THIS CLASS MUST BE THREAD-SAFE as it WILL be called from different threads

Member Enumeration Documentation

◆ CaseOperation

The type of text transformation that is required Examples: Uppercase -> "my text" becomes "MY TEXT", each character is uppercase Lowercase -> "My Text" becomes "my text", each character is lowercase Capitalize -> "my text" becomes "My Text", each first character of each word is uppercase.

Enumerator
Uppercase 
Lowercase 
Capitalize 

Constructor & Destructor Documentation

◆ ITextTransformationManager()

cohtml::ITextTransformationManager::ITextTransformationManager ( )

◆ ~ITextTransformationManager()

virtual cohtml::ITextTransformationManager::~ITextTransformationManager ( )
virtual

Member Function Documentation

◆ CaseMapCharacters() [1/2]

virtual bool cohtml::ITextTransformationManager::CaseMapCharacters ( CaseOperation  operation,
const char *  utf8Text,
unsigned  bytesCount,
char *  transformed,
unsigned  transformedBytesCount 
) const
inlinevirtual

Called when a text needs casing transformations.

Parameters
operationThe operation required by the function
utf8TextThe text in UTF-8 format to be case-transformed
bytesCountThe length in bytes of the text to be transformed
transformedOutput buffer where the changed text must be put - should be in UTF-8
transformedBytesCountThe size in bytes of the output buffer. The size is very conservative and should accomodate the new string.
Returns
Returns if the transformation was successfull.

◆ CaseMapCharacters() [2/2]

virtual bool cohtml::ITextTransformationManager::CaseMapCharacters ( CaseOperation  operation,
const char *  utf8Text,
unsigned  bytesCount,
TransformationResult transformed 
) const
inlinevirtual

Called when a text needs casing transformations.

Parameters
operationThe operation required by the function
utf8TextThe text in UTF-8 format to be case-transformed
bytesCountThe length in bytes of the text to be transformed
transformedTransformationResult to receive the transformed text The size is very conservative and should accomodate the new string.
Returns
Returns if the transformation was successfull.