MythTV  master
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
MythGenericTree Class Reference

#include <mythgenerictree.h>

Inheritance diagram for MythGenericTree:
Inheritance graph
[legend]
Collaboration diagram for MythGenericTree:
Collaboration graph
[legend]

Public Member Functions

 MythGenericTree (QString a_string="", int an_int=0, bool selectable_flag=false)
 
virtual ~MythGenericTree ()
 
void ensureSortFields (void)
 
MythGenericTreeaddNode (const QString &a_string, int an_int=0, bool selectable_flag=false, bool visible=true)
 
MythGenericTreeaddNode (const QString &a_string, const QString &sortText="", int an_int=0, bool selectable_flag=false, bool visible=true)
 
MythGenericTreeaddNode (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)
 
MythGenericTreefindLeaf ()
 
MythGenericTreefindNode (QList< int > route_of_branches)
 
MythGenericTreenextSibling (int number_down)
 
MythGenericTreeprevSibling (int number_up)
 
MythGenericTreegetSelectedChild (bool onlyVisible=false) const
 
MythGenericTreegetVisibleChildAt (uint reference) const
 
MythGenericTreegetChildAt (uint reference) const
 
MythGenericTreegetChildByName (const QString &a_name) const
 
MythGenericTreegetChildById (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)
 
MythGenericTreegetParent (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 MythUIButtonListItemCreateListButton (MythUIButtonList *list)
 

Private Types

using IntVector = QVector< int >
 

Private Member Functions

void reorderSubnodes (void)
 

Private Attributes

QString m_text
 
QString m_sortText
 
QMap< QString, TextPropertiesm_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}
 
SortableMythGenericTreeListm_subnodes {nullptr}
 
MythGenericTreem_selectedSubnode {nullptr}
 
MythGenericTreem_parent {nullptr}
 
bool m_selectable {false}
 
bool m_visible {true}
 

Detailed Description

Definition at line 27 of file mythgenerictree.h.

Member Typedef Documentation

◆ IntVector

using MythGenericTree::IntVector = QVector<int>
private

Definition at line 29 of file mythgenerictree.h.

Constructor & Destructor Documentation

◆ MythGenericTree()

MythGenericTree::MythGenericTree ( QString  a_string = "",
int  an_int = 0,
bool  selectable_flag = false 
)
explicit

Definition at line 62 of file mythgenerictree.cpp.

Referenced by addNode().

◆ ~MythGenericTree()

MythGenericTree::~MythGenericTree ( )
virtual

Definition at line 73 of file mythgenerictree.cpp.

Member Function Documentation

◆ ensureSortFields()

void MythGenericTree::ensureSortFields ( void  )

Definition at line 79 of file mythgenerictree.cpp.

Referenced by MythGenericTree(), and SetText().

◆ addNode() [1/3]

MythGenericTree * MythGenericTree::addNode ( const QString &  a_string,
int  an_int = 0,
bool  selectable_flag = false,
bool  visible = true 
)

◆ addNode() [2/3]

MythGenericTree * MythGenericTree::addNode ( const QString &  a_string,
const QString &  sortText = "",
int  an_int = 0,
bool  selectable_flag = false,
bool  visible = true 
)

Definition at line 95 of file mythgenerictree.cpp.

◆ addNode() [3/3]

MythGenericTree * MythGenericTree::addNode ( MythGenericTree child)

Definition at line 107 of file mythgenerictree.cpp.

◆ DetachParent()

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 117 of file mythgenerictree.cpp.

◆ removeNode()

void MythGenericTree::removeNode ( MythGenericTree child)

Definition at line 125 of file mythgenerictree.cpp.

Referenced by deleteNode(), and DetachParent().

◆ deleteNode()

void MythGenericTree::deleteNode ( MythGenericTree child)

Definition at line 140 of file mythgenerictree.cpp.

Referenced by VideoDialog::OnRemoveVideo().

◆ findLeaf()

MythGenericTree * MythGenericTree::findLeaf ( )

Definition at line 149 of file mythgenerictree.cpp.

◆ findNode()

MythGenericTree * MythGenericTree::findNode ( QList< int >  route_of_branches)

Definition at line 157 of file mythgenerictree.cpp.

Referenced by MythUIButtonTree::SetNodeById().

◆ nextSibling()

MythGenericTree * MythGenericTree::nextSibling ( int  number_down)

Definition at line 352 of file mythgenerictree.cpp.

◆ prevSibling()

MythGenericTree * MythGenericTree::prevSibling ( int  number_up)

Definition at line 333 of file mythgenerictree.cpp.

◆ getSelectedChild()

MythGenericTree * MythGenericTree::getSelectedChild ( bool  onlyVisible = false) const

◆ getVisibleChildAt()

MythGenericTree * MythGenericTree::getVisibleChildAt ( uint  reference) const

◆ getChildAt()

MythGenericTree * MythGenericTree::getChildAt ( uint  reference) const

◆ getChildByName()

MythGenericTree * MythGenericTree::getChildByName ( const QString &  a_name) const

◆ getChildById()

MythGenericTree * MythGenericTree::getChildById ( int  an_int) const

Definition at line 399 of file mythgenerictree.cpp.

◆ getAllChildren()

QList< MythGenericTree * > * MythGenericTree::getAllChildren ( ) const

◆ getChildPosition()

int MythGenericTree::getChildPosition ( MythGenericTree child) const

Definition at line 201 of file mythgenerictree.cpp.

Referenced by getPosition(), nextSibling(), and prevSibling().

◆ getPosition()

int MythGenericTree::getPosition ( void  )

Definition at line 206 of file mythgenerictree.cpp.

Referenced by PlaylistEditorView::treeNodeChanged().

◆ getRouteById()

QList< int > MythGenericTree::getRouteById ( void  )

Definition at line 213 of file mythgenerictree.cpp.

◆ getRouteByString()

QStringList MythGenericTree::getRouteByString ( void  )

◆ getRoute()

QList< MythGenericTree * > MythGenericTree::getRoute ( void  )

Definition at line 241 of file mythgenerictree.cpp.

Referenced by currentDepth(), and MythUIButtonTree::SetTreeState().

◆ setInt()

void MythGenericTree::setInt ( int  an_int)
inline

Definition at line 72 of file mythgenerictree.h.

Referenced by VideoListImp::build_generic_tree().

◆ getInt()

int MythGenericTree::getInt ( ) const
inline

◆ setParent()

void MythGenericTree::setParent ( MythGenericTree a_parent)
inline

Definition at line 75 of file mythgenerictree.h.

Referenced by addNode(), and removeNode().

◆ getParent()

MythGenericTree * MythGenericTree::getParent ( void  ) const

◆ SetText()

void MythGenericTree::SetText ( const QString &  text,
const QString &  name = "",
const QString &  state = "" 
)

Definition at line 518 of file mythgenerictree.cpp.

Referenced by AddDirNode(), GameUI::customEvent(), and NetTree::SetSubfolderData().

◆ SetTextFromMap()

void MythGenericTree::SetTextFromMap ( const InfoMap infoMap,
const QString &  state = "" 
)

Definition at line 536 of file mythgenerictree.cpp.

Referenced by NetTree::AddFileNode().

◆ SetTextCb()

void MythGenericTree::SetTextCb ( mgtCbFn  fn,
void *  data 
)

Definition at line 550 of file mythgenerictree.cpp.

Referenced by AddFileNode().

◆ GetText()

QString MythGenericTree::GetText ( const QString &  name = "") const

◆ GetSortText()

QString MythGenericTree::GetSortText ( ) const
inline

Definition at line 84 of file mythgenerictree.h.

Referenced by SortableMythGenericTreeList::sortByString().

◆ SetSortText()

void MythGenericTree::SetSortText ( const QString &  text)
inline

Definition at line 85 of file mythgenerictree.h.

◆ SetImage()

void MythGenericTree::SetImage ( const QString &  filename,
const QString &  name = "" 
)

Definition at line 573 of file mythgenerictree.cpp.

Referenced by AddFileNode().

◆ SetImageFromMap()

void MythGenericTree::SetImageFromMap ( const InfoMap infoMap)

Definition at line 579 of file mythgenerictree.cpp.

Referenced by AddFileNode().

◆ SetImageCb()

void MythGenericTree::SetImageCb ( mgtCbFn  fn,
void *  data 
)

Definition at line 585 of file mythgenerictree.cpp.

Referenced by AddFileNode().

◆ GetImage()

QString MythGenericTree::GetImage ( const QString &  name = "") const

Definition at line 591 of file mythgenerictree.cpp.

◆ DisplayState()

void MythGenericTree::DisplayState ( const QString &  state,
const QString &  name = "" 
)

Definition at line 622 of file mythgenerictree.cpp.

Referenced by AddDirNode(), and NetTree::SetSubfolderData().

◆ DisplayStateFromMap()

void MythGenericTree::DisplayStateFromMap ( const InfoMap infoMap)

Definition at line 610 of file mythgenerictree.cpp.

◆ SetStateCb()

void MythGenericTree::SetStateCb ( mgtCbFn  fn,
void *  data 
)

Definition at line 616 of file mythgenerictree.cpp.

Referenced by AddFileNode().

◆ GetState()

QString MythGenericTree::GetState ( const QString &  name = "") const

Definition at line 628 of file mythgenerictree.cpp.

◆ SetData()

void MythGenericTree::SetData ( QVariant  data)
inline

◆ GetData()

QVariant MythGenericTree::GetData ( void  ) const
inline

◆ childCount()

int MythGenericTree::childCount ( void  ) const

◆ visibleChildCount()

uint MythGenericTree::visibleChildCount ( ) const
inline

◆ siblingCount()

int MythGenericTree::siblingCount ( void  ) const

Definition at line 260 of file mythgenerictree.cpp.

Referenced by PlaylistEditorView::treeNodeChanged().

◆ currentDepth()

int MythGenericTree::currentDepth ( void  )

Establish how deep in the current tree this node lies.

Definition at line 270 of file mythgenerictree.cpp.

Referenced by MythUIButtonTree::AssignTree(), and MythUIButtonTree::SetNodeByString().

◆ setSelectable()

void MythGenericTree::setSelectable ( bool  flag)
inline

Definition at line 106 of file mythgenerictree.h.

Referenced by MusicGenericTree::MusicGenericTree().

◆ isSelectable()

bool MythGenericTree::isSelectable ( ) const
inline

◆ SetVisible()

void MythGenericTree::SetVisible ( bool  visible)

Definition at line 485 of file mythgenerictree.cpp.

◆ IsVisible()

bool MythGenericTree::IsVisible ( ) const
inline

Definition at line 110 of file mythgenerictree.h.

Referenced by addNode(), removeNode(), and MythUIButtonTree::UpdateList().

◆ IncVisibleCount()

void MythGenericTree::IncVisibleCount ( )
inline

Definition at line 112 of file mythgenerictree.h.

Referenced by addNode(), and SetVisible().

◆ DecVisibleCount()

void MythGenericTree::DecVisibleCount ( )
inline

Definition at line 113 of file mythgenerictree.h.

Referenced by removeNode(), and SetVisible().

◆ becomeSelectedChild()

void MythGenericTree::becomeSelectedChild ( void  )

◆ setSelectedChild()

void MythGenericTree::setSelectedChild ( MythGenericTree a_node)
inline

Definition at line 116 of file mythgenerictree.h.

Referenced by becomeSelectedChild().

◆ sortByString()

void MythGenericTree::sortByString ( )

◆ sortBySelectable()

void MythGenericTree::sortBySelectable ( )

Definition at line 440 of file mythgenerictree.cpp.

Referenced by sortBySelectable().

◆ deleteAllChildren()

void MythGenericTree::deleteAllChildren ( )

◆ MoveItemUpDown()

void MythGenericTree::MoveItemUpDown ( MythGenericTree item,
bool  flag 
)

Definition at line 466 of file mythgenerictree.cpp.

◆ CreateListButton()

MythUIButtonListItem * MythGenericTree::CreateListButton ( MythUIButtonList list)
virtual

Reimplemented in MusicGenericTree.

Definition at line 501 of file mythgenerictree.cpp.

Referenced by MythUIButtonTree::UpdateList().

◆ reorderSubnodes()

void MythGenericTree::reorderSubnodes ( void  )
private

Member Data Documentation

◆ m_text

QString MythGenericTree::m_text
private

Definition at line 130 of file mythgenerictree.h.

Referenced by ensureSortFields(), GetText(), and SetText().

◆ m_sortText

QString MythGenericTree::m_sortText
private

Definition at line 131 of file mythgenerictree.h.

Referenced by ensureSortFields(), and SetText().

◆ m_strings

QMap<QString, TextProperties> MythGenericTree::m_strings
private

Definition at line 132 of file mythgenerictree.h.

Referenced by CreateListButton(), GetText(), SetText(), and SetTextFromMap().

◆ m_imageFilenames

InfoMap MythGenericTree::m_imageFilenames
private

Definition at line 133 of file mythgenerictree.h.

Referenced by CreateListButton(), GetImage(), SetImage(), and SetImageFromMap().

◆ m_states

InfoMap MythGenericTree::m_states
private

Definition at line 134 of file mythgenerictree.h.

Referenced by CreateListButton(), DisplayState(), DisplayStateFromMap(), and GetState().

◆ m_textCb

mgtCbInfo MythGenericTree::m_textCb
private

Definition at line 135 of file mythgenerictree.h.

Referenced by CreateListButton(), GetText(), and SetTextCb().

◆ m_imageCb

mgtCbInfo MythGenericTree::m_imageCb
private

Definition at line 136 of file mythgenerictree.h.

Referenced by CreateListButton(), GetImage(), and SetImageCb().

◆ m_stateCb

mgtCbInfo MythGenericTree::m_stateCb
private

Definition at line 137 of file mythgenerictree.h.

Referenced by CreateListButton(), GetState(), and SetStateCb().

◆ m_int

int MythGenericTree::m_int {0}
private

Definition at line 138 of file mythgenerictree.h.

◆ m_data

QVariant MythGenericTree::m_data {0}
private

Definition at line 139 of file mythgenerictree.h.

◆ m_visibleCount

uint MythGenericTree::m_visibleCount {0}
private

Definition at line 140 of file mythgenerictree.h.

◆ m_subnodes

SortableMythGenericTreeList* MythGenericTree::m_subnodes {nullptr}
private

◆ m_selectedSubnode

MythGenericTree* MythGenericTree::m_selectedSubnode {nullptr}
private

Definition at line 144 of file mythgenerictree.h.

Referenced by deleteAllChildren(), getSelectedChild(), and removeNode().

◆ m_parent

MythGenericTree* MythGenericTree::m_parent {nullptr}
private

◆ m_selectable

bool MythGenericTree::m_selectable {false}
private

Definition at line 147 of file mythgenerictree.h.

◆ m_visible

bool MythGenericTree::m_visible {true}
private

Definition at line 148 of file mythgenerictree.h.

Referenced by SetVisible().


The documentation for this class was generated from the following files: