#include <mw/gulutil.h>
Link against: egul.lib
| class TextUtils |
| Public Member Functions | |
|---|---|
| IMPORT_C void | ClipToFit(TDes &, const CFont &, TInt, TChar) |
| IMPORT_C TInt | ColumnText(TPtrC &, TInt, const TDesC *, TChar) |
| IMPORT_C void | TruncateToNumChars(TDes &, TInt) |
Provides static functions for truncating and aligning text strings.
| IMPORT_C void | ClipToFit | ( | TDes & | aBuffer, |
| const CFont & | aFont, | |||
| TInt | aMaxWidthInPixels, | |||
| TChar | aAlternativeEnd = KTextUtilClipEndChar | |||
| ) | [static] | |||
Clips text to fit into a maximum width.
If the text is too wide to fit in the width when displayed in aFont, it is truncated and the specified character (by default, a horizontal ellipsis) is appended to it.
| Parameters | |
|---|---|
| aBuffer | A buffer containing the text to clip. |
| aFont | The font. |
| aMaxWidthInPixels | The maximum width in pixels. |
| aAlternativeEnd | The Unicode character to append to the buffer if truncated. By default, this is the horizontal ellipsis. |
| IMPORT_C TInt | ColumnText | ( | TPtrC & | aColumnText, |
| TInt | aColumn, | |||
| const TDesC * | aSourceText, | |||
| TChar | aColumnSeparator = KColumnListSeparator | |||
| ) | [static] | |||
Gets a portion of text from a descriptor, corresponding to a requested column.
| Parameters | |
|---|---|
| aColumnText | On return, set to the portion of aSourceText that corresponds to the column aColumn. |
| aColumn | The column to extract. The first column is numbered zero. |
| aSourceText | The source text string that contains one or more column separators. |
| aColumnSeparator | The character used in aSourceText to separate the columns. By default, a tab character. |
Truncates text to a number of characters.
If truncation is required (because aBuffer contains more than numChars characters), an ellipsis is added to the text as the last character.
| Parameters | |
|---|---|
| aBuffer | On return, contains the truncated text. |
| numChars | The number of characters. |