VizKit
3.3.7
|
A VisualTextAutoScrollView displays rendered text. More...
#include <VisualTextAutoScrollView.h>
Classes | |
class | VisualTextAutoScrollViewTextLineImageRecord |
Public Member Functions | |
VisualTextAutoScrollView () | |
The constructor. | |
~VisualTextAutoScrollView () | |
The destructor. | |
VisualTextAutoScrollView (const VisualTextAutoScrollView &other) | |
Copy constructor. | |
VisualTextAutoScrollView & | operator= (const VisualTextAutoScrollView &other) |
Assignment operator. | |
bool | operator< (const VisualTextAutoScrollView &other) const |
Less than operator. | |
bool | operator== (const VisualTextAutoScrollView &other) const |
Equality operator. | |
bool | operator!= (const VisualTextAutoScrollView &other) const |
Inequality operator. | |
virtual VisualTextAutoScrollView * | clone (void) const |
Copies the current VisualTextAutoScrollView and returns a pointer to a new VisualTextAutoScrollView. | |
void | setStyledString (VisualStyledString &aStyledString) |
Sets the visual string. | |
const VisualStyledString *const | getStyledString (void) |
Returns the styled string. | |
void | setStringStyle (VisualStringStyle aStringStyle) |
Sets the style of the visual string. | |
VisualStringStyle | getStringStyle (void) |
Returns the current string style. | |
void | draw (float aCurrAudioPlayProgressValue) |
Draws the visual string. | |
void | refreshLayout (void) |
Refreshes the layout based on current canvas size. | |
PixelRect | getViewRect (void) |
Returns the pixel rect of the view. | |
void | setDisplayedPixelHeight (size_t aDisplayedPixelHeight) |
Sets the height of the displayed view in pixels inside which the content is clipped. | |
Private Member Functions | |
void | copy (const VisualTextAutoScrollView &other) |
Copy method for assignment operator and copy constructor. | |
void | refreshTextlineImageData (float aProgressValue) |
Loads as much image data as necessary. | |
void | calculateFirstAndLastTextLineIndexToShow (float aProgressValue) |
Calculates the first and the last index of text lines to show. | |
float | convertProgressValueToInternalProgressValue (float aCurrAudioPlayProgressValue) |
Converts the passed-in progress values of audio play progress to the internally used progress value for auto-scrolling. | |
size_t | completeTextLinesPixelHeight (void) |
The pixel height of all text lines summed up. | |
Private Attributes | |
VisualStyledString * | textScrollViewStyledString |
The styled string to be displayed in the scroll view. | |
std::vector < VisualTextAutoScrollViewTextLineImageRecord * > | textScrollViewImageVector |
The vector with image data per text line. | |
size_t | firstTextLineIndexToShow |
The index of the first text line that needs to be shown (and needs to be loaded as image). | |
size_t | lastTextLineIndexToShow |
The index of the last text line that needs to be shown (and needs to be loaded as image). | |
size_t | longestTextLinePixelWidth |
The pixel width of the longest text line image. | |
size_t | displayedPixelHeight |
The maximum number of vertically displayed pixels. |
A VisualTextAutoScrollView displays rendered text.
Text that does not fit inside the view bounds is scrolled in automatically. Scrolling speed and scrolling position depends on the auto play position that is passed in with the draw method. Only text lines currently being displayed are rendered into images.
The constructor.
The destructor.
Copy constructor.
other | Reference to another VisualTextAutoScrollView. |
void VisualTextAutoScrollView::calculateFirstAndLastTextLineIndexToShow | ( | float | aProgressValue | ) | [private] |
Calculates the first and the last index of text lines to show.
aProgressValue | Progress of the scrolling (range: 0.0 to 1.0). |
VisualTextAutoScrollView * VisualTextAutoScrollView::clone | ( | void | ) | const [virtual] |
Copies the current VisualTextAutoScrollView and returns a pointer to a new VisualTextAutoScrollView.
Implements VizKit::VisualObject.
size_t VisualTextAutoScrollView::completeTextLinesPixelHeight | ( | void | ) | [private] |
The pixel height of all text lines summed up.
float VisualTextAutoScrollView::convertProgressValueToInternalProgressValue | ( | float | aCurrAudioPlayProgressValue | ) | [private] |
Converts the passed-in progress values of audio play progress to the internally used progress value for auto-scrolling.
aCurrAudioPlayProgressValue | Progress of the audio track (range: 0.0 to 1.0). |
void VisualTextAutoScrollView::copy | ( | const VisualTextAutoScrollView & | other | ) | [private] |
Copy method for assignment operator and copy constructor.
other | Another VisualTextAutoScrollView. |
void VisualTextAutoScrollView::draw | ( | float | aCurrAudioPlayProgressValue | ) |
Draws the visual string.
aCurrAudioPlayProgressValue | Progress of the audio track (range: 0.0 to 1.0). |
Returns the current string style.
const VisualStyledString *const VisualTextAutoScrollView::getStyledString | ( | void | ) |
Returns the styled string.
Returns the pixel rect of the view.
bool VisualTextAutoScrollView::operator!= | ( | const VisualTextAutoScrollView & | other | ) | const |
Inequality operator.
other | Another VisualTextAutoScrollView. |
bool VisualTextAutoScrollView::operator< | ( | const VisualTextAutoScrollView & | other | ) | const |
Less than operator.
other | Another VisualTextAutoScrollView. |
VisualTextAutoScrollView & VisualTextAutoScrollView::operator= | ( | const VisualTextAutoScrollView & | other | ) |
Assignment operator.
other | Reference to another VisualTextAutoScrollView. |
bool VisualTextAutoScrollView::operator== | ( | const VisualTextAutoScrollView & | other | ) | const |
Equality operator.
other | Another VisualTextAutoScrollView. |
void VisualTextAutoScrollView::refreshLayout | ( | void | ) |
Refreshes the layout based on current canvas size.
void VisualTextAutoScrollView::refreshTextlineImageData | ( | float | aProgressValue | ) | [private] |
Loads as much image data as necessary.
aProgressValue | Progress of the scrolling (range: 0.0 to 1.0). |
void VisualTextAutoScrollView::setDisplayedPixelHeight | ( | size_t | aDisplayedPixelHeight | ) |
Sets the height of the displayed view in pixels inside which the content is clipped.
aDisplayedPixelHeight | The maximum pixel height of the view content. |
void VisualTextAutoScrollView::setStringStyle | ( | VisualStringStyle | aStringStyle | ) |
Sets the style of the visual string.
aStringStyle | A string style. |
void VisualTextAutoScrollView::setStyledString | ( | VisualStyledString & | aStyledString | ) |
Sets the visual string.
aStyledString | Reference to a styled string. |
size_t VizKit::VisualTextAutoScrollView::displayedPixelHeight [private] |
The maximum number of vertically displayed pixels.
size_t VizKit::VisualTextAutoScrollView::firstTextLineIndexToShow [private] |
The index of the first text line that needs to be shown (and needs to be loaded as image).
size_t VizKit::VisualTextAutoScrollView::lastTextLineIndexToShow [private] |
The index of the last text line that needs to be shown (and needs to be loaded as image).
size_t VizKit::VisualTextAutoScrollView::longestTextLinePixelWidth [private] |
The pixel width of the longest text line image.
std::vector<VisualTextAutoScrollViewTextLineImageRecord *> VizKit::VisualTextAutoScrollView::textScrollViewImageVector [private] |
The vector with image data per text line.
The styled string to be displayed in the scroll view.