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... | |
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
.
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 |
cohtml::ITextTransformationManager::ITextTransformationManager | ( | ) |
|
virtual |
|
inlinevirtual |
Called when a text needs casing transformations.
operation | The operation required by the function |
utf8Text | The text in UTF-8 format to be case-transformed |
bytesCount | The length in bytes of the text to be transformed |
transformed | Output buffer where the changed text must be put - should be in UTF-8 |
transformedBytesCount | The size in bytes of the output buffer. The size is very conservative and should accomodate the new string. |
|
inlinevirtual |
Called when a text needs casing transformations.
operation | The operation required by the function |
utf8Text | The text in UTF-8 format to be case-transformed |
bytesCount | The length in bytes of the text to be transformed |
transformed | TransformationResult to receive the transformed text The size is very conservative and should accomodate the new string. |