libyui
|
#include <YChildrenManager.h>
Public Types | |
typedef std::list< T * > | ChildrenList |
Public Member Functions | |
YChildrenManager (T *containerParent) | |
virtual | ~YChildrenManager () |
bool | hasChildren () const |
bool | empty () const |
int | count () const |
ChildrenList::const_iterator | begin () const |
ChildrenList::const_iterator | end () const |
ChildrenList::const_reverse_iterator | rbegin () const |
ChildrenList::const_reverse_iterator | rend () const |
T * | firstChild () |
T * | lastChild () |
virtual void | add (T *child) |
virtual void | remove (T *child) |
virtual void | clear () |
bool | contains (T *child) const |
T * | container () const |
Protected Attributes | |
T * | _container |
ChildrenList | _children |
Abstract base template class for children management, such as child widgets.
YChildrenManager< T >::YChildrenManager | ( | T * | containerParent | ) | [inline] |
Constructor.
'containerParent' is the class whose children are managed.
virtual YChildrenManager< T >::~YChildrenManager | ( | ) | [inline, virtual] |
Destructor.
virtual void YChildrenManager< T >::add | ( | T * | child | ) | [inline, virtual] |
Add a new child.
This may throw exceptions if more children are added than the class whose children are handled (the associated widget) can handle.
Reimplemented in YSingleChildManager< T >, and YChildrenRejector< T >.
ChildrenList::const_iterator YChildrenManager< T >::begin | ( | ) | const [inline] |
Return an iterator that points to the first child.
virtual void YChildrenManager< T >::clear | ( | ) | [inline, virtual] |
Remove all children. This only removes the children from the children manager's list; it does not delete them.
T* YChildrenManager< T >::container | ( | ) | const [inline] |
Returns the associated container, i.e. the object whose children are handled here.
bool YChildrenManager< T >::contains | ( | T * | child | ) | const [inline] |
Check if the children list contains the specified child. Returns 'true' if the children list contains the child, 'false' otherwise.
int YChildrenManager< T >::count | ( | ) | const [inline] |
Returns the number of children.
bool YChildrenManager< T >::empty | ( | ) | const [inline] |
Check if the children list is empty, i.e. if there are no children.
ChildrenList::const_iterator YChildrenManager< T >::end | ( | ) | const [inline] |
Return an iterator that points after the last child.
T* YChildrenManager< T >::firstChild | ( | ) | [inline] |
Returns the first child or 0 if there is none. Useful mostly for children managers that handle only one child.
bool YChildrenManager< T >::hasChildren | ( | ) | const [inline] |
Check if there are any children.
T* YChildrenManager< T >::lastChild | ( | ) | [inline] |
Returns the last child or 0 if there is none.
ChildrenList::const_reverse_iterator YChildrenManager< T >::rbegin | ( | ) | const [inline] |
Return a reverse iterator that points to the last child.
virtual void YChildrenManager< T >::remove | ( | T * | child | ) | [inline, virtual] |
Remove a child. This only removes the child from the children manager's list; it does not delete it.
ChildrenList::const_reverse_iterator YChildrenManager< T >::rend | ( | ) | const [inline] |
Return a reverse iterator that points before the first child.