vdr 2.6.6
|
#include <skins.h>
Public Types | |
enum | { MaxTabs = 6 } |
Public Member Functions | |
cSkinDisplayMenu (void) | |
eMenuCategory | MenuCategory (void) const |
virtual void | SetMenuCategory (eMenuCategory MenuCategory) |
virtual void | SetTabs (int Tab1, int Tab2=0, int Tab3=0, int Tab4=0, int Tab5=0) |
virtual void | SetMenuSortMode (eMenuSortMode MenuSortMode) |
virtual eMenuOrientation | MenuOrientation (void) |
virtual void | Scroll (bool Up, bool Page) |
virtual int | MaxItems (void)=0 |
virtual void | Clear (void)=0 |
virtual void | SetTitle (const char *Title)=0 |
virtual void | SetButtons (const char *Red, const char *Green=NULL, const char *Yellow=NULL, const char *Blue=NULL)=0 |
virtual void | SetMessage (eMessageType Type, const char *Text)=0 |
virtual void | SetItem (const char *Text, int Index, bool Current, bool Selectable)=0 |
virtual bool | SetItemEvent (const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch, bool TimerActive) |
virtual bool | SetItemTimer (const cTimer *Timer, int Index, bool Current, bool Selectable) |
virtual bool | SetItemChannel (const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider) |
virtual bool | SetItemRecording (const cRecording *Recording, int Index, bool Current, bool Selectable, int Level, int Total, int New) |
virtual void | SetScrollbar (int Total, int Offset) |
virtual void | SetEvent (const cEvent *Event)=0 |
virtual void | SetRecording (const cRecording *Recording)=0 |
virtual void | SetText (const char *Text, bool FixedFont)=0 |
virtual int | GetTextAreaWidth (void) const |
virtual const cFont * | GetTextAreaFont (bool FixedFont) const |
![]() | |
cSkinDisplay (void) | |
virtual | ~cSkinDisplay () |
int | EditableWidth (void) |
void | SetEditableWidth (int Width) |
virtual void | Flush (void) |
Protected Member Functions | |
int | Tab (int n) |
const char * | GetTabbedText (const char *s, int Tab) |
Protected Attributes | |
cTextScroller | textScroller |
Private Attributes | |
eMenuCategory | menuCategory |
int | tabs [MaxTabs] |
Additional Inherited Members | |
![]() | |
static int | AvgCharWidth (void) |
static cSkinDisplay * | Current (void) |
anonymous enum |
< This class implements the general purpose menu display, which is used throughout the program to display information and let the user interact with items.
A menu consists of the following fields, each of which is explicitly set by calls to the member functions below:
Enumerator | |
---|---|
MaxTabs |
cSkinDisplayMenu::cSkinDisplayMenu | ( | void | ) |
Definition at line 84 of file skins.c.
References mcUndefined, menuCategory, and SetTabs().
|
pure virtual |
Clears the entire central area of the menu.
Implemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Referenced by cOsdMenu::Display(), cInterface::LearnKeys(), cInterface::QueryKeys(), cOsdMenu::SetDisplayMenu(), and cOsdMenu::~cOsdMenu().
|
protected |
Returns the part of the given string that follows the given Tab (where 0 indicates the beginning of the string).
If no such part can be found, NULL will be returned.
Definition at line 112 of file skins.c.
References Tab().
Referenced by cSkinCursesDisplayMenu::SetItem(), cSkinClassicDisplayMenu::SetItem(), cSkinLCARSDisplayMenu::SetItem(), and cSkinSTTNGDisplayMenu::SetItem().
|
virtual |
Returns a pointer to the font which is used to display text with SetText().
The parameter FixedFont has the same meaning as in SetText(). The default implementation returns NULL. Therefore a caller of this method must be prepared to receive NULL if the plugin doesn't implement this method. The returned pointer is valid a long as the instance of cSkinDisplayMenu exists.
Reimplemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
|
virtual |
Returns the width in pixel of the area which is used to display text with SetText().
The width of the area is the width of the central area minus the width of any possibly displayed scroll-bar or other decoration. The default implementation returns 0. Therefore a caller of this method must be prepared to receive 0 if the plugin doesn't implement this method.
Reimplemented in cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
|
pure virtual |
Returns the maximum number of items the menu can display.
Implemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Referenced by cOsdMenu::CursorDown(), cOsdMenu::CursorUp(), cOsdMenu::Display(), cOsdMenu::PageDown(), and cOsdMenu::PageUp().
|
inline |
Returns the menu category, set by a previous call to SetMenuCategory().
Definition at line 183 of file skins.h.
References menuCategory.
Referenced by cOsdMenu::Display(), cSkinLCARSDisplayMenu::DrawScrollbar(), cSkinCursesDisplayMenu::DrawTitle(), cSkinClassicDisplayMenu::DrawTitle(), cSkinSTTNGDisplayMenu::DrawTitle(), cSkinLCARSDisplayMenu::Flush(), cSkinLCARSDisplayMenu::MaxItems(), cSkinLCARSDisplayMenu::SetButtons(), cSkinLCARSDisplayMenu::SetMenuCategory(), SetMenuCategory(), and cSkinLCARSDisplayMenu::SetTitle().
|
inlinevirtual |
Asks the skin for the orientation of the displayed menu.
If menu orientation is set to horizontal, the keys left/right and up/down are just toggled.
Definition at line 200 of file skins.h.
References moVertical.
Referenced by cOsdMenu::Display().
|
virtual |
If this menu contains a text area that can be scrolled, this function will be called to actually scroll the text.
Up indicates whether the text shall be scrolled up or down, and Page is true if it shall be scrolled by a full page, rather than a single line. An object of the cTextScroller class can be used to implement the scrolling text area.
Reimplemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Definition at line 107 of file skins.c.
References cTextScroller::Scroll(), and textScroller.
Referenced by cMenuRecording::ProcessKey(), cMenuText::ProcessKey(), cMenuEvent::ProcessKey(), cSkinCursesDisplayMenu::Scroll(), cSkinClassicDisplayMenu::Scroll(), cSkinLCARSDisplayMenu::Scroll(), and cSkinSTTNGDisplayMenu::Scroll().
|
pure virtual |
Sets the color buttons to the given strings.
If any of the values is NULL, any previous text must be removed from the related button.
Reimplemented from cSkinDisplay.
Implemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Referenced by cOsdMenu::DisplayHelp().
|
pure virtual |
Sets the Event that shall be displayed, using the entire central area of the menu.
The Event's 'description' shall be displayed using a cTextScroller, and the Scroll() function will be called to drive scrolling that text if necessary.
Implemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Referenced by cMenuEvent::Display().
|
pure virtual |
Sets the item at the given Index to Text.
Index is between 0 and the value returned by MaxItems(), minus one. Text may contain tab characters ('\t'), which shall be used to separate the text into several columns, according to the values set by a prior call to SetTabs(). If Current is true, this item shall be drawn in a way indicating to the user that it is the currently selected one. Selectable can be used to display items differently that can't be selected by the user. Whenever the current status is moved from one item to another, this function will be first called for the old current item with Current set to false, and then for the new current item with Current set to true.
Implemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Referenced by cInterface::LearnKeys(), cInterface::QueryKeys(), cMenuChannelItem::SetMenuItem(), cMenuTimerItem::SetMenuItem(), cMenuScheduleItem::SetMenuItem(), cMenuRecordingItem::SetMenuItem(), and cOsdItem::SetMenuItem().
|
inlinevirtual |
Sets the item at the given Index to Channel.
See SetItem() for more information. If a derived skin class implements this function, it can display a Channel item in a more elaborate way than just a simple line of text. If WithProvider ist true, the provider shall be displayed in addition to the channel's name. If the skin displays the Channel item in its own way, it shall return true. The default implementation does nothing and returns false, which results in a call to SetItem() with a proper text.
Definition at line 263 of file skins.h.
Referenced by cMenuChannelItem::SetMenuItem().
|
inlinevirtual |
Sets the item at the given Index to Event.
See SetItem() for more information. If a derived skin class implements this function, it can display an Event item in a more elaborate way than just a simple line of text. If Channel is not NULL, the channel's name and/or number shall be displayed. If WithDate is true, the date of the Event shall be displayed (in addition to the time). TimerMatch tells how much of this event will be recorded by a timer. TimerActive tells whether the timer that will record this event is active. If the skin displays the Event item in its own way, it shall return true. The default implementation does nothing and returns false, which results in a call to SetItem() with a proper text.
Definition at line 236 of file skins.h.
Referenced by cMenuScheduleItem::SetMenuItem().
|
inlinevirtual |
Sets the item at the given Index to Recording.
See SetItem() for more information. If a derived skin class implements this function, it can display a Recording item in a more elaborate way than just a simple line of text. Level is the currently displayed level of the video directory, where 0 is the top level. A value of -1 means that the full path names of the recordings shall be displayed. If Total is greater than 0, this is a directory with the given total number of entries, and New contains the number of new (unwatched) recordings. If the skin displays the Recording item in its own way, it shall return true. The default implementation does nothing and returns false, which results in a call to SetItem() with a proper text.
Definition at line 272 of file skins.h.
Referenced by cMenuRecordingItem::SetMenuItem().
|
inlinevirtual |
Sets the item at the given Index to Timer.
See SetItem() for more information. If a derived skin class implements this function, it can display a Timer item in a more elaborate way than just a simple line of text. If the skin displays the Timer item in its own way, it shall return true. The default implementation does nothing and returns false, which results in a call to SetItem() with a proper text.
Definition at line 256 of file skins.h.
Referenced by cMenuTimerItem::SetMenuItem().
|
virtual |
Sets the current menu category.
This allows skins to handle known types of menus in different ways, for instance by displaying icons or special decorations. A derived class can reimplement this function to be informed of any changes in the menu category. If it does, it shall call the base class function in order to set the members accordingly for later calls to the MenuCategory() function.
Reimplemented in cSkinLCARSDisplayMenu.
Definition at line 90 of file skins.c.
References menuCategory, and MenuCategory().
Referenced by cOsdMenu::Display(), cInterface::LearnKeys(), and cSkinLCARSDisplayMenu::SetMenuCategory().
|
inlinevirtual |
Sets the mode by which the items in this menu are sorted.
This is purely informative and may be used by a skin to display the current sort mode by means of some text or symbol.
Definition at line 196 of file skins.h.
Referenced by cOsdMenu::Display().
|
pure virtual |
Sets a one line message Text, with the given Type.
Type can be used to determine, e.g., the colors for displaying the Text. If Text is NULL, any previously displayed message must be removed, and any previous contents overwritten by the message must be restored.
Reimplemented from cSkinDisplay.
Implemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Referenced by cOsdMenu::Display(), and cOsdMenu::SetStatus().
|
pure virtual |
Sets the Recording that shall be displayed, using the entire central area of the menu.
The Recording's 'description' shall be displayed using a cTextScroller, and the Scroll() function will be called to drive scrolling that text if necessary.
Implemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Referenced by cMenuRecording::Display().
|
virtual |
Sets the Total number of items in the currently displayed list, and the Offset of the first item that is currently displayed (the skin knows how many items it can display at once, see MaxItems()).
This can be used to display a scrollbar.
Reimplemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Definition at line 133 of file skins.c.
Referenced by cOsdMenu::Display().
|
virtual |
Sets the tab columns to the given values, which are the number of characters in each column.
Definition at line 95 of file skins.c.
References cSkinDisplay::AvgCharWidth(), MaxTabs, and tabs.
Referenced by cSkinDisplayMenu(), and cOsdMenu::Display().
|
pure virtual |
Sets the Text that shall be displayed, using the entire central area of the menu.
The Text shall be displayed using a cTextScroller, and the Scroll() function will be called to drive scrolling that text if necessary.
Implemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Referenced by cMenuText::Display().
|
pure virtual |
Sets the title of this menu to Title.
Implemented in cSkinCursesDisplayMenu, cSkinClassicDisplayMenu, cSkinLCARSDisplayMenu, and cSkinSTTNGDisplayMenu.
Referenced by cOsdMenu::Display(), and cInterface::LearnKeys().
|
inlineprotected |
Returns the offset of the given tab from the left border of the item display area.
The value returned is in pixel.
Definition at line 174 of file skins.h.
Referenced by GetTabbedText(), cSkinCursesDisplayMenu::SetItem(), cSkinClassicDisplayMenu::SetItem(), cSkinLCARSDisplayMenu::SetItem(), and cSkinSTTNGDisplayMenu::SetItem().
|
private |
Definition at line 170 of file skins.h.
Referenced by cSkinDisplayMenu(), MenuCategory(), and SetMenuCategory().
|
private |
|
protected |
Definition at line 173 of file skins.h.
Referenced by cSkinCursesDisplayMenu::Clear(), cSkinClassicDisplayMenu::Clear(), cSkinLCARSDisplayMenu::Clear(), cSkinSTTNGDisplayMenu::Clear(), cSkinLCARSDisplayMenu::DrawTextScrollbar(), Scroll(), cSkinCursesDisplayMenu::SetEvent(), cSkinClassicDisplayMenu::SetEvent(), cSkinLCARSDisplayMenu::SetEvent(), cSkinSTTNGDisplayMenu::SetEvent(), cSkinCursesDisplayMenu::SetRecording(), cSkinClassicDisplayMenu::SetRecording(), cSkinLCARSDisplayMenu::SetRecording(), cSkinSTTNGDisplayMenu::SetRecording(), cSkinCursesDisplayMenu::SetText(), cSkinClassicDisplayMenu::SetText(), cSkinLCARSDisplayMenu::SetText(), cSkinSTTNGDisplayMenu::SetText(), cSkinCursesDisplayMenu::SetTextScrollbar(), cSkinClassicDisplayMenu::SetTextScrollbar(), and cSkinSTTNGDisplayMenu::SetTextScrollbar().