YContainerWidget Class Reference

Base class of all widgets that have child widgets. More...

#include <YContainerWidget.h>

Inheritance diagram for YContainerWidget:

YWidget YAlignment YDialog YDumbTab YFrame YRadioButtonGroup YReplacePoint YSplit YSquash YWizard List of all members.

Public Member Functions

 YContainerWidget (const YWidgetOpt &opt)
virtual ~YContainerWidget ()
virtual char * widgetClass ()
bool hasChildren () const
int numChildren () const
YWidgetchild (int i) const
long nicesize (YUIDimension dim)
bool stretchable (YUIDimension dim) const
void setSize (long newwidth, long newheight)
virtual void addChild (YWidget *child)
void removeChildren ()
YWidgetfindWidget (const YCPValue &id) const
bool isContainer () const
virtual void childDeleted (YWidget *child)
void dumpWidgetTree (int indentationLevel=0)
void dumpDialogWidgetTree ()
virtual std::string debugLabel ()
virtual void saveUserInput (YMacroRecorder *macroRecorder)
virtual void collectUserInput (YCPList &fieldContents)

Protected Member Functions

virtual void childAdded (YWidget *child)
virtual void childRemoved (YWidget *child)
void dumpWidget (YWidget *w, int indentationLevel)
string formatDebugLabel (YWidget *widget, const string &debLabel)

Protected Attributes

vector< YWidget * > children
YWidget_debugLabelWidget

Detailed Description

Base class of all widgets that have child widgets.

A Container is a widget that has child widgets. Examples are YSplit, YReplacePoint, YAlignment. This class generically handles the houskeeping of child widgets, looks for children with certain IDs and provides default implementations for nicesize, stretchable and weight for container widgets with exactly one child.


Constructor & Destructor Documentation

YContainerWidget::YContainerWidget ( const YWidgetOpt opt  ) 

Constructor

YContainerWidget::~YContainerWidget (  )  [virtual]

Cleans up: Deletes all child widgets.


Member Function Documentation

virtual char* YContainerWidget::widgetClass (  )  [inline, virtual]

Returns a descriptive name of this widget class for logging, debugging etc.

Reimplemented from YWidget.

Reimplemented in YAlignment, YDialog, YDumbTab, YFrame, YRadioButtonGroup, YReplacePoint, YSplit, YSquash, and YWizard.

bool YContainerWidget::hasChildren (  )  const

Returns 'true' if there are any child widgets.

int YContainerWidget::numChildren (  )  const

Returns the number of child widgets.

YWidget * YContainerWidget::child ( int  i  )  const

Returns one of the child widgets.

long YContainerWidget::nicesize ( YUIDimension  dim  )  [virtual]

Default implementation, assuming exactly one child. Returns the nicesize of the child.

Parameters:
dim Dimension, either YD_HORIZ or YD_VERT

Implements YWidget.

Reimplemented in YAlignment, and YSplit.

bool YContainerWidget::stretchable ( YUIDimension  dim  )  const [virtual]

Default implementation, that assumes exactly one child. Returns, whether the child is stretchable

Parameters:
dim Dimension, either YD_HORIZ or YD_VERT

Reimplemented from YWidget.

Reimplemented in YAlignment, YSplit, and YSquash.

void YContainerWidget::setSize ( long  newwidth,
long  newheight 
) [virtual]

Default implementation, that assumes exactly one child. Sets the size of the child.

Reimplemented from YWidget.

Reimplemented in YAlignment, and YSplit.

void YContainerWidget::addChild ( YWidget child  )  [virtual]

Adds a new child widget. The YContainerwidget assumes ownership and takes care of deleting the child.

void YContainerWidget::removeChildren (  ) 

Removes and deletes all child widgets. Calls childRemoved() for each child just before it is being removed in order to inform the derived ui specific widget.

YWidget * YContainerWidget::findWidget ( const YCPValue id  )  const

Looks for a child widget with a certain ID. Searches recursively.

Returns:
A pointer to the found widget or 0 if non has been found

bool YContainerWidget::isContainer (  )  const [virtual]

Returns true, since this is a container widget.

Reimplemented from YWidget.

void YContainerWidget::childDeleted ( YWidget child  )  [virtual]

Child deletion notification. See YWidget.h for details.

Reimplemented from YWidget.

void YContainerWidget::childAdded ( YWidget child  )  [protected, virtual]

Call back function that reports to the ui specific widget that a child has been added. The default implementation does nothing.

void YContainerWidget::childRemoved ( YWidget child  )  [protected, virtual]

Call back function that reports to the ui specific widget that a child has been removed. The default implementation does nothing.

void YContainerWidget::dumpWidgetTree ( int  indentationLevel = 0  ) 

Debugging function: Dump the widget tree from here on to the log file.

void YContainerWidget::dumpDialogWidgetTree (  ) 

Debugging function: Dump the widget tree from this widget's dialog parent. If there is no such dialog parent, dump the widget tree from here on.

string YContainerWidget::debugLabel (  )  [virtual]

Returns a (possibly translated) text describing this dialog for debugging.

Reimplemented from YWidget.

Reimplemented in YDialog.

void YContainerWidget::saveUserInput ( YMacroRecorder macroRecorder  )  [virtual]

Recursively save the user input of all child widgets to a macro recorder:

All child widgets that could contain data entered by the user are requested to send their contents to the macro recorder, e.g. input fields, check boxes etc.

Reimplemented from YWidget.

void YContainerWidget::collectUserInput ( YCPList fieldContents  )  [virtual]

(Recursively) collect the content of all input fields or other interactive widgets in this container and its children and add them to 'fieldContents'.

void YContainerWidget::dumpWidget ( YWidget w,
int  indentationLevel 
) [protected]

Helper function for dumpWidgetTree(): Dump one widget to the log file.

string YContainerWidget::formatDebugLabel ( YWidget widget,
const string &  debLabel 
) [protected]

Format a debug label.

Reimplemented in YDialog.


Member Data Documentation

vector<YWidget *> YContainerWidget::children [protected]

YWidget* YContainerWidget::_debugLabelWidget [protected]


The documentation for this class was generated from the following files:
Generated on Tue Nov 6 01:20:23 2007 for yast2-core by  doxygen 1.5.0