#include <document.h>
List of all members.
Detailed Description
Contains a WoopsiString and can wrap it to fit within a given width for a given font.
Constructor & Destructor Documentation
Constructor.
- Parameters:
-
font | The font to use for this object. |
text | A string that this object should wrap around. |
width | The pixel width at which the text should wrap. |
virtual WoopsiUI::Document::~Document |
( |
| ) |
[inline, virtual] |
Member Function Documentation
virtual void WoopsiUI::Document::append |
( |
const WoopsiString & |
text | ) |
[virtual] |
Append text to the end of the string.
- Parameters:
-
FontBase* WoopsiUI::Document::getFont |
( |
| ) |
const |
Get a pointer to the Document object's font.
- Returns:
- Pointer to the font.
const s32 WoopsiUI::Document::getLineContainingCharIndex |
( |
const s32 |
index | ) |
const |
Get the index of the line of text that contains the specified index within the raw char array.
- Parameters:
-
index | The index to locate within the wrapped lines of text. |
- Returns:
- The number of the line of wrapped text that contains the specified index.
const s32 WoopsiUI::Document::getLineCount |
( |
| ) |
const [inline] |
Get the total number of lines in the text.
- Returns:
- The line count.
const u8 WoopsiUI::Document::getLineHeight |
( |
| ) |
const [inline] |
Get the height in pixels of a line, given as the height of the font plus the line spacing.
- Returns:
- The height of a line.
const u8 WoopsiUI::Document::getLineLength |
( |
const s32 |
lineNumber | ) |
const |
Get the number of characters in the specified line number.
- Parameters:
-
lineNumber | The line number to check. |
- Returns:
- The number of characters in the line.
const s16 WoopsiUI::Document::getLinePixelLength |
( |
const s32 |
lineNumber | ) |
const |
Get the width in pixels of the specified line number.
- Parameters:
-
lineNumber | The line number to check. |
- Returns:
- The pixel width of the line.
const u8 WoopsiUI::Document::getLineSpacing |
( |
| ) |
const [inline] |
Get the pixel spacing between each line of text.
- Returns:
- The line spacing.
const s32 WoopsiUI::Document::getLineStartIndex |
( |
const s32 |
line | ) |
const [inline] |
Gets the index within the char array that represents the start of the line of text indicated by the line parameter.
- Parameters:
-
line | The line number to locate within the char array. |
- Returns:
- The index within the char array of the start of the supplied line.
const s16 WoopsiUI::Document::getLineTrimmedLength |
( |
const s32 |
lineNumber | ) |
const |
Get the number of characters in the specified line number, ignoring any trailing blank characters.
- Parameters:
-
lineNumber | The line number to check. |
- Returns:
- The number of characters in the line.
const s16 WoopsiUI::Document::getLineTrimmedPixelLength |
( |
const s32 |
lineNumber | ) |
const |
Get the width in pixels of the specified line number, ignoring any trailing blank characters.
- Parameters:
-
lineNumber | The line number to check. |
- Returns:
- The pixel width of the line.
const s32 WoopsiUI::Document::getPixelHeight |
( |
| ) |
const [inline] |
Get the total height of the text in pixels.
- Returns:
- The total height of the text.
const u8 WoopsiUI::Document::getPixelWidth |
( |
| ) |
const [inline] |
Get the width of the longest line in pixels.
- Returns:
- The width of the longest line.
const WoopsiString& WoopsiUI::Document::getText |
( |
| ) |
const [inline] |
Get a reference to the internal string. String is constant to prevent it being changed without notifying the document. Any change to a string should cause a re-wrap operation.
- Returns:
- The internal string.
virtual void WoopsiUI::Document::insert |
( |
const WoopsiString & |
text, |
|
|
const s32 |
index |
|
) |
| [virtual] |
Insert text at the specified character index.
- Parameters:
-
text | The text to insert. |
index | The char index to insert at. |
virtual void WoopsiUI::Document::remove |
( |
const s32 |
startIndex | ) |
[virtual] |
Remove all characters from the string from the start index onwards.
- Parameters:
-
startIndex | The char index to start removing from. |
virtual void WoopsiUI::Document::remove |
( |
const s32 |
startIndex, |
|
|
const s32 |
count |
|
) |
| [virtual] |
Remove all characters from the string from the start index onwards.
- Parameters:
-
startIndex | The char index to start removing from. |
count | The number of chars to remove. |
void WoopsiUI::Document::setFont |
( |
FontBase * |
font | ) |
|
Set the font to use.
- Parameters:
-
font | Pointer to the new font. |
void WoopsiUI::Document::setLineSpacing |
( |
u8 |
lineSpacing | ) |
|
Set the vertical spacing between rows of text.
- Parameters:
-
lineSpacing | The line spacing. |
virtual void WoopsiUI::Document::setText |
( |
const u32 |
text | ) |
[virtual] |
Set the text in the string.
- Parameters:
-
text | Character to to use as the new data for this string. |
virtual void WoopsiUI::Document::setText |
( |
const WoopsiString & |
text | ) |
[virtual] |
Set the text in the string.
- Parameters:
-
virtual void WoopsiUI::Document::setText |
( |
const char * |
text | ) |
[virtual] |
Set the text in the string.
- Parameters:
-
text | Char array to use as the new data for this string. |
void WoopsiUI::Document::setWidth |
( |
u16 |
width | ) |
|
Sets the pixel width of the text; text wider than this will automatically wrap.
- Parameters:
-
width | Maximum pixel width of the text. |
void WoopsiUI::Document::stripTopLines |
( |
const s32 |
lines | ) |
|
Removes lines of text from the start of the text buffer.
- Parameters:
-
lines | Number of lines to remove |
void WoopsiUI::Document::wrap |
( |
s32 |
charIndex | ) |
|
Wrap the text from the line containing the specified char index onwards.
- Parameters:
-
charIndex | The index of the char to start wrapping from; note that the wrapping function will re-wrap that entire line of text. |
void WoopsiUI::Document::wrap |
( |
| ) |
|
The documentation for this class was generated from the following file: