MythUIText Class Reference
[MythUI Widget and theme handling]

All purpose text widget, displays a text string. More...

#include <mythuitext.h>

Inheritance diagram for MythUIText:
MythUIType StorageUser XMLParseBase MythUIClock

List of all members.

Public Member Functions

 MythUIText (MythUIType *parent, const QString &name)
 MythUIText (const QString &text, const MythFontProperties &font, QRect displayRect, QRect altDisplayRect, MythUIType *parent, const QString &name)
 ~MythUIText ()
void Reset (void)
 Reset the widget to it's original state, should not reset changes made by the theme.
virtual void SetText (const QString &text)
QString GetText (void) const
QString GetDefaultText (void) const
void SetTextFromMap (QHash< QString, QString > &map)
void SetTemplateText (const QString &text)
QString GetTemplateText (void) const
void UseAlternateArea (bool useAlt)
virtual void Pulse (void)
 Pulse is called 70 times a second to trigger a single frame of an animation.
QPoint CursorPosition (int text_offset)
void SetDBValue (const QString &text)
QString GetDBValue (void) const
void SetFontState (const QString &)
void SetJustification (int just)

Protected Types

enum  Constants { ScrollBounceDelay = 250 }
enum  ScrollDir {
  ScrollNone, ScrollLeft, ScrollRight, ScrollUp,
  ScrollDown, ScrollHorizontal, ScrollVertical
}
enum  TextCase {
  CaseNormal, CaseUpper, CaseLower, CaseCapitaliseFirst,
  CaseCapitaliseAll
}

Protected Member Functions

virtual void DrawSelf (MythPainter *p, int xoffset, int yoffset, int alphaMod, QRect clipRect)
virtual bool ParseElement (const QString &filename, QDomElement &element, bool showWarnings)
 Parse the xml definition of this widget setting the state of the object accordingly.
virtual void CopyFrom (MythUIType *base)
 Copy this widgets state from another.
virtual void CreateCopy (MythUIType *parent)
 Copy the state of this widget to the one given, it must be of the same type.
virtual void Finalize (void)
 Perform any post-xml parsing initialisation tasks.
void SetFontProperties (const MythFontProperties &fontProps)
const MythFontPropertiesGetFontProperties ()
void CycleColor (QColor startColor, QColor endColor, int numSteps)
void StopCycling ()
int GetJustification (void)
void SetCutDown (Qt::TextElideMode mode)
Qt::TextElideMode GetCutDown (void) const
void SetMultiLine (bool multiline)
bool GetMultiLine (void) const
void SetArea (const MythRect &rect)
void SetPosition (const MythPoint &pos)
MythRect GetDrawRect (void)
void SetCanvasPosition (int x, int y)
void ShiftCanvas (int x, int y)
bool Layout (QString &paragraph, QTextLayout *layout, bool &overflow, qreal width, qreal &height, bool force, qreal &last_line_width, QRectF &min_rect, int &num_lines)
bool LayoutParagraphs (const QStringList &paragraphs, const QTextOption &textoption, qreal width, qreal &height, QRectF &min_rect, qreal &last_line_width, int &num_lines)
bool GetNarrowWidth (const QStringList &paragraphs, const QTextOption &textoption, qreal &width)
void FillCutMessage (void)

Protected Attributes

int m_Justification
MythRect m_OrigDisplayRect
MythRect m_AltDisplayRect
MythRect m_Canvas
MythRect m_drawRect
QPoint m_cursorPos
QString m_Message
QString m_CutMessage
QString m_DefaultMessage
QString m_TemplateText
bool m_usingAltArea
bool m_ShrinkNarrow
Qt::TextElideMode m_Cutdown
bool m_MultiLine
int m_Leading
int m_extraLeading
int m_lineHeight
int m_textCursor
QVector< QTextLayout * > m_Layouts
MythFontPropertiesm_Font
QMap< QString, MythFontPropertiesm_FontStates
bool m_colorCycling
QColor m_startColor
QColor m_endColor
int m_numSteps
int m_curStep
float curR
float curG
float curB
float incR
float incG
float incB
int m_scrollPause
int m_scrollOffset
bool m_scrollBounce
bool m_scrolling
ScrollDir m_scrollDirection
TextCase m_textCase

Friends

class MythUITextEdit
class MythUIButton
class MythThemedMenu
class MythThemedMenuPrivate

Detailed Description

All purpose text widget, displays a text string.

Font, alignment, scrolling and color cycling effects may be applied to the text in this widget.

Definition at line 26 of file mythuitext.h.


Member Enumeration Documentation

enum MythUIText::Constants [protected]
Enumerator:
ScrollBounceDelay 

Definition at line 134 of file mythuitext.h.

enum MythUIText::ScrollDir [protected]
Enumerator:
ScrollNone 
ScrollLeft 
ScrollRight 
ScrollUp 
ScrollDown 
ScrollHorizontal 
ScrollVertical 

Definition at line 135 of file mythuitext.h.

enum MythUIText::TextCase [protected]
Enumerator:
CaseNormal 
CaseUpper 
CaseLower 
CaseCapitaliseFirst 
CaseCapitaliseAll 

Definition at line 144 of file mythuitext.h.


Constructor & Destructor Documentation

MythUIText::MythUIText ( MythUIType parent,
const QString &  name 
)

Definition at line 21 of file mythuitext.cpp.

Referenced by CreateCopy().

MythUIText::MythUIText ( const QString &  text,
const MythFontProperties font,
QRect  displayRect,
QRect  altDisplayRect,
MythUIType parent,
const QString &  name 
)

Definition at line 55 of file mythuitext.cpp.

MythUIText::~MythUIText (  ) 

Definition at line 93 of file mythuitext.cpp.


Member Function Documentation

void MythUIText::Reset ( void   )  [virtual]
void MythUIText::SetText ( const QString &  text  )  [virtual]

Reimplemented in MythUIClock.

Definition at line 116 of file mythuitext.cpp.

Referenced by ProgramRecPriority::changeRecPriority(), ThumbFinder::changeSeekAmount(), CustomEdit::clauseChanged(), CopyFrom(), FunctionDialog::Create(), ScreenSetup::Create(), Weather::Create(), ViewScheduleDiff::Create(), PlotDialog::Create(), RawSettingsEditor::Create(), PowerSearchPopup::Create(), PhrasePopup::Create(), ProgLister::Create(), GroupSelector::Create(), MythUIProgressDialog::Create(), MythUIBusyDialog::Create(), MythNewsEditor::Create(), MythNews::Create(), MythUISearchDialog::Create(), MythTextInputDialog::Create(), MythConfirmationDialog::Create(), MythDialogBox::Create(), ProfileDialog::Create(), KeyGrabPopupBox::Create(), ImportNative::Create(), ArchiveFileSelector::Create(), FileSelector::Create(), BookmarkManager::Create(), BrowserConfig::Create(), BookmarkEditor::Create(), MusicCommon::CreateCommon(), ProgFinder::customEvent(), MythControls::customEvent(), MusicCommon::customEvent(), GuideGrid::customEvent(), RipStatus::customEvent(), MusicCommon::cycleVisualizer(), StatusBox::doAutoExpireList(), StatusBox::doJobQueueStatus(), StatusBox::doListingsStatus(), ImportIconsWizard::doLoad(), StatusBox::doLogEntries(), StatusBox::doMachineStatus(), StatusBox::doScheduleStatus(), LocationDialog::doSearch(), StatusBox::doTunerStatus(), ZMEvents::eventChanged(), SelectDestination::filenameEditLostFocus(), ViewScheduled::FillList(), EditRomInfoDialog::fillWidgets(), ImportMusicDialog::fillWidgets(), GalleryFilterDialog::fillWidgets(), EditMetadataDialog::fillWidgets(), MythUITextEdit::Finalize(), ImportNative::findChannelMatch(), ZMConsole::getDaemonStatus(), ZMPlayer::getEventInfo(), ZMPlayer::getFrame(), MythNews::getHttpFile(), ImportNative::gotCallsign(), ImportNative::gotChanID(), ImportNative::gotChanNo(), ImportNative::gotName(), EditAlbumartDialog::gridItemChanged(), ProgLister::HandleSelected(), GameDetailsPopup::handleText(), RawSettingsEditor::Init(), GuideGrid::Init(), ThemeChooser::itemChanged(), ImportIconsWizard::itemChanged(), ChannelEditor::itemChanged(), LocationDialog::itemSelected(), ArchiveFileSelector::itemSelected(), StatusBox::keyPressEvent(), KeyGrabPopupBox::keyPressEvent(), PostProcEditor::Load(), GeneralSetupWizard::loadData(), ImportIconsWizard::manualSearch(), ImportIconsWizard::menuSelection(), GeneralSetupWizard::OnDeletePromptReturn(), GeneralSetupWizard::OnSubmitPromptReturn(), VideoSelector::parentalLevelChanged(), ParseElement(), MythUIFileBrowser::PathSelected(), ProfileDialog::profileChanged(), MythUIBusyDialog::Pulse(), MythControls::RefreshKeyInformation(), Reset(), NetSearch::searchFinished(), MusicCommon::seek(), RawSettingsEditor::selectionChanged(), EditRomInfoDialog::SetBoxart(), MythThemedMenu::setButtonActive(), SelectDestination::setDestination(), EditRomInfoDialog::SetFanart(), MythScreenType::SetFocusWidget(), StatusBox::setHelpText(), MythConfirmationDialog::SetMessage(), EditRomInfoDialog::SetScreenshot(), MythUIButton::SetState(), MythUITextEdit::SetText(), MythUIButton::SetText(), MythDialogBox::SetText(), SetTextFromMap(), MythUIButtonListItem::SetToRealButton(), Weather::SetupScreens(), Weather::showScreen(), BrowserConfig::slotFocusChanged(), RSSEditor::slotItemChanged(), MythBrowser::slotStatusBarMessage(), MythUISearchDialog::slotUpdateList(), SourceSetup::sourceListItemSelected(), MusicCommon::stop(), ImportIconsWizard::submit(), DVDThemeSelector::themeChanged(), VideoSelector::titleChanged(), RecordingSelector::titleChanged(), ExportNative::titleChanged(), ThemeChooser::toggleFullscreenPreview(), GuideGrid::toggleGuideListing(), SmartPLResultViewer::trackSelected(), VideoFilterDialog::update_numvideo(), ProgLister::UpdateButtonList(), Player::updateCamera(), ThumbFinder::updateCurrentPos(), GuideGrid::updateDateText(), ProgLister::UpdateDisplay(), GalleryFilterDialog::updateFilter(), ScreenSetup::updateHelpText(), ProgramRecPriority::updateInfo(), ProgFinder::updateInfo(), ChannelRecPriority::updateInfo(), MythNews::updateInfoView(), GuideGrid::updateJumpToChannel(), LogViewer::updateLogItem(), MythDialogBox::updateMenu(), MythUIProgressDialog::UpdateProgress(), PlaybackBox::updateRecList(), GameUI::updateRomInfo(), WelcomeDialog::updateScreen(), ScreenWizard::updateScreen(), MythBurn::updateSizeBar(), ExportNative::updateSizeBar(), Player::updateStatus(), ImportCoverArtDialog::updateStatus(), ZMConsole::updateTime(), SearchView::updateTracksList(), PlaybackBox::UpdateUsageUI(), and SmartPLDateDialog::valueChanged().

QString MythUIText::GetText ( void   )  const
QString MythUIText::GetDefaultText ( void   )  const
void MythUIText::SetTextFromMap ( QHash< QString, QString > &  map  ) 
void MythUIText::SetTemplateText ( const QString &  text  )  [inline]

Definition at line 43 of file mythuitext.h.

QString MythUIText::GetTemplateText ( void   )  const [inline]

Definition at line 44 of file mythuitext.h.

Referenced by SetTextFromMap(), and MythUIButtonListItem::SetToRealButton().

void MythUIText::UseAlternateArea ( bool  useAlt  ) 

Definition at line 227 of file mythuitext.cpp.

void MythUIText::Pulse ( void   )  [virtual]

Pulse is called 70 times a second to trigger a single frame of an animation.

This changes the alpha value of the widget

Reimplemented from MythUIType.

Reimplemented in MythUIClock.

Definition at line 928 of file mythuitext.cpp.

QPoint MythUIText::CursorPosition ( int  text_offset  ) 

Definition at line 849 of file mythuitext.cpp.

Referenced by MythUITextEdit::Finalize(), and MythUITextEdit::MoveCursor().

void MythUIText::SetDBValue ( const QString &  text  )  [inline, virtual]

Implements StorageUser.

Definition at line 54 of file mythuitext.h.

QString MythUIText::GetDBValue ( void   )  const [inline, virtual]

Implements StorageUser.

Definition at line 55 of file mythuitext.h.

void MythUIText::SetFontState ( const QString &  state  ) 
void MythUIText::SetJustification ( int  just  ) 

Definition at line 244 of file mythuitext.cpp.

Referenced by ParseElement().

void MythUIText::DrawSelf ( MythPainter p,
int  xoffset,
int  yoffset,
int  alphaMod,
QRect  clipRect 
) [protected, virtual]

Reimplemented from MythUIType.

Definition at line 343 of file mythuitext.cpp.

bool MythUIText::ParseElement ( const QString &  filename,
QDomElement &  element,
bool  showWarnings 
) [protected, virtual]

Parse the xml definition of this widget setting the state of the object accordingly.

Reimplemented from MythUIType.

Reimplemented in MythUIClock.

Definition at line 1093 of file mythuitext.cpp.

void MythUIText::CopyFrom ( MythUIType base  )  [protected, virtual]

Copy this widgets state from another.

Reimplemented from MythUIType.

Reimplemented in MythUIClock.

Definition at line 1275 of file mythuitext.cpp.

Referenced by CreateCopy().

void MythUIText::CreateCopy ( MythUIType parent  )  [protected, virtual]

Copy the state of this widget to the one given, it must be of the same type.

Reimplemented from MythUIType.

Reimplemented in MythUIClock.

Definition at line 1338 of file mythuitext.cpp.

void MythUIText::Finalize ( void   )  [protected, virtual]

Perform any post-xml parsing initialisation tasks.

This is called after the widget has been created and it's state established by ParseElement() or CopyFrom(). A derived class should use this to perform any initialisation tasks which should occur after this point.

Reimplemented from MythUIType.

Definition at line 1344 of file mythuitext.cpp.

void MythUIText::SetFontProperties ( const MythFontProperties fontProps  )  [protected]

Definition at line 191 of file mythuitext.cpp.

const MythFontProperties* MythUIText::GetFontProperties (  )  [inline, protected]

Definition at line 71 of file mythuitext.h.

Referenced by DrawSelf(), FillCutMessage(), Layout(), and MythUITextEdit::SetInitialStates().

void MythUIText::CycleColor ( QColor  startColor,
QColor  endColor,
int  numSteps 
) [protected]

Definition at line 1062 of file mythuitext.cpp.

Referenced by ParseElement().

void MythUIText::StopCycling ( void   )  [protected]

Definition at line 1083 of file mythuitext.cpp.

int MythUIText::GetJustification ( void   )  [protected]

Definition at line 263 of file mythuitext.cpp.

void MythUIText::SetCutDown ( Qt::TextElideMode  mode  )  [protected]

Definition at line 268 of file mythuitext.cpp.

Referenced by ParseElement(), and MythUITextEdit::SetInitialStates().

Qt::TextElideMode MythUIText::GetCutDown ( void   )  const [inline, protected]

Definition at line 78 of file mythuitext.h.

void MythUIText::SetMultiLine ( bool  multiline  )  [protected]

Definition at line 288 of file mythuitext.cpp.

Referenced by ParseElement().

bool MythUIText::GetMultiLine ( void   )  const [inline, protected]

Definition at line 80 of file mythuitext.h.

void MythUIText::SetArea ( const MythRect rect  )  [protected, virtual]

Reimplemented from MythUIType.

Definition at line 307 of file mythuitext.cpp.

Referenced by MythUIText(), ParseElement(), and UseAlternateArea().

void MythUIText::SetPosition ( const MythPoint pos  )  [protected, virtual]

Reimplemented from MythUIType.

Definition at line 316 of file mythuitext.cpp.

MythRect MythUIText::GetDrawRect ( void   )  [inline, protected]

Definition at line 84 of file mythuitext.h.

void MythUIText::SetCanvasPosition ( int  x,
int  y 
) [protected]

Definition at line 322 of file mythuitext.cpp.

Referenced by Pulse().

void MythUIText::ShiftCanvas ( int  x,
int  y 
) [protected]

Definition at line 333 of file mythuitext.cpp.

Referenced by Pulse().

bool MythUIText::Layout ( QString &  paragraph,
QTextLayout *  layout,
bool overflow,
qreal  width,
qreal &  height,
bool  force,
qreal &  last_line_width,
QRectF &  min_rect,
int &  num_lines 
) [protected]

Definition at line 411 of file mythuitext.cpp.

Referenced by LayoutParagraphs().

bool MythUIText::LayoutParagraphs ( const QStringList &  paragraphs,
const QTextOption &  textoption,
qreal  width,
qreal &  height,
QRectF &  min_rect,
qreal &  last_line_width,
int &  num_lines 
) [protected]

Definition at line 491 of file mythuitext.cpp.

Referenced by FillCutMessage(), and GetNarrowWidth().

bool MythUIText::GetNarrowWidth ( const QStringList &  paragraphs,
const QTextOption &  textoption,
qreal &  width 
) [protected]

Definition at line 535 of file mythuitext.cpp.

Referenced by FillCutMessage().

void MythUIText::FillCutMessage ( void   )  [protected]

Friends And Related Function Documentation

friend class MythUITextEdit [friend]

Definition at line 149 of file mythuitext.h.

friend class MythUIButton [friend]

Definition at line 150 of file mythuitext.h.

friend class MythThemedMenu [friend]

Definition at line 151 of file mythuitext.h.

friend class MythThemedMenuPrivate [friend]

Definition at line 152 of file mythuitext.h.


Member Data Documentation

int MythUIText::m_Justification [protected]

Definition at line 101 of file mythuitext.h.

Referenced by CopyFrom(), ParseElement(), and UseAlternateArea().

Definition at line 102 of file mythuitext.h.

Referenced by CopyFrom(), and UseAlternateArea().

QPoint MythUIText::m_cursorPos [protected]

Definition at line 105 of file mythuitext.h.

Referenced by CursorPosition().

QString MythUIText::m_Message [protected]
QString MythUIText::m_CutMessage [protected]

Definition at line 108 of file mythuitext.h.

Referenced by CopyFrom(), DrawSelf(), FillCutMessage(), GetNarrowWidth(), SetArea(), and SetText().

QString MythUIText::m_DefaultMessage [protected]

Definition at line 109 of file mythuitext.h.

Referenced by CopyFrom(), FillCutMessage(), GetDefaultText(), ParseElement(), Reset(), and SetText().

QString MythUIText::m_TemplateText [protected]

Definition at line 110 of file mythuitext.h.

Referenced by CopyFrom(), FillCutMessage(), and ParseElement().

Definition at line 113 of file mythuitext.h.

Referenced by MythUIText(), and UseAlternateArea().

Definition at line 115 of file mythuitext.h.

Referenced by CopyFrom(), FillCutMessage(), MythUIText(), and ParseElement().

Qt::TextElideMode MythUIText::m_Cutdown [protected]

Definition at line 116 of file mythuitext.h.

Referenced by CopyFrom(), Finalize(), GetNarrowWidth(), Layout(), and SetCutDown().

Definition at line 117 of file mythuitext.h.

Referenced by CopyFrom(), FillCutMessage(), Layout(), MythUIText(), and SetMultiLine().

int MythUIText::m_Leading [protected]
int MythUIText::m_extraLeading [protected]

Definition at line 119 of file mythuitext.h.

Referenced by CopyFrom(), FillCutMessage(), MythUIText(), and ParseElement().

int MythUIText::m_lineHeight [protected]
int MythUIText::m_textCursor [protected]

Definition at line 121 of file mythuitext.h.

Referenced by CopyFrom(), CursorPosition(), FillCutMessage(), and MythUIText().

QVector<QTextLayout *> MythUIText::m_Layouts [protected]
QMap<QString, MythFontProperties> MythUIText::m_FontStates [protected]

Definition at line 126 of file mythuitext.h.

Referenced by CopyFrom(), MythUIText(), ParseElement(), SetFontProperties(), and SetFontState().

Definition at line 128 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), ParseElement(), Pulse(), and StopCycling().

QColor MythUIText::m_startColor [protected]

Definition at line 129 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), ParseElement(), and StopCycling().

QColor MythUIText::m_endColor [protected]

Definition at line 129 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), and ParseElement().

int MythUIText::m_numSteps [protected]

Definition at line 130 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), ParseElement(), and Pulse().

int MythUIText::m_curStep [protected]

Definition at line 130 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), and Pulse().

float MythUIText::curR [protected]

Definition at line 131 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), and Pulse().

float MythUIText::curG [protected]

Definition at line 131 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), and Pulse().

float MythUIText::curB [protected]

Definition at line 131 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), and Pulse().

float MythUIText::incR [protected]

Definition at line 132 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), and Pulse().

float MythUIText::incG [protected]

Definition at line 132 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), and Pulse().

float MythUIText::incB [protected]

Definition at line 132 of file mythuitext.h.

Referenced by CopyFrom(), CycleColor(), and Pulse().

int MythUIText::m_scrollPause [protected]

Definition at line 138 of file mythuitext.h.

Referenced by FillCutMessage(), MythUIText(), and Pulse().

int MythUIText::m_scrollOffset [protected]

Definition at line 139 of file mythuitext.h.

Referenced by FillCutMessage(), and Pulse().

Definition at line 140 of file mythuitext.h.

Referenced by FillCutMessage(), MythUIText(), and Pulse().

Definition at line 142 of file mythuitext.h.

Referenced by CopyFrom(), FillCutMessage(), MythUIText(), ParseElement(), and Pulse().

Definition at line 147 of file mythuitext.h.

Referenced by CopyFrom(), FillCutMessage(), MythUIText(), and ParseElement().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends
Generated on Fri Feb 10 06:42:13 2012 for MythTV by  doxygen 1.6.3