MythTV master
mythuibuttontree.h
Go to the documentation of this file.
1#ifndef MYTHUI_BUTTONTREE_H_
2#define MYTHUI_BUTTONTREE_H_
3
4#include "mythuitype.h"
5#include "mythgenerictree.h"
6#include "mythuibuttonlist.h"
7
9
17{
18 Q_OBJECT
19 public:
20 MythUIButtonTree(MythUIType *parent, const QString &name);
21 ~MythUIButtonTree() override = default;
22
23 bool keyPressEvent(QKeyEvent *event) override; // MythUIType
24 bool gestureEvent(MythGestureEvent *event) override; // MythUIType
25
26 bool AssignTree(MythGenericTree *tree);
27 void Reset(void) override; // MythUIType
28 bool SetNodeByString(QStringList route);
29 bool SetNodeById(QList<int> route);
30 bool SetCurrentNode(MythGenericTree *node);
31 void ShowSearchDialog(void);
32 MythGenericTree* GetCurrentNode(void) const { return m_currentNode; }
33
34 void SetActive(bool active);
35
36 MythUIButtonListItem* GetItemCurrent(void) const;
37 void RemoveItem(MythUIButtonListItem *item, bool deleteNode = false);
38 void RemoveCurrentItem(bool deleteNode = false);
39
40 public slots:
41 void handleSelect(MythUIButtonListItem* item);
42 void handleClick(MythUIButtonListItem* item);
43 void handleVisible(MythUIButtonListItem* item);
44 void Select();
45 void Deselect();
46
47 signals:
53
54 protected:
55 bool ParseElement(const QString &filename, QDomElement &element,
56 bool showWarnings) override; // MythUIType
57 void CopyFrom(MythUIType *base) override; // MythUIType
58 void CreateCopy(MythUIType *parent) override; // MythUIType
59
60 private:
61 void Init(void);
62 void SetTreeState(bool refreshAll = false);
63 bool UpdateList(MythUIButtonList *list, MythGenericTree *node) const;
64 bool DoSetCurrentNode(MythGenericTree *node);
65
66 void SwitchList(bool right);
67
68 bool m_active {true};
69 bool m_initialized {false};
70 uint m_numLists {1};
71 uint m_visibleLists {0};
72 uint m_currentDepth {0};
73 int m_depthOffset {0};
74 uint m_oldDepth {0};
75 QList<MythUIButtonList*> m_buttonlists;
76 MythUIButtonList *m_listTemplate {nullptr};
77 MythUIButtonList *m_activeList {nullptr};
78 uint m_activeListID {0};
79 MythGenericTree *m_rootNode {nullptr};
80 MythGenericTree *m_currentNode {nullptr};
81 uint m_listSpacing {0};
82};
83
84#endif
A custom event that represents a mouse gesture.
Definition: mythgesture.h:40
List widget, displays list items in a variety of themeable arrangements and can trigger signals when ...
A tree widget for displaying and navigating a MythGenericTree()
MythGenericTree * GetCurrentNode(void) const
void rootChanged(MythGenericTree *node)
~MythUIButtonTree() override=default
void itemVisible(MythUIButtonListItem *item)
void nodeChanged(MythGenericTree *node)
void itemSelected(MythUIButtonListItem *item)
void itemClicked(MythUIButtonListItem *item)
QList< MythUIButtonList * > m_buttonlists
The base class on which all widgets and screens are based.
Definition: mythuitype.h:86
virtual bool gestureEvent(MythGestureEvent *event)
Mouse click/movement handler, receives mouse gesture events from the QCoreApplication event loop.
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 Reset(void)
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitype.cpp:73
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 bool keyPressEvent(QKeyEvent *event)
Key event handler.
Definition: mythuitype.cpp:989
unsigned int uint
Definition: freesurround.h:24
#define MUI_PUBLIC
Definition: mythuiexp.h:9