-
Notifications
You must be signed in to change notification settings - Fork 345
/
mythuibuttontree.h
80 lines (66 loc) · 2.23 KB
/
mythuibuttontree.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#ifndef MYTHUI_BUTTONTREE_H_
#define MYTHUI_BUTTONTREE_H_
#include "mythuitype.h"
#include "mythgenerictree.h"
#include "mythuibuttonlist.h"
class MythUIButtonListItem;
/** \class MythUIButtonTree
*
* \brief A tree widget for displaying and navigating a MythGenericTree()
*
* \ingroup MythUI_Widgets
*/
class MPUBLIC MythUIButtonTree : public MythUIType
{
Q_OBJECT
public:
MythUIButtonTree(MythUIType *parent, const QString &name);
~MythUIButtonTree();
virtual bool keyPressEvent(QKeyEvent *);
//virtual void gestureEvent(MythUIType *uitype, MythGestureEvent *event);
bool AssignTree(MythGenericTree *tree);
void Reset(void);
bool SetNodeByString(QStringList route);
bool SetNodeById(QList<int> route);
bool SetCurrentNode(MythGenericTree *node);
MythGenericTree* GetCurrentNode(void) const { return m_currentNode; }
void SetActive(bool active);
MythUIButtonListItem* GetItemCurrent(void) const;
void RemoveItem(MythUIButtonListItem *item, bool deleteNode = false);
void RemoveCurrentItem(bool deleteNode = false);
public slots:
void handleSelect(MythUIButtonListItem* item);
void handleClick(MythUIButtonListItem* item);
void handleVisible(MythUIButtonListItem* item);
void Select();
void Deselect();
signals:
void itemSelected(MythUIButtonListItem* item);
void itemClicked(MythUIButtonListItem* item);
void itemVisible(MythUIButtonListItem* item);
void nodeChanged(MythGenericTree* node);
protected:
virtual bool ParseElement(
const QString &filename, QDomElement &element, bool showWarnings);
virtual void CopyFrom(MythUIType *base);
virtual void CreateCopy(MythUIType *parent);
private:
void Init(void);
void SetTreeState(bool refreshAll = false);
bool UpdateList(MythUIButtonList *list, MythGenericTree *node);
void SwitchList(bool right);
bool m_active;
bool m_initialized;
uint m_numLists;
uint m_visibleLists;
uint m_currentDepth;
uint m_oldDepth;
QList<MythUIButtonList*> m_buttonlists;
MythUIButtonList *m_listTemplate;
MythUIButtonList *m_activeList;
uint m_activeListID;
MythGenericTree *m_rootNode;
MythGenericTree *m_currentNode;
uint m_listSpacing;
};
#endif