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 (const 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="")
 
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)
 
QString GetImage (const QString &name="") const
 
void DisplayState (const QString &state, const QString &name="")
 
void DisplayStateFromMap (const InfoMap &infoMap)
 
QString GetState (const QString &name="") const
 
void SetData (QVariant data)
 
const 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

typedef QVector< int > IntVector
 

Private Member Functions

void reorderSubnodes (void)
 

Private Attributes

QString m_text
 
QString m_sortText
 
QMap< QString, TextPropertiesm_strings
 
InfoMap m_imageFilenames
 
InfoMap m_states
 
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 19 of file mythgenerictree.h.

Member Typedef Documentation

◆ IntVector

typedef QVector<int> MythGenericTree::IntVector
private

Definition at line 21 of file mythgenerictree.h.

Constructor & Destructor Documentation

◆ MythGenericTree()

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

Definition at line 62 of file mythgenerictree.cpp.

Referenced by addNode().

◆ ~MythGenericTree()

MythGenericTree::~MythGenericTree ( )
virtual

Definition at line 74 of file mythgenerictree.cpp.

Member Function Documentation

◆ ensureSortFields()

void MythGenericTree::ensureSortFields ( void  )

Definition at line 80 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 96 of file mythgenerictree.cpp.

◆ addNode() [3/3]

MythGenericTree * MythGenericTree::addNode ( MythGenericTree child)

Definition at line 108 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 118 of file mythgenerictree.cpp.

◆ removeNode()

void MythGenericTree::removeNode ( MythGenericTree child)

Definition at line 126 of file mythgenerictree.cpp.

Referenced by deleteNode(), and DetachParent().

◆ deleteNode()

void MythGenericTree::deleteNode ( MythGenericTree child)

◆ findLeaf()

MythGenericTree * MythGenericTree::findLeaf ( )

Definition at line 150 of file mythgenerictree.cpp.

◆ findNode()

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

Definition at line 158 of file mythgenerictree.cpp.

Referenced by MythUIButtonTree::SetNodeById().

◆ nextSibling()

MythGenericTree * MythGenericTree::nextSibling ( int  number_down)

Definition at line 354 of file mythgenerictree.cpp.

◆ prevSibling()

MythGenericTree * MythGenericTree::prevSibling ( int  number_up)

Definition at line 335 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 401 of file mythgenerictree.cpp.

◆ getAllChildren()

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

◆ getChildPosition()

int MythGenericTree::getChildPosition ( MythGenericTree child) const

Definition at line 202 of file mythgenerictree.cpp.

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

◆ getPosition()

int MythGenericTree::getPosition ( void  )

◆ getRouteById()

QList< int > MythGenericTree::getRouteById ( void  )

Definition at line 214 of file mythgenerictree.cpp.

◆ getRouteByString()

QStringList MythGenericTree::getRouteByString ( void  )

◆ getRoute()

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

Definition at line 242 of file mythgenerictree.cpp.

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

◆ setInt()

void MythGenericTree::setInt ( int  an_int)
inline

◆ getInt()

int MythGenericTree::getInt ( ) const
inline

◆ setParent()

void MythGenericTree::setParent ( MythGenericTree a_parent)
inline

Definition at line 67 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(), and AddFileNode().

◆ GetText()

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

◆ GetSortText()

QString MythGenericTree::GetSortText ( ) const
inline

Definition at line 75 of file mythgenerictree.h.

Referenced by SortableMythGenericTreeList::sortByString().

◆ SetSortText()

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

Definition at line 76 of file mythgenerictree.h.

Referenced by addNode(), and PlaylistEditorView::filterTracks().

◆ SetImage()

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

Definition at line 559 of file mythgenerictree.cpp.

Referenced by AddFileNode().

◆ SetImageFromMap()

void MythGenericTree::SetImageFromMap ( const InfoMap infoMap)

Definition at line 565 of file mythgenerictree.cpp.

Referenced by AddFileNode().

◆ GetImage()

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

Definition at line 571 of file mythgenerictree.cpp.

◆ DisplayState()

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

Definition at line 589 of file mythgenerictree.cpp.

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

◆ DisplayStateFromMap()

void MythGenericTree::DisplayStateFromMap ( const InfoMap infoMap)

Definition at line 583 of file mythgenerictree.cpp.

Referenced by AddFileNode().

◆ GetState()

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

Definition at line 595 of file mythgenerictree.cpp.

◆ SetData()

void MythGenericTree::SetData ( QVariant  data)
inline

◆ GetData()

const 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 261 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 271 of file mythgenerictree.cpp.

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

◆ setSelectable()

void MythGenericTree::setSelectable ( bool  flag)
inline

Definition at line 95 of file mythgenerictree.h.

Referenced by MusicGenericTree::MusicGenericTree().

◆ isSelectable()

bool MythGenericTree::isSelectable ( ) const
inline

◆ SetVisible()

void MythGenericTree::SetVisible ( bool  visible)

Definition at line 488 of file mythgenerictree.cpp.

Referenced by addNode(), and MythUIButtonTree::RemoveItem().

◆ IsVisible()

bool MythGenericTree::IsVisible ( void  ) const
inline

◆ IncVisibleCount()

void MythGenericTree::IncVisibleCount ( )
inline

Definition at line 101 of file mythgenerictree.h.

Referenced by addNode(), and SetVisible().

◆ DecVisibleCount()

void MythGenericTree::DecVisibleCount ( )
inline

Definition at line 102 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 105 of file mythgenerictree.h.

Referenced by becomeSelectedChild().

◆ sortByString()

void MythGenericTree::sortByString ( )

◆ sortBySelectable()

void MythGenericTree::sortBySelectable ( )

Definition at line 442 of file mythgenerictree.cpp.

Referenced by sortBySelectable().

◆ deleteAllChildren()

void MythGenericTree::deleteAllChildren ( )

◆ MoveItemUpDown()

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

Definition at line 469 of file mythgenerictree.cpp.

◆ CreateListButton()

MythUIButtonListItem * MythGenericTree::CreateListButton ( MythUIButtonList list)
virtual

Reimplemented in MusicGenericTree.

Definition at line 504 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 119 of file mythgenerictree.h.

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

◆ m_sortText

QString MythGenericTree::m_sortText
private

Definition at line 120 of file mythgenerictree.h.

Referenced by ensureSortFields(), and SetText().

◆ m_strings

QMap<QString, TextProperties> MythGenericTree::m_strings
private

Definition at line 121 of file mythgenerictree.h.

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

◆ m_imageFilenames

InfoMap MythGenericTree::m_imageFilenames
private

Definition at line 122 of file mythgenerictree.h.

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

◆ m_states

InfoMap MythGenericTree::m_states
private

Definition at line 123 of file mythgenerictree.h.

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

◆ m_int

int MythGenericTree::m_int {0}
private

Definition at line 124 of file mythgenerictree.h.

Referenced by MythGenericTree().

◆ m_data

QVariant MythGenericTree::m_data {0}
private

Definition at line 125 of file mythgenerictree.h.

◆ m_visibleCount

uint MythGenericTree::m_visibleCount {0}
private

Definition at line 126 of file mythgenerictree.h.

◆ m_subnodes

SortableMythGenericTreeList* MythGenericTree::m_subnodes {nullptr}
private

◆ m_selectedSubnode

MythGenericTree* MythGenericTree::m_selectedSubnode {nullptr}
private

Definition at line 130 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 133 of file mythgenerictree.h.

Referenced by MythGenericTree().

◆ m_visible

bool MythGenericTree::m_visible {true}
private

Definition at line 134 of file mythgenerictree.h.

Referenced by SetVisible().


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