1#ifndef MYTHGENERICTREE_H_
2#define MYTHGENERICTREE_H_
20using mgtCbFn = QString (*)(
const QString &name,
void *data);
33 bool selectable_flag =
false);
36 void ensureSortFields(
void);
39 bool selectable_flag =
false,
bool visible =
true);
40 MythGenericTree *addNode(
const QString &a_string,
const QString &sortText =
"",
41 int an_int = 0,
bool selectable_flag =
false,
bool visible =
true);
46 void DetachParent(
void);
63 QList<MythGenericTree*> *getAllChildren()
const;
66 int getPosition(
void);
68 QList<int> getRouteById(
void);
69 QStringList getRouteByString(
void);
70 QList<MythGenericTree*> getRoute(
void);
72 void setInt(
int an_int) { m_int = an_int; }
78 void SetText(
const QString &text,
const QString &name=
"",
79 const QString &state=
"");
80 void SetTextFromMap(
const InfoMap &infoMap,
const QString &state=
"");
81 void SetTextCb(
mgtCbFn fn,
void *data);
82 QString GetText(
const QString &name=
"")
const;
87 void SetImage(
const QString &
filename,
const QString &name=
"");
88 void SetImageFromMap(
const InfoMap &infoMap);
89 void SetImageCb(
mgtCbFn fn,
void *data);
90 QString GetImage(
const QString &name=
"")
const;
92 void DisplayState(
const QString &state,
const QString &name=
"");
93 void DisplayStateFromMap(
const InfoMap &infoMap);
94 void SetStateCb(
mgtCbFn fn,
void *data);
95 QString
GetState(
const QString &name=
"")
const;
97 void SetData(QVariant data) { m_data = std::move(data); }
98 QVariant
GetData(
void)
const {
return m_data; }
100 int childCount(
void)
const;
102 int siblingCount(
void)
const;
104 int currentDepth(
void);
109 void SetVisible(
bool visible);
115 void becomeSelectedChild(
void);
119 void sortBySelectable();
120 void deleteAllChildren();
147 bool m_selectable {
false};
148 bool m_visible {
true};
bool isSelectable() const
QVariant GetData(void) const
void setParent(MythGenericTree *a_parent)
void setSelectedChild(MythGenericTree *a_node)
void SetSortText(const QString &text)
QMap< QString, TextProperties > m_strings
uint visibleChildCount() const
void setSelectable(bool flag)
void SetData(QVariant data)
void reorderSubnodes(void)
QString GetSortText() const
Q_DECLARE_METATYPE(std::chrono::seconds)
QString(*)(const QString &name, void *data) mgtCbFn
QHash< QString, QString > InfoMap