MythTV  master
proginfolist.h
Go to the documentation of this file.
1 
4 #ifndef PROG_INFO_LIST_H
5 #define PROG_INFO_LIST_H
6 
7 #include "mythuibuttonlist.h"
8 
9 class MythScreenType;
10 
12 class ProgInfoList : QObject
13 {
14  Q_OBJECT
15 
16  public:
17  enum VisibleLevel { kNone = 0, kLevel1 = 1, kLevel2 = 2 };
18 
19  // name, data, level
20  using DataItem = std::tuple<QString, QString, int>;
21  using DataList = QList<DataItem>;
22 
23  public:
24  explicit ProgInfoList(MythScreenType &screen)
25  : m_screen(screen) {}
26 
27  bool Create(bool focusable);
28  void Toggle(void);
29  bool Hide(void);
30  void Display(const DataList& data);
31  VisibleLevel GetLevel(void) const { return m_infoVisible; }
32 
35 
36  private slots:
37  void Clear() { m_btnList->Reset(); }
38 
39  private:
40  void CreateButton(const QString&, const QString&);
41 
45 };
46 
47 #endif // PROG_INFO_LIST_H
unsigned int slots[4]
Definition: element.c:38
void PageUp(void)
Definition: proginfolist.h:34
VisibleLevel GetLevel(void) const
Definition: proginfolist.h:31
MythScreenType & m_screen
Parent screen.
Definition: proginfolist.h:42
virtual bool MoveDown(MovementUnit unit=MoveItem, uint amount=0)
VisibleLevel m_infoVisible
Info list state.
Definition: proginfolist.h:44
bool Create(bool focusable)
Initialise buttonlist from XML.
void Display(const DataList &data)
Build list of key:value buttons.
void Toggle(void)
Toggle infolist state. Focusable widgets toggle between Basic & Full info. Non-focusable widgets togg...
virtual bool MoveUp(MovementUnit unit=MoveItem, uint amount=0)
The info/details buttonlist overlay that displays key:data info.
Definition: proginfolist.h:12
ProgInfoList(MythScreenType &screen)
Definition: proginfolist.h:24
QList< DataItem > DataList
Definition: proginfolist.h:21
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
void Clear()
Definition: proginfolist.h:37
void Reset() override
Reset the widget to it's original state, should not reset changes made by the theme.
void PageDown(void)
Definition: proginfolist.h:33
MythUIButtonList * m_btnList
Overlay buttonlist.
Definition: proginfolist.h:43
void CreateButton(const QString &, const QString &)
Populate a buttonlist item with name & value.
bool Hide(void)
Remove infolist from display.
Screen in which all other widgets are contained and rendered.
std::tuple< QString, QString, int > DataItem
Definition: proginfolist.h:20