MythTV
master
|
#include <libmythui/mythgenerictree.h>
Public Member Functions | |
MythGenericTree (QString a_string="", int an_int=0, bool selectable_flag=false) | |
virtual | ~MythGenericTree () |
void | ensureSortFields (void) |
MythGenericTree * | addNode (const QString &a_string, int an_int=0, bool selectable_flag=false, bool visible=true) |
MythGenericTree * | addNode (const QString &a_string, const QString &sortText="", int an_int=0, bool selectable_flag=false, bool visible=true) |
MythGenericTree * | addNode (MythGenericTree *child) |
void | DetachParent (void) |
Detach this node/branch from it's parent without deleting it, it can then be reattached elsewhere or used on it's own. More... | |
void | removeNode (MythGenericTree *child) |
void | deleteNode (MythGenericTree *child) |
MythGenericTree * | findLeaf () |
MythGenericTree * | findNode (QList< int > route_of_branches) |
MythGenericTree * | nextSibling (int number_down) |
MythGenericTree * | prevSibling (int number_up) |
MythGenericTree * | getSelectedChild (bool onlyVisible=false) const |
MythGenericTree * | getVisibleChildAt (uint reference) const |
MythGenericTree * | getChildAt (uint reference) const |
MythGenericTree * | getChildByName (const QString &a_name) const |
MythGenericTree * | getChildById (int an_int) const |
QList< MythGenericTree * > * | getAllChildren () const |
int | getChildPosition (MythGenericTree *child) const |
int | getPosition (void) |
QList< int > | getRouteById (void) |
QStringList | getRouteByString (void) |
QList< MythGenericTree * > | getRoute (void) |
void | setInt (int an_int) |
int | getInt () const |
void | setParent (MythGenericTree *a_parent) |
MythGenericTree * | getParent (void) const |
void | SetText (const QString &text, const QString &name="", const QString &state="") |
void | SetTextFromMap (const InfoMap &infoMap, const QString &state="") |
void | SetTextCb (mgtCbFn fn, void *data) |
QString | GetText (const QString &name="") const |
QString | GetSortText () const |
void | SetSortText (const QString &text) |
void | SetImage (const QString &filename, const QString &name="") |
void | SetImageFromMap (const InfoMap &infoMap) |
void | SetImageCb (mgtCbFn fn, void *data) |
QString | GetImage (const QString &name="") const |
void | DisplayState (const QString &state, const QString &name="") |
void | DisplayStateFromMap (const InfoMap &infoMap) |
void | SetStateCb (mgtCbFn fn, void *data) |
QString | GetState (const QString &name="") const |
void | SetData (QVariant data) |
QVariant | GetData (void) const |
int | childCount (void) const |
uint | visibleChildCount () const |
int | siblingCount (void) const |
int | currentDepth (void) |
Establish how deep in the current tree this node lies. More... | |
void | setSelectable (bool flag) |
bool | isSelectable () const |
void | SetVisible (bool visible) |
bool | IsVisible () const |
void | IncVisibleCount () |
void | DecVisibleCount () |
void | becomeSelectedChild (void) |
void | setSelectedChild (MythGenericTree *a_node) |
void | sortByString () |
void | sortBySelectable () |
void | deleteAllChildren () |
void | MoveItemUpDown (MythGenericTree *item, bool flag) |
virtual MythUIButtonListItem * | CreateListButton (MythUIButtonList *list) |
Private Types | |
using | IntVector = QVector< int > |
Private Member Functions | |
void | reorderSubnodes (void) |
Private Attributes | |
QString | m_text |
QString | m_sortText |
QMap< QString, TextProperties > | m_strings |
InfoMap | m_imageFilenames |
InfoMap | m_states |
mgtCbInfo | m_textCb |
mgtCbInfo | m_imageCb |
mgtCbInfo | m_stateCb |
int | m_int {0} |
QVariant | m_data {0} |
uint | m_visibleCount {0} |
SortableMythGenericTreeList * | m_subnodes {nullptr} |
MythGenericTree * | m_selectedSubnode {nullptr} |
MythGenericTree * | m_parent {nullptr} |
bool | m_selectable {false} |
bool | m_visible {true} |
Definition at line 27 of file mythgenerictree.h.
|
private |
Definition at line 29 of file mythgenerictree.h.
|
explicit |
Definition at line 62 of file mythgenerictree.cpp.
Referenced by addNode().
|
virtual |
Definition at line 72 of file mythgenerictree.cpp.
void MythGenericTree::ensureSortFields | ( | void | ) |
Definition at line 78 of file mythgenerictree.cpp.
Referenced by MythGenericTree(), and SetText().
MythGenericTree * MythGenericTree::addNode | ( | const QString & | a_string, |
int | an_int = 0 , |
||
bool | selectable_flag = false , |
||
bool | visible = true |
||
) |
Definition at line 85 of file mythgenerictree.cpp.
Referenced by AddDirNode(), AddFileNode(), NetTree::AddFileNode(), addNode(), NetTree::BuildGenericTree(), GameUI::BuildTree(), GameUI::fillNode(), NetTree::FillTree(), and MusicGenericTree::MusicGenericTree().
MythGenericTree * MythGenericTree::addNode | ( | const QString & | a_string, |
const QString & | sortText = "" , |
||
int | an_int = 0 , |
||
bool | selectable_flag = false , |
||
bool | visible = true |
||
) |
Definition at line 94 of file mythgenerictree.cpp.
MythGenericTree * MythGenericTree::addNode | ( | MythGenericTree * | child | ) |
Definition at line 106 of file mythgenerictree.cpp.
void MythGenericTree::DetachParent | ( | void | ) |
Detach this node/branch from it's parent without deleting it, it can then be reattached elsewhere or used on it's own.
Definition at line 116 of file mythgenerictree.cpp.
void MythGenericTree::removeNode | ( | MythGenericTree * | child | ) |
Definition at line 124 of file mythgenerictree.cpp.
Referenced by deleteNode(), and DetachParent().
void MythGenericTree::deleteNode | ( | MythGenericTree * | child | ) |
Definition at line 139 of file mythgenerictree.cpp.
Referenced by VideoDialog::OnRemoveVideo().
MythGenericTree * MythGenericTree::findLeaf | ( | ) |
Definition at line 148 of file mythgenerictree.cpp.
MythGenericTree * MythGenericTree::findNode | ( | QList< int > | route_of_branches | ) |
Definition at line 156 of file mythgenerictree.cpp.
Referenced by MythUIButtonTree::SetNodeById().
MythGenericTree * MythGenericTree::nextSibling | ( | int | number_down | ) |
Definition at line 351 of file mythgenerictree.cpp.
MythGenericTree * MythGenericTree::prevSibling | ( | int | number_up | ) |
Definition at line 332 of file mythgenerictree.cpp.
MythGenericTree * MythGenericTree::getSelectedChild | ( | bool | onlyVisible = false | ) | const |
Definition at line 310 of file mythgenerictree.cpp.
Referenced by MythUIButtonTree::AssignTree(), NetTree::LoadData(), VideoDialog::loadData(), MythUIButtonTree::SetTreeState(), and MythUIButtonTree::UpdateList().
MythGenericTree * MythGenericTree::getVisibleChildAt | ( | uint | reference | ) | const |
Definition at line 289 of file mythgenerictree.cpp.
Referenced by VideoDialog::GetCoverImage(), VideoDialog::GetFirstImage(), and getSelectedChild().
MythGenericTree * MythGenericTree::getChildAt | ( | uint | reference | ) | const |
Definition at line 281 of file mythgenerictree.cpp.
Referenced by PlaylistEditorView::Create(), VideoDialog::fetchVideos(), getSelectedChild(), VideoDialog::Load(), nextSibling(), VideoDialog::playFolder(), prevSibling(), VideoDialog::refreshData(), VideoDialog::scanFinished(), VideoDialog::searchComplete(), MythUIButtonTree::SetNodeByString(), PlaylistEditorView::updateSelectedTracks(), and PlaylistEditorView::updateSonglist().
MythGenericTree * MythGenericTree::getChildByName | ( | const QString & | a_name | ) | const |
Definition at line 377 of file mythgenerictree.cpp.
Referenced by NetTree::BuildGenericTree(), VideoDialog::loadData(), PlaylistEditorView::restoreTreePosition(), GameUI::searchComplete(), and MythUIButtonTree::SetNodeByString().
MythGenericTree * MythGenericTree::getChildById | ( | int | an_int | ) | const |
Definition at line 398 of file mythgenerictree.cpp.
QList< MythGenericTree * > * MythGenericTree::getAllChildren | ( | ) | const |
Definition at line 276 of file mythgenerictree.cpp.
Referenced by findNode(), getChildById(), getChildByName(), VideoDialog::GetItemByMetadata(), NetTree::LoadData(), VideoDialog::loadData(), GameUI::resetOtherTrees(), VideoDialog::searchComplete(), GameUI::searchStart(), VideoDialog::searchStart(), sortByString(), MythUIButtonTree::UpdateList(), PlaylistEditorView::updateSonglist(), and VideoDialog::VideoAutoSearch().
int MythGenericTree::getChildPosition | ( | MythGenericTree * | child | ) | const |
Definition at line 200 of file mythgenerictree.cpp.
Referenced by getPosition(), nextSibling(), and prevSibling().
int MythGenericTree::getPosition | ( | void | ) |
Definition at line 205 of file mythgenerictree.cpp.
Referenced by PlaylistEditorView::treeNodeChanged().
QList< int > MythGenericTree::getRouteById | ( | void | ) |
Definition at line 212 of file mythgenerictree.cpp.
QStringList MythGenericTree::getRouteByString | ( | void | ) |
Definition at line 226 of file mythgenerictree.cpp.
Referenced by VideoDialog::handleDynamicDirSelect(), PlaylistEditorView::reloadTree(), VideoDialog::SavePosition(), PlaylistEditorView::saveTreePosition(), MythUIButtonTree::SetCurrentNode(), PlaylistEditorView::treeNodeChanged(), and VideoDialog::UpdateText().
QList< MythGenericTree * > MythGenericTree::getRoute | ( | void | ) |
Definition at line 240 of file mythgenerictree.cpp.
Referenced by currentDepth(), and MythUIButtonTree::SetTreeState().
|
inline |
Definition at line 72 of file mythgenerictree.h.
Referenced by VideoListImp::build_generic_tree().
|
inline |
Definition at line 73 of file mythgenerictree.h.
Referenced by AddFileNode(), PlaylistEditorView::deletePlaylist(), VideoDialog::fetchVideos(), GameUI::fillNode(), findNode(), VideoDialog::GetBanner(), getChildById(), GameUI::getChildLevelString(), VideoDialog::GetCoverImage(), VideoDialog::GetFanart(), GameUI::getFillSql(), GameUI::getFilter(), GameUI::getLevelsOnThisBranch(), VideoDialog::GetMetadata(), getRouteById(), VideoDialog::GetScreenshot(), PlaylistEditorView::getSmartPlaylists(), VideoDialog::handleSelect(), NetTree::HandleSelect(), GameUI::isLeaf(), VideoDialog::keyPressEvent(), VideoDialog::Load(), VideoDialog::loadData(), VideoDialog::playFolder(), VideoDialog::refreshData(), VideoDialog::scanFinished(), PlaylistEditorView::treeItemClicked(), NetTree::UpdateItem(), VideoDialog::UpdateItem(), PlaylistEditorView::updateSonglist(), VideoDialog::UpdateText(), and VideoDialog::VideoMenu().
|
inline |
Definition at line 75 of file mythgenerictree.h.
Referenced by addNode(), and removeNode().
MythGenericTree * MythGenericTree::getParent | ( | void | ) | const |
Definition at line 370 of file mythgenerictree.cpp.
Referenced by VideoListImp::build_generic_tree(), PlaylistEditorView::deleteSmartPlaylist(), PlaylistEditorView::filterTracks(), GameUI::getChildLevelString(), GameUI::getFilter(), GameUI::getLevelsOnThisBranch(), getRoute(), getRouteById(), getRouteByString(), NetTree::GoBack(), VideoDialog::goBack(), PlaylistEditorView::keyPressEvent(), VideoDialog::OnRemoveVideo(), GameUI::resetOtherTrees(), GameUI::searchComplete(), VideoDialog::searchComplete(), GameUI::searchStart(), VideoDialog::searchStart(), GameUI::updateChangedNode(), VideoDialog::UpdateItem(), and PlaylistEditorView::updateSonglist().
void MythGenericTree::SetText | ( | const QString & | text, |
const QString & | name = "" , |
||
const QString & | state = "" |
||
) |
Definition at line 517 of file mythgenerictree.cpp.
Referenced by AddDirNode(), GameUI::customEvent(), and NetTree::SetSubfolderData().
void MythGenericTree::SetTextFromMap | ( | const InfoMap & | infoMap, |
const QString & | state = "" |
||
) |
Definition at line 535 of file mythgenerictree.cpp.
Referenced by NetTree::AddFileNode().
void MythGenericTree::SetTextCb | ( | mgtCbFn | fn, |
void * | data | ||
) |
Definition at line 549 of file mythgenerictree.cpp.
Referenced by AddFileNode().
QString MythGenericTree::GetText | ( | const QString & | name = "" | ) | const |
Definition at line 555 of file mythgenerictree.cpp.
Referenced by AddDirNode(), MusicGenericTree::CreateListButton(), CreateListButton(), PlaylistEditorView::customEvent(), NetTree::customEvent(), PlaylistEditorView::deleteSmartPlaylist(), PlaylistEditorView::filterTracks(), getChildByName(), GameUI::getFillSql(), VideoDialog::GetFirstImage(), getRouteByString(), GameUI::itemClicked(), PlaylistEditorView::keyPressEvent(), VideoDialog::loadData(), GameUI::searchStart(), MythUIButtonTree::SetNodeByString(), GameUI::ShowMenu(), NetTree::UpdateItem(), VideoDialog::UpdateItem(), VideoDialog::UpdateText(), and VideoDialog::VideoAutoSearch().
|
inline |
Definition at line 84 of file mythgenerictree.h.
Referenced by SortableMythGenericTreeList::sortByString().
|
inline |
Definition at line 85 of file mythgenerictree.h.
void MythGenericTree::SetImage | ( | const QString & | filename, |
const QString & | name = "" |
||
) |
Definition at line 572 of file mythgenerictree.cpp.
Referenced by AddFileNode().
void MythGenericTree::SetImageFromMap | ( | const InfoMap & | infoMap | ) |
Definition at line 578 of file mythgenerictree.cpp.
Referenced by AddFileNode().
void MythGenericTree::SetImageCb | ( | mgtCbFn | fn, |
void * | data | ||
) |
Definition at line 584 of file mythgenerictree.cpp.
Referenced by AddFileNode().
QString MythGenericTree::GetImage | ( | const QString & | name = "" | ) | const |
Definition at line 590 of file mythgenerictree.cpp.
void MythGenericTree::DisplayState | ( | const QString & | state, |
const QString & | name = "" |
||
) |
Definition at line 621 of file mythgenerictree.cpp.
Referenced by AddDirNode(), and NetTree::SetSubfolderData().
void MythGenericTree::DisplayStateFromMap | ( | const InfoMap & | infoMap | ) |
Definition at line 609 of file mythgenerictree.cpp.
void MythGenericTree::SetStateCb | ( | mgtCbFn | fn, |
void * | data | ||
) |
Definition at line 615 of file mythgenerictree.cpp.
Referenced by AddFileNode().
QString MythGenericTree::GetState | ( | const QString & | name = "" | ) | const |
Definition at line 627 of file mythgenerictree.cpp.
|
inline |
Definition at line 97 of file mythgenerictree.h.
Referenced by AddDirNode(), AddFileNode(), NetTree::AddFileNode(), VideoListImp::build_generic_tree(), NetTree::BuildGenericTree(), and GameUI::customEvent().
|
inline |
Definition at line 98 of file mythgenerictree.h.
Referenced by GameUI::customEvent(), GameUI::edit(), GameUI::fillNode(), PlaylistEditorView::filterTracks(), GameUI::gameSearch(), GameUI::getChildLevelString(), VideoDialog::GetCoverImage(), GameUI::getFillSql(), GameUI::getFilter(), GameUI::getLevelsOnThisBranch(), anonymous_namespace{videodlg.cpp}::GetMetadataPtrFromNode(), NetTree::GetStreamItem(), GameUI::handleDownloadedImages(), GameUI::itemClicked(), GameUI::nodeChanged(), GameUI::OnGameSearchDone(), VideoListImp::refreshNode(), GameUI::showInfo(), GameUI::ShowMenu(), NetTree::ShowMenu(), NetTree::SlotItemChanged(), GameUI::StartGameImageSet(), GameUI::toggleFavorite(), NetTree::UpdateCurrentItem(), NetTree::UpdateItem(), and PlaylistEditorView::updateSonglist().
int MythGenericTree::childCount | ( | void | ) | const |
Definition at line 254 of file mythgenerictree.cpp.
Referenced by VideoDialog::fetchVideos(), VideoDialog::GetFirstImage(), PlaylistEditorView::getPlaylistTracks(), PlaylistEditorView::getSmartPlaylistTracks(), VideoDialog::Load(), NetTree::LoadData(), VideoDialog::loadData(), nextSibling(), GameUI::nodeChanged(), VideoDialog::playFolder(), VideoDialog::refreshData(), VideoDialog::scanFinished(), siblingCount(), and PlaylistEditorView::updateSelectedTracks().
|
inline |
Definition at line 101 of file mythgenerictree.h.
Referenced by AddFileNode(), MythUIButtonTree::AssignTree(), MusicGenericTree::CreateListButton(), CreateListButton(), VideoDialog::GetCoverImage(), VideoDialog::GetFirstImage(), MythUIButtonTree::keyPressEvent(), NetTree::SetSubfolderData(), MythUIButtonTree::SwitchList(), NetTree::UpdateItem(), VideoDialog::UpdateItem(), and VideoDialog::UpdateText().
int MythGenericTree::siblingCount | ( | void | ) | const |
Definition at line 259 of file mythgenerictree.cpp.
Referenced by PlaylistEditorView::treeNodeChanged().
int MythGenericTree::currentDepth | ( | void | ) |
Establish how deep in the current tree this node lies.
Definition at line 269 of file mythgenerictree.cpp.
Referenced by MythUIButtonTree::AssignTree(), and MythUIButtonTree::SetNodeByString().
|
inline |
Definition at line 106 of file mythgenerictree.h.
Referenced by MusicGenericTree::MusicGenericTree().
|
inline |
Definition at line 107 of file mythgenerictree.h.
Referenced by MythUIButtonTree::SetNodeById(), and SortableMythGenericTreeList::sortBySelectable().
void MythGenericTree::SetVisible | ( | bool | visible | ) |
Definition at line 484 of file mythgenerictree.cpp.
|
inline |
Definition at line 110 of file mythgenerictree.h.
Referenced by addNode(), removeNode(), and MythUIButtonTree::UpdateList().
|
inline |
Definition at line 112 of file mythgenerictree.h.
Referenced by addNode(), and SetVisible().
|
inline |
Definition at line 113 of file mythgenerictree.h.
Referenced by removeNode(), and SetVisible().
void MythGenericTree::becomeSelectedChild | ( | void | ) |
Definition at line 324 of file mythgenerictree.cpp.
Referenced by MythUIButtonTree::DoSetCurrentNode(), MythUIButtonTree::SetNodeByString(), and VideoDialog::UpdateText().
|
inline |
Definition at line 116 of file mythgenerictree.h.
Referenced by becomeSelectedChild().
void MythGenericTree::sortByString | ( | ) |
Definition at line 419 of file mythgenerictree.cpp.
Referenced by NetTree::FillTree(), PlaylistEditorView::filterTracks(), and sortByString().
void MythGenericTree::sortBySelectable | ( | ) |
Definition at line 439 of file mythgenerictree.cpp.
Referenced by sortBySelectable().
void MythGenericTree::deleteAllChildren | ( | ) |
Definition at line 453 of file mythgenerictree.cpp.
Referenced by GameUI::nodeChanged(), PlaylistEditorView::reloadTree(), GameUI::resetOtherTrees(), and ~MythGenericTree().
void MythGenericTree::MoveItemUpDown | ( | MythGenericTree * | item, |
bool | flag | ||
) |
Definition at line 465 of file mythgenerictree.cpp.
|
virtual |
Reimplemented in MusicGenericTree.
Definition at line 500 of file mythgenerictree.cpp.
Referenced by MythUIButtonTree::UpdateList().
|
private |
|
private |
Definition at line 130 of file mythgenerictree.h.
Referenced by ensureSortFields(), GetText(), and SetText().
|
private |
Definition at line 131 of file mythgenerictree.h.
Referenced by ensureSortFields(), and SetText().
|
private |
Definition at line 132 of file mythgenerictree.h.
Referenced by CreateListButton(), GetText(), SetText(), and SetTextFromMap().
|
private |
Definition at line 133 of file mythgenerictree.h.
Referenced by CreateListButton(), GetImage(), SetImage(), and SetImageFromMap().
|
private |
Definition at line 134 of file mythgenerictree.h.
Referenced by CreateListButton(), DisplayState(), DisplayStateFromMap(), and GetState().
|
private |
Definition at line 135 of file mythgenerictree.h.
Referenced by CreateListButton(), GetText(), and SetTextCb().
|
private |
Definition at line 136 of file mythgenerictree.h.
Referenced by CreateListButton(), GetImage(), and SetImageCb().
|
private |
Definition at line 137 of file mythgenerictree.h.
Referenced by CreateListButton(), GetState(), and SetStateCb().
|
private |
Definition at line 138 of file mythgenerictree.h.
|
private |
Definition at line 139 of file mythgenerictree.h.
|
private |
Definition at line 140 of file mythgenerictree.h.
|
private |
Definition at line 142 of file mythgenerictree.h.
Referenced by addNode(), childCount(), deleteAllChildren(), findLeaf(), getAllChildren(), getChildAt(), getChildPosition(), getVisibleChildAt(), MoveItemUpDown(), removeNode(), sortBySelectable(), sortByString(), and ~MythGenericTree().
|
private |
Definition at line 144 of file mythgenerictree.h.
Referenced by deleteAllChildren(), getSelectedChild(), and removeNode().
|
private |
Definition at line 145 of file mythgenerictree.h.
Referenced by becomeSelectedChild(), DetachParent(), getParent(), getPosition(), nextSibling(), prevSibling(), SetVisible(), and siblingCount().
Definition at line 147 of file mythgenerictree.h.
Definition at line 148 of file mythgenerictree.h.
Referenced by SetVisible().