Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Examples

YUIComponent Class Reference

abstract base class for YaST2 user interface components. Derive your own component class from this one and implement createUI(). More...

#include <YUIComponent.h>

Inheritance diagram for YUIComponent:

Y2Component List of all members.

Public Member Functions

void createUI ()
YCPValue callBuiltin (void *function, int fn_argc, YCPValue fn_argv[])
void result (const YCPValue &result)
void setServerOptions (int argc, char **argv)
virtual string name () const
void setCallback (Y2Component *callback)
Y2ComponentgetCallback () const

Static Public Member Functions

YUIComponentuiComponent ()
YUIui ()

Protected Member Functions

 YUIComponent ()
virtual ~YUIComponent ()
virtual YUIcreateUI (int argc, char **argv, bool with_threads, const char *macro_file)=0

Private Attributes

int _argc
char ** _argv
const char * _macro_file
bool _with_threads
bool _have_server_options

Static Private Attributes

YUI_ui = 0
YUIComponent_uiComponent = 0

Detailed Description

abstract base class for YaST2 user interface components. Derive your own component class from this one and implement createUI().


Constructor & Destructor Documentation

YUIComponent::YUIComponent  )  [protected]
 

Constructor.

YUIComponent::~YUIComponent  )  [protected, virtual]
 

Destructor.


Member Function Documentation

YCPValue YUIComponent::callBuiltin void *  function,
int  fn_argc,
YCPValue  fn_argv[]
 

YUIComponent level call handler; this creates the actual UI instance upon its first call and then hands over the function to be called to the UI's call handler. Weird, huh? ;-)

void YUIComponent::createUI  ) 
 

Create a UI instance. The UI component normally handles that all by itself when the first UI builtin is called, but under very rare circumstances (e.g., in kyast) the UI needs to be created upon demand.

virtual YUI* YUIComponent::createUI int  argc,
char **  argv,
bool  with_threads,
const char *  macro_file
[protected, pure virtual]
 

Create the UI. This is called when all the information for doing that is complete, in setServerOptions(). 'argc' and 'argv' are the command line arguments.

Implement this method in derived classes.

Y2Component * YUIComponent::getCallback  )  const [virtual]
 

Returns the UI's callback component previously set with setCallback(); calls the UI's getCallback() method.

Reimplemented from Y2Component.

virtual string YUIComponent::name  )  const [inline, virtual]
 

The name of the component - the prefix used for builtin calls like UI::OpenDialog() etc.

Implements Y2Component.

void YUIComponent::result const YCPValue result  )  [virtual]
 

Called from generic frontend upon session close. This deletes the UI.

Reimplemented from Y2Component.

void YUIComponent::setCallback Y2Component callback  )  [virtual]
 

Set a callback component - call the UI's setCallback() method.

Reimplemented from Y2Component.

void YUIComponent::setServerOptions int  argc,
char **  argv
[virtual]
 

This is called by the generic frontend after it parsed the commandline. This actually creates an UI instance with createUI().

Reimplemented from Y2Component.

YUI* YUIComponent::ui  )  [inline, static]
 

Returns the instance of the UI or 0 if none has been created yet. Note: This does _not_ create a UI on the first call; this happens in the first call of a UI builtin via the YUIComponent's call handler which creates a UI upon its first call and then calls the UI's call handler.

YUIComponent * YUIComponent::uiComponent  )  [static]
 

Returns the instance of the UI component 0 if none has been created yet.


Member Data Documentation

int YUIComponent::_argc [private]
 

char** YUIComponent::_argv [private]
 

bool YUIComponent::_have_server_options [private]
 

const char* YUIComponent::_macro_file [private]
 

YUI * YUIComponent::_ui = 0 [static, private]
 

YUIComponent * YUIComponent::_uiComponent = 0 [static, private]
 

bool YUIComponent::_with_threads [private]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 9 18:15:25 2007 for yast2-core by doxygen 1.3.6