libyui
3.3.1
|
Abstract base template class for children management, such as child widgets. More...
#include <YChildrenManager.h>
Public Types | |
typedef std::list< T * > | ChildrenList |
Public Member Functions | |
YChildrenManager (T *containerParent) | |
Constructor. More... | |
virtual | ~YChildrenManager () |
Destructor. | |
bool | hasChildren () const |
Check if there are any children. | |
bool | empty () const |
Check if the children list is empty, i.e. More... | |
int | count () const |
Returns the number of children. | |
ChildrenList::iterator | begin () |
Return an iterator that points to the first child. | |
ChildrenList::iterator | end () |
Return an iterator that points after the last child. | |
ChildrenList::const_iterator | begin () const |
Return an iterator that points to the first child. | |
ChildrenList::const_iterator | end () const |
Return an iterator that points after the last child. | |
ChildrenList::const_reverse_iterator | rbegin () const |
Return a reverse iterator that points to the last child. | |
ChildrenList::const_reverse_iterator | rend () const |
Return a reverse iterator that points before the first child. | |
T * | firstChild () |
Returns the first child or 0 if there is none. More... | |
T * | lastChild () |
Returns the last child or 0 if there is none. | |
virtual void | add (T *child) |
Add a new child. More... | |
virtual void | remove (T *child) |
Remove a child. More... | |
virtual void | clear () |
Remove all children. More... | |
bool | contains (T *child) const |
Check if the children list contains the specified child. More... | |
T * | container () const |
Returns the associated container, i.e. More... | |
Protected Attributes | |
T * | _container |
ChildrenList | _children |
Abstract base template class for children management, such as child widgets.
Definition at line 37 of file YChildrenManager.h.
|
inline |
Constructor.
'containerParent' is the class whose children are managed.
Definition at line 46 of file YChildrenManager.h.
|
inlinevirtual |
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 YChildrenRejector< T >, and YSingleChildManager< T >.
Definition at line 128 of file YChildrenManager.h.
|
inlinevirtual |
Remove all children.
This only removes the children from the children manager's list; it does not delete them.
Definition at line 142 of file YChildrenManager.h.
|
inline |
Returns the associated container, i.e.
the object whose children are handled here.
Definition at line 160 of file YChildrenManager.h.
|
inline |
Check if the children list contains the specified child.
Returns 'true' if the children list contains the child, 'false' otherwise.
Definition at line 150 of file YChildrenManager.h.
|
inline |
Check if the children list is empty, i.e.
if there are no children.
Definition at line 66 of file YChildrenManager.h.
|
inline |
Returns the first child or 0 if there is none.
Useful mostly for children managers that handle only one child.
Definition at line 113 of file YChildrenManager.h.
|
inlinevirtual |
Remove a child.
This only removes the child from the children manager's list; it does not delete it.
Definition at line 135 of file YChildrenManager.h.