VarTree Class Reference

Tree variable. More...

Inheritance diagram for VarTree:

Inheritance graph
[legend]
Collaboration diagram for VarTree:

Collaboration graph
[legend]

Public Types

typedef list< VarTree >::iterator Iterator
 Iterators.
typedef list< VarTree >
::const_iterator 
ConstIterator

Public Member Functions

 VarTree (intf_thread_t *pIntf)
 VarTree (intf_thread_t *pIntf, VarTree *pParent, int id, const UStringPtr &rcString, bool selected, bool playing, bool expanded, bool readonly, void *pData)
virtual ~VarTree ()
virtual const string & getType () const
 Get the variable type.
virtual void add (int id, const UStringPtr &rcString, bool selected, bool playing, bool expanded, bool readonly, void *pData)
 Add a pointer on string in the children's list.
virtual void delSelected ()
 Remove the selected item from the children's list.
virtual void clear ()
 Remove all elements from the children's list.
bool isReadonly ()
int size () const
 Get the number of children.
Iterator begin ()
 Begining of the children's list.
ConstIterator begin () const
Iterator end ()
 End of children's list.
ConstIterator end () const
VarTreeback ()
 Back of children's list.
Iterator operator[] (int n)
 Return an iterator on the n'th element of the children's list.
ConstIterator operator[] (int n) const
VarTreeparent ()
 Parent node.
void checkParents (VarTree *pParent)
Iterator getNextSibling (Iterator)
 Get next sibling.
Iterator next_uncle ()
Iterator prev_uncle ()
VarTreeroot ()
 Get root node.
Iterator firstLeaf ()
 Get first leaf.
void removeChild (VarTree::Iterator item)
virtual void action (VarTree *pItem)
 Execute the action associated to this item.
VarPercentgetPositionVar () const
 Get a reference on the position variable.
const VariablePtrgetPositionVarPtr () const
 Get a counted pointer on the position variable.
int visibleItems ()
 Count the number of items that should be displayed if the playlist window wasn't limited.
int countLeafs ()
 Count the number of leafs in the tree.
Iterator getVisibleItem (int n)
 Return iterator to the n'th visible item.
Iterator getLeaf (int n)
 Return iterator to the n'th leaf.
Iterator getNextVisibleItem (Iterator it)
 Given an iterator to a visible item, return the next visible item.
Iterator getPrevVisibleItem (Iterator it)
 Given an it to a visible item, return the previous visible item.
Iterator getNextItem (Iterator it)
 Given an iterator to an item, return the next item.
Iterator getPrevItem (Iterator it)
 Given an iterator to an item, return the previous item.
Iterator getNextLeaf (Iterator it)
 Given an iterator to an item, return the next leaf.
Iterator getPrevLeaf (Iterator it)
 Given an iterator to an item, return the previous leaf.
Iterator findById (int id)
 Find a children node with the given id.
void ensureExpanded (VarTree::Iterator)
 Ensure an item is expanded.
int depth ()
 Get depth (root depth is 0).

Data Fields

int m_id
UStringPtr m_cString
bool m_selected
bool m_playing
bool m_expanded
bool m_deleted
void * m_pData

Detailed Description

Tree variable.

Member Typedef Documentation

typedef list<VarTree>::iterator VarTree::Iterator

Iterators.

typedef list<VarTree>::const_iterator VarTree::ConstIterator


Constructor & Destructor Documentation

VarTree::VarTree ( intf_thread_t pIntf  ) 

References getPositionVar(), and VarPercent::set().

Referenced by add().

VarTree::VarTree ( intf_thread_t pIntf,
VarTree pParent,
int  id,
const UStringPtr rcString,
bool  selected,
bool  playing,
bool  expanded,
bool  readonly,
void *  pData 
)

VarTree::~VarTree (  )  [virtual]

Todo:
check that children are deleted


Member Function Documentation

virtual const string& VarTree::getType (  )  const [inline, virtual]

Get the variable type.

Implements Variable.

void VarTree::add ( int  id,
const UStringPtr rcString,
bool  selected,
bool  playing,
bool  expanded,
bool  readonly,
void *  pData 
) [virtual]

Add a pointer on string in the children's list.

References SkinObject::getIntf(), and VarTree().

void VarTree::delSelected (  )  [virtual]

Remove the selected item from the children's list.

Reimplemented in Playtree.

References begin(), end(), and size().

Referenced by CmdPlaytreeDel::execute(), and CtrlTree::handleEvent().

void VarTree::clear ( void   )  [virtual]

Remove all elements from the children's list.

bool VarTree::isReadonly (  )  [inline]

int VarTree::size (  )  const [inline]

Get the number of children.

Referenced by countLeafs(), delSelected(), and visibleItems().

Iterator VarTree::begin (  )  [inline]

ConstIterator VarTree::begin (  )  const [inline]

Iterator VarTree::end (  )  [inline]

ConstIterator VarTree::end (  )  const [inline]

VarTree& VarTree::back (  )  [inline]

Back of children's list.

VarTree::Iterator VarTree::operator[] ( int  n  ) 

Return an iterator on the n'th element of the children's list.

References begin(), end(), and i.

VarTree::ConstIterator VarTree::operator[] ( int  n  )  const

References begin(), end(), and i.

VarTree* VarTree::parent (  )  [inline]

void VarTree::checkParents ( VarTree pParent  ) 

References begin(), and end().

VarTree::Iterator VarTree::getNextSibling ( VarTree::Iterator  current  ) 

Get next sibling.

References end(), and root().

Referenced by Playtree::delSelected().

VarTree::Iterator VarTree::next_uncle (  ) 

References begin(), end(), parent(), and root().

VarTree::Iterator VarTree::prev_uncle (  ) 

References begin(), end(), parent(), and root().

VarTree* VarTree::root (  )  [inline]

VarTree::Iterator VarTree::firstLeaf (  ) 

void VarTree::removeChild ( VarTree::Iterator  item  )  [inline]

virtual void VarTree::action ( VarTree pItem  )  [inline, virtual]

Execute the action associated to this item.

Reimplemented in Playtree.

Referenced by CtrlTree::handleEvent().

VarPercent& VarTree::getPositionVar (  )  const [inline]

const VariablePtr& VarTree::getPositionVarPtr (  )  const [inline]

Get a counted pointer on the position variable.

int VarTree::visibleItems (  ) 

Count the number of items that should be displayed if the playlist window wasn't limited.

References begin(), end(), and size().

Referenced by CtrlTree::ensureVisible(), CtrlTree::handleEvent(), and CtrlTree::onResize().

int VarTree::countLeafs (  ) 

Count the number of leafs in the tree.

References begin(), end(), and size().

Referenced by CtrlTree::ensureVisible(), CtrlTree::handleEvent(), and CtrlTree::onResize().

VarTree::Iterator VarTree::getVisibleItem ( int  n  ) 

Return iterator to the n'th visible item.

References begin(), end(), and i.

Referenced by CtrlTree::onResize().

VarTree::Iterator VarTree::getLeaf ( int  n  ) 

Return iterator to the n'th leaf.

References begin(), end(), and i.

Referenced by CtrlTree::onResize().

VarTree::Iterator VarTree::getNextVisibleItem ( Iterator  it  ) 

Given an iterator to a visible item, return the next visible item.

Referenced by Playtree::delSelected(), CtrlTree::ensureVisible(), and CtrlTree::handleEvent().

VarTree::Iterator VarTree::getPrevVisibleItem ( Iterator  it  ) 

Given an it to a visible item, return the previous visible item.

References begin(), and root().

Referenced by CtrlTree::handleEvent().

VarTree::Iterator VarTree::getNextItem ( Iterator  it  ) 

Given an iterator to an item, return the next item.

Referenced by getNextLeaf().

VarTree::Iterator VarTree::getPrevItem ( Iterator  it  ) 

Given an iterator to an item, return the previous item.

References begin(), and root().

Referenced by getPrevLeaf().

VarTree::Iterator VarTree::getNextLeaf ( Iterator  it  ) 

Given an iterator to an item, return the next leaf.

References end(), getNextItem(), and root().

Referenced by CtrlTree::ensureVisible(), firstLeaf(), and CtrlTree::handleEvent().

VarTree::Iterator VarTree::getPrevLeaf ( Iterator  it  ) 

Given an iterator to an item, return the previous leaf.

References begin(), firstLeaf(), getPrevItem(), and root().

Referenced by CtrlTree::handleEvent().

VarTree::Iterator VarTree::findById ( int  id  ) 

Find a children node with the given id.

References begin(), and end().

Referenced by Playtree::onAppend(), Playtree::onDelete(), Playtree::onUpdateCurrent(), and Playtree::onUpdateItem().

void VarTree::ensureExpanded ( VarTree::Iterator  it  ) 

Ensure an item is expanded.

Don't expand ourselves, only our parents

References m_expanded, and parent().

Referenced by CtrlTree::ensureVisible().

int VarTree::depth (  )  [inline]

Get depth (root depth is 0).

References parent().


Field Documentation

Todo:
Use accessors for these fields ?

Referenced by CtrlTree::handleEvent().

Referenced by ensureExpanded().

Referenced by Playtree::action().


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

Generated on Tue May 25 08:06:29 2010 for VLC by  doxygen 1.5.6