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

YUI Class Reference

abstract base class of a YaST2 user interface The implementation of a YaST2 user interface such as qt and ncurses constists in subclassing YUI. More...

#include <YUI.h>

List of all members.

Public Types

enum  ImageType { IT_SUSEHEADER, IT_YAST2 }

Public Member Functions

virtual ~YUI ()
YDialogcurrentDialog () const
virtual void blockEvents (bool block=true)
void unblockEvents ()
virtual bool eventsBlocked () const
void topmostConstructorHasFinished ()
virtual void internalError (const char *msg)
int parseMenuItemList (const YCPList &itemList, YMenuButton *menu_button, YMenu *parentMenu=0)
int parseTreeItemList (const YCPList &itemList, YTree *tree, YTreeItem *parentItem=0)
int parseMultiSelectionBoxItemList (const YCPList &item_list, YMultiSelectionBox *multi_sel_box)
bool parseRgb (const YCPValue &val, YColor *color, bool complain)
YWidgetcreateWidgetTree (YWidget *parent, YWidgetOpt &opt, YRadioButtonGroup *rbg, const YCPTerm &term)
YWidgetcreateWidgetTree (YWidget *parent, YRadioButtonGroup *rbg, const YCPTerm &term)
YWidgetwidgetWithId (const YCPValue &id, bool log_error=false)
YWidgetwidgetWithId (YContainerWidget *widgetRoot, const YCPValue &id, bool log_error=false)
YCPBoolean evaluateReplaceWidget (const YCPValue &value_id, const YCPTerm &term)
int defaultFunctionKey (YCPString label)
string productName () const
YCPValue callBuiltin (void *function, int argc, YCPValue argv[])
void setCallback (Y2Component *callback)
Y2ComponentgetCallback () const
YCPValue evaluateAskForExistingDirectory (const YCPString &startDir, const YCPString &headline)
YCPValue evaluateAskForExistingFile (const YCPString &startDir, const YCPString &filter, const YCPString &headline)
YCPValue evaluateAskForSaveFileName (const YCPString &startDir, const YCPString &filter, const YCPString &headline)
void evaluateBusyCursor ()
YCPValue evaluateChangeWidget (const YCPValue &value_id, const YCPValue &property, const YCPValue &new_value)
void evaluateCheckShortcuts ()
YCPValue evaluateCloseDialog ()
void evaluateDumpWidgetTree ()
void evaluateFakeUserInput (const YCPValue &next_input)
YCPMap evaluateGetDisplayInfo ()
YCPString evaluateGetLanguage (const YCPBoolean &strip_encoding)
YCPValue evaluateGetModulename (const YCPTerm &term)
YCPString evaluateGetProductName ()
YCPString evaluateGlyph (const YCPSymbol &symbol)
YCPValue evaluateHasSpecialWidget (const YCPSymbol &widget)
void evaluateMakeScreenShot (const YCPString &filename)
void evaluateNormalCursor ()
YCPBoolean evaluateOpenDialog (const YCPTerm &term, const YCPTerm &term=YCPNull())
void evaluatePlayMacro (const YCPString &filename)
void evaluatePostponeShortcutCheck ()
YCPValue evaluateQueryWidget (const YCPValue &value_id, const YCPValue &property)
void evaluateRecalcLayout ()
YCPValue evaluateRecode (const YCPString &from, const YCPString &to, const YCPString &text)
void evaluateRecordMacro (const YCPString &filename)
void evaluateRedrawScreen ()
YCPValue evaluateRunPkgSelection (const YCPValue &value_id)
void evaluateSetConsoleFont (const YCPString &magic, const YCPString &font, const YCPString &screen_map, const YCPString &unicode_map, const YCPString &encoding)
void evaluateSetKeyboard ()
YCPBoolean evaluateSetFocus (const YCPValue &value_id)
void evaluateSetFunctionKeys (const YCPMap &new_keys)
void evaluateSetLanguage (const YCPString &lang, const YCPString &encoding=YCPNull())
void evaluateSetModulename (const YCPString &name)
void evaluateSetProductName (const YCPString &name)
void evaluateStopRecordMacro ()
YCPBoolean evaluateWidgetExists (const YCPValue &value_id)
YCPValue evaluateUserInput ()
YCPValue evaluateTimeoutUserInput (const YCPInteger &timeout)
YCPValue evaluateWaitForEvent (const YCPInteger &timeout=YCPNull())
YCPValue evaluateWizardCommand (const YCPTerm &command)
YCPValue evaluatePollInput ()
void uiThreadMainLoop ()

Static Public Member Functions

int Recode (const string &str, const string &from, const string &to, string &outstr)
bool reverseLayout ()
void setReverseLayout (bool rev)
YCPValue callFunction (void *function, int argc, YCPValue argv[])

Protected Types

typedef vector< YDialog * > dialogstack_type

Protected Member Functions

 YUI (bool with_threads)
const char * moduleName ()
virtual void idleLoop (int fd_ycp)
virtual YEventuserInput (unsigned long timeout_millisec=0)=0
virtual YEventpollInput ()=0
virtual void showDialog (YDialog *dialog)
virtual void closeDialog (YDialog *dialog)
virtual YCPString glyph (const YCPSymbol &glyphSymbol)
virtual YDialogcreateDialog (YWidgetOpt &opt)=0
virtual YContainerWidgetcreateSplit (YWidget *parent, YWidgetOpt &opt, YUIDimension dimension)=0
virtual YContainerWidgetcreateReplacePoint (YWidget *parent, YWidgetOpt &opt)=0
virtual YContainerWidgetcreateAlignment (YWidget *parent, YWidgetOpt &opt, YAlignmentType halign, YAlignmentType valign)=0
virtual YContainerWidgetcreateSquash (YWidget *parent, YWidgetOpt &opt, bool hsquash, bool vsquash)=0
virtual YContainerWidgetcreateRadioButtonGroup (YWidget *parent, YWidgetOpt &opt)=0
virtual YContainerWidgetcreateFrame (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0
virtual YWidgetcreateEmpty (YWidget *parent, YWidgetOpt &opt)=0
virtual YWidgetcreateSpacing (YWidget *parent, YWidgetOpt &opt, float size, bool horizontal, bool vertical)=0
virtual YWidgetcreateLabel (YWidget *parent, YWidgetOpt &opt, const YCPString &text)=0
virtual YWidgetcreateRichText (YWidget *parent, YWidgetOpt &opt, const YCPString &text)=0
virtual YWidgetcreateLogView (YWidget *parent, YWidgetOpt &opt, const YCPString &label, int visibleLines, int maxLines)=0
virtual YWidgetcreatePushButton (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0
virtual YWidgetcreateMenuButton (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0
virtual YWidgetcreateRadioButton (YWidget *parent, YWidgetOpt &opt, YRadioButtonGroup *rbg, const YCPString &label, bool checked)=0
virtual YWidgetcreateCheckBox (YWidget *parent, YWidgetOpt &opt, const YCPString &label, bool checked)=0
virtual YWidgetcreateTextEntry (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPString &text)=0
virtual YWidgetcreateMultiLineEdit (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPString &text)=0
virtual YWidgetcreateSelectionBox (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0
virtual YWidgetcreateMultiSelectionBox (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0
virtual YWidgetcreateComboBox (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0
virtual YWidgetcreateTree (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0
virtual YWidgetcreateTable (YWidget *parent, YWidgetOpt &opt, vector< string > header)=0
virtual YWidgetcreateProgressBar (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPInteger &maxprogress, const YCPInteger &progress)=0
virtual YWidgetcreateImage (YWidget *parent, YWidgetOpt &opt, YCPByteblock imagedata, YCPString defaulttext)=0
virtual YWidgetcreateImage (YWidget *parent, YWidgetOpt &opt, YCPString file_name, YCPString defaulttext)=0
virtual YWidgetcreateImage (YWidget *parent, YWidgetOpt &opt, ImageType img, YCPString defaulttext)=0
virtual YWidgetcreateIntField (YWidget *parent, YWidgetOpt &opt, const YCPString &label, int minValue, int maxValue, int initialValue)=0
virtual YWidgetcreatePackageSelector (YWidget *parent, YWidgetOpt &opt, const YCPString &floppyDevice)=0
virtual YWidgetcreatePkgSpecial (YWidget *parent, YWidgetOpt &opt, const YCPString &subwidget)=0
virtual YWidgetcreateDummySpecialWidget (YWidget *parent, YWidgetOpt &opt)
virtual bool hasDummySpecialWidget ()
virtual YWidgetcreateDownloadProgress (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPString &filename, int expectedSize)
virtual bool hasDownloadProgress ()
virtual YWidgetcreateBarGraph (YWidget *parent, YWidgetOpt &opt)
virtual bool hasBarGraph ()
virtual YWidgetcreateColoredLabel (YWidget *parent, YWidgetOpt &opt, YCPString label, YColor foreground, YColor background, int margin)
virtual bool hasColoredLabel ()
virtual YWidgetcreateDumbTab (YWidget *parent, YWidgetOpt &opt)
virtual bool hasDumbTab ()
virtual YWidgetcreateSlider (YWidget *parent, YWidgetOpt &opt, const YCPString &label, int minValue, int maxValue, int initialValue)
virtual bool hasSlider ()
virtual YWidgetcreatePartitionSplitter (YWidget *parent, YWidgetOpt &opt, int usedSize, int totalFreeSize, int newPartSize, int minNewPartSize, int minFreeSize, const YCPString &usedLabel, const YCPString &freeLabel, const YCPString &newPartLabel, const YCPString &freeFieldLabel, const YCPString &newPartFieldLabel)
virtual bool hasPartitionSplitter ()
virtual YWidgetcreateWizard (YWidget *parent, YWidgetOpt &opt, const YCPValue &backButtonId, const YCPString &backButtonLabel, const YCPValue &abortButtonId, const YCPString &abortButtonLabel, const YCPValue &nextButtonId, const YCPString &nextButtonLabel)
virtual bool hasWizard ()
virtual YCPValue setLanguage (const YCPTerm &term)
virtual YCPValue setConsoleFont (const YCPString &console_magic, const YCPString &font, const YCPString &screen_map, const YCPString &unicode_map, const YCPString &encoding)
virtual YCPValue setKeyboard ()
virtual int getDisplayWidth ()
virtual int getDisplayHeight ()
virtual int getDisplayDepth ()
virtual long getDisplayColors ()
virtual int getDefaultWidth ()
virtual int getDefaultHeight ()
virtual bool textMode ()
virtual bool hasImageSupport ()
virtual bool hasLocalImageSupport ()
virtual bool hasAnimationSupport ()
virtual bool hasIconSupport ()
virtual bool hasFullUtf8Support ()
virtual void busyCursor ()
virtual void normalCursor ()
virtual void redrawScreen ()
virtual void makeScreenShot (string filename)
virtual YCPValue runPkgSelection (YWidget *packageSelector)
virtual YCPValue askForExistingDirectory (const YCPString &startDir, const YCPString &headline)=0
virtual YCPValue askForExistingFile (const YCPString &startWith, const YCPString &filter, const YCPString &headline)=0
virtual YCPValue askForSaveFileName (const YCPString &startWith, const YCPString &filter, const YCPString &headline)=0
YCPValue callback (const YCPValue &value)
YCPValue evaluateLocale (const YCPLocale &)
void recordMacro (string filename)
void stopRecordMacro ()
void playMacro (string filename)
bool recordingMacro ()
bool playingMacro ()
void terminateUIThread ()
void createUIThread ()
void signalUIThread ()
bool waitForUIThread ()
void signalYCPThread ()
bool waitForYCPThread ()
YEventfilterInvalidEvents (YEvent *event)
YCPValue doUserInput (const char *builtin_name, long timeout_millisec, bool wait, bool detailed)
YCPValue evaluateCallback (const YCPTerm &term, bool to_wfm)
YRadioButtonGroupfindRadioButtonGroup (YContainerWidget *root, YWidget *w, bool *contains)
YWidgetcreateReplacePoint (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg)
YWidgetcreateEmpty (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool hstretchable, bool vstretchable)
YWidgetcreateSpacing (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool horizontal, bool vertical)
YWidgetcreateFrame (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg)
YWidgetcreateWeight (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg, YUIDimension dim)
YWidgetcreateAlignment (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg, YAlignmentType halign, YAlignmentType valign)
YWidgetcreateSquash (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg, bool hsquash, bool vsquash)
YWidgetcreateLBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg, YUIDimension dim)
YWidgetcreateLabel (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool heading)
YWidgetcreateRichText (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateLogView (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreatePushButton (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool isIconButton)
YWidgetcreateMenuButton (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateCheckBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateRadioButton (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg)
YWidgetcreateRadioButtonGroup (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg)
YWidgetcreateTextEntry (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool password)
YWidgetcreateMultiLineEdit (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateSelectionBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateMultiSelectionBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateComboBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateTree (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateTable (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateProgressBar (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateImage (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateIntField (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreatePackageSelector (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreatePkgSpecial (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateWizard (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateDummySpecialWidget (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateDownloadProgress (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateBarGraph (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateColoredLabel (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateDumbTab (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg)
YWidgetcreateSlider (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreatePartitionSplitter (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YCPValue getWidgetId (const YCPTerm &term, int *argnr)
YCPList getWidgetOptions (const YCPTerm &term, int *argnr)
void logUnknownOption (const YCPTerm &term, const YCPValue &option)
void rejectAllOptions (const YCPTerm &term, const YCPList &optList)
void registerDialog (YDialog *)
void removeDialog ()
bool checkId (const YCPValue &val, bool complain=true) const
bool isSymbolOrId (const YCPValue &val) const
YCPValue getId (const YCPValue &v) const
void deleteMacroRecorder ()
void deleteMacroPlayer ()
void playNextMacroBlock ()

Protected Attributes

dialogstack_type dialogstack
long long id_counter
bool with_threads
pthread_t ui_thread
YUIBuiltinCallData _builtinCallData
int pipe_to_ui [2]
int pipe_from_ui [2]
bool terminate_ui_thread
string _moduleName
string _productName
YMacroRecordermacroRecorder
YMacroPlayermacroPlayer
deque< YCPValuefakeUserInputQueue
YCPMap default_fkeys
bool _events_blocked
Y2Component_callback

Static Protected Attributes

bool _reverseLayout = false

Friends

void * start_ui_thread (void *ui_int)


Detailed Description

abstract base class of a YaST2 user interface The implementation of a YaST2 user interface such as qt and ncurses constists in subclassing YUI.

We have to handle two cases slightly different: The case with and without a seperate UI thread.

You have two alternatives how to implement event handling in your UI. Either override idleLoop, userInput and pollInput or override pollInput and waitForEvent, whichever is easier for you.

This class is an abstract base class that contains pure virtuals. It is not intended for direct instantiation, only for inheritance.


Member Typedef Documentation

typedef vector<YDialog *> YUI::dialogstack_type [protected]
 

Define type for the dialog map


Member Enumeration Documentation

enum YUI::ImageType
 

Constants for different predifined images

Enumeration values:
IT_SUSEHEADER 
IT_YAST2 


Constructor & Destructor Documentation

YUI::YUI bool  with_threads  )  [protected]
 

Constructor.

YUI::~YUI  )  [virtual]
 

Destructor.


Member Function Documentation

virtual YCPValue YUI::askForExistingDirectory const YCPString startDir,
const YCPString headline
[protected, pure virtual]
 

UI-specific implementation of the AskForExistingDirectory() builtin.

Open a directory selection box and prompt the user for an existing directory.

'startDir' is the initial directory that is displayed.

'headline' is an explanatory text for the directory selection box. Graphical UIs may omit that if no window manager is running.

Returns the selected directory name or 'nil'( YCPVoid() ) if the user canceled the operation.

virtual YCPValue YUI::askForExistingFile const YCPString startWith,
const YCPString filter,
const YCPString headline
[protected, pure virtual]
 

UI-specific implementation of the AskForExistingFile() builtin.

Open a file selection box and prompt the user for an existing file.

'startWith' is the initial directory or file.

'filter' is one or more blank-separated file patterns, e.g. "*.png *.jpg"

'headline' is an explanatory text for the file selection box. Graphical UIs may omit that if no window manager is running.

Returns the selected file name or 'nil'( YCPVoid() ) if the user canceled the operation.

virtual YCPValue YUI::askForSaveFileName const YCPString startWith,
const YCPString filter,
const YCPString headline
[protected, pure virtual]
 

UI-specific implementation of the AskForSaveFileName() builtin.

Open a file selection box and prompt the user for a file to save data to. Automatically asks for confirmation if the user selects an existing file.

'startWith' is the initial directory or file.

'filter' is one or more blank-separated file patterns, e.g. "*.png *.jpg"

'headline' is an explanatory text for the file selection box. Graphical UIs may omit that if no window manager is running.

Returns the selected file name or 'nil'( YCPVoid() ) if the user canceled the operation.

virtual void YUI::blockEvents bool  block = true  )  [inline, virtual]
 

Block (or unblock) events. If events are blocked, any event sent should be ignored until events are unblocked again.

This default implementation keeps track of a simple internal flag that can be queried with eventsBlocked(), so if you reimplement blockEvents(), be sure to reimplement eventsBlocked() as well.

void YUI::busyCursor  )  [protected, virtual]
 

UI-specific busyCursor function. This default implementation does nothing.

YCPValue YUI::callback const YCPValue value  )  [protected]
 

YCPValue YUI::callBuiltin void *  function,
int  argc,
YCPValue  argv[]
 

Call a UI builtin function in the correct thread (the UI thread). This is called from libycp/YExpression via the UI builtin declarations that call UICallHandler.

YCPValue YUI::callFunction void *  function,
int  argc,
YCPValue  argv[]
[static]
 

Call 'function' with 'argc' YCPValue parameters and return the result of 'function'.

bool YUI::checkId const YCPValue val,
bool  complain = true
const [protected]
 

Checks if the given value is a term with the symbol 'id and size one. Logs an error if this is not so and 'complain' is set.

Returns:
'true' if 'val' is a valid `id().

void YUI::closeDialog YDialog dialog  )  [protected, virtual]
 

Decativates and closes a previously created dialog. The default implementation does nothing. Don't delete the dialog. This will be done at some other place.

Parameters:
dialog dialog to close.

YWidget * YUI::createAlignment YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg,
YAlignmentType  halign,
YAlignmentType  valign
[protected]
 

Helper function of createWidgetTree. Creates an alignment (`Left, `Right, `Top, `Bottom based on the alignment parameters.

Parameters:
halign the horizontal alignment
valign the vertical alignment

virtual YContainerWidget* YUI::createAlignment YWidget parent,
YWidgetOpt opt,
YAlignmentType  halign,
YAlignmentType  valign
[protected, pure virtual]
 

Creates an alignment widget

YWidget * YUI::createBarGraph YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a BarGraph.

YWidget * YUI::createBarGraph YWidget parent,
YWidgetOpt opt
[protected, virtual]
 

Creates a BarGraph widget.

This is a special widget that the UI may or may not support. Overwrite this method at your own discretion. If you do, remember to overwrite the has...() method as well!

YWidget * YUI::createCheckBox YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a CheckBox.

virtual YWidget* YUI::createCheckBox YWidget parent,
YWidgetOpt opt,
const YCPString label,
bool  checked
[protected, pure virtual]
 

Creates a check box

Parameters:
label Label of the checkbox
true if it is checked

YWidget * YUI::createColoredLabel YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a ColoredLabel.

YWidget * YUI::createColoredLabel YWidget parent,
YWidgetOpt opt,
YCPString  label,
YColor  foreground,
YColor  background,
int  margin
[protected, virtual]
 

Creates a ColoredLabelwidget.

This is a special widget that the UI may or may not support. Overwrite this method at your own discretion. If you do, remember to overwrite the has...() method as well!

YWidget * YUI::createComboBox YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a ComboBox.

virtual YWidget* YUI::createComboBox YWidget parent,
YWidgetOpt opt,
const YCPString label
[protected, pure virtual]
 

Creates a combo box

virtual YDialog* YUI::createDialog YWidgetOpt opt  )  [protected, pure virtual]
 

Creates a dialog.

Parameters:
widget Widget the dialog contains. Each dialog contains exactly one widget.

YWidget * YUI::createDownloadProgress YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a DownloadProgress.

YWidget * YUI::createDownloadProgress YWidget parent,
YWidgetOpt opt,
const YCPString label,
const YCPString filename,
int  expectedSize
[protected, virtual]
 

Creates a DownloadProgress widget.

This is a special widget that the UI may or may not support. Overwrite this method at your own discretion. If you do, remember to overwrite the has...() method as well!

YWidget * YUI::createDumbTab YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg
[protected]
 

Helper function of createWidgetTree. Creates a DumbTab.

YWidget * YUI::createDumbTab YWidget parent,
YWidgetOpt opt
[protected, virtual]
 

Creates a DumbTab.

This is a special widget that the UI may or may not support. Overwrite this method at your own discretion. If you do, remember to overwrite the has...() method as well!

YWidget * YUI::createDummySpecialWidget YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a DummySpecialWidget.

YWidget * YUI::createDummySpecialWidget YWidget parent,
YWidgetOpt opt
[protected, virtual]
 

Creates a DummySpecialWidget.

This is a special widget that the UI may or may not support. Overwrite this method at your own discretion. If you do, remember to overwrite the has...() method as well!

YWidget * YUI::createEmpty YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
bool  hstretchable,
bool  vstretchable
[protected]
 

Helper function of createWidgetTree. Creates one of Empty, HStretch, VStretch, Stretch

virtual YWidget* YUI::createEmpty YWidget parent,
YWidgetOpt opt
[protected, pure virtual]
 

Creates an empty widget

YWidget * YUI::createFrame YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg
[protected]
 

Helper function of createWidgetTree. Creates a frame widget.

virtual YContainerWidget* YUI::createFrame YWidget parent,
YWidgetOpt opt,
const YCPString label
[protected, pure virtual]
 

Creates a frame widget

YWidget * YUI::createImage YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates an Image.

virtual YWidget* YUI::createImage YWidget parent,
YWidgetOpt opt,
ImageType  img,
YCPString  defaulttext
[protected, pure virtual]
 

Creates an image widget from a predefined set of images

virtual YWidget* YUI::createImage YWidget parent,
YWidgetOpt opt,
YCPString  file_name,
YCPString  defaulttext
[protected, pure virtual]
 

Creates an image widget from a file name

virtual YWidget* YUI::createImage YWidget parent,
YWidgetOpt opt,
YCPByteblock  imagedata,
YCPString  defaulttext
[protected, pure virtual]
 

Creates an image widget from a YCP byteblock

YWidget * YUI::createIntField YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates an IntField.

virtual YWidget* YUI::createIntField YWidget parent,
YWidgetOpt opt,
const YCPString label,
int  minValue,
int  maxValue,
int  initialValue
[protected, pure virtual]
 

Creates an IntField widget.

YWidget * YUI::createLabel YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
bool  heading
[protected]
 

Helper function of createWidgetTree. Creates a label.

Parameters:
heading true if the label is a Heading()

virtual YWidget* YUI::createLabel YWidget parent,
YWidgetOpt opt,
const YCPString text
[protected, pure virtual]
 

Creates a label.

Parameters:
text Initial text of the label
heading true if the label is a Heading()
output_field true if the label should look like an output field( 3D look )

YWidget * YUI::createLBox YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg,
YUIDimension  dim
[protected]
 

Helper function of createWidgetTree. Creates one of HBox, VBox

Parameters:
dim Dimension of the layoutbox

YWidget * YUI::createLogView YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a LogView.

virtual YWidget* YUI::createLogView YWidget parent,
YWidgetOpt opt,
const YCPString label,
int  visibleLines,
int  maxLines
[protected, pure virtual]
 

Creates a log view widget

Parameters:
label label above the log view
visibleLines default number of vislible lines
maxLines number of lines to store (use 0 for "all")

YWidget * YUI::createMenuButton YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function for createWidgetTreeTree. Creates a menu button.

virtual YWidget* YUI::createMenuButton YWidget parent,
YWidgetOpt opt,
const YCPString label
[protected, pure virtual]
 

Creates a menu button.

Parameters:
label Label of the button

YWidget * YUI::createMultiLineEdit YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a MultiLineEdit.

virtual YWidget* YUI::createMultiLineEdit YWidget parent,
YWidgetOpt opt,
const YCPString label,
const YCPString text
[protected, pure virtual]
 

Creates a MultiLineEdit widget.

YWidget * YUI::createMultiSelectionBox YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function for createWidgetTreeTree. Creates a MultiSelectionBox.

virtual YWidget* YUI::createMultiSelectionBox YWidget parent,
YWidgetOpt opt,
const YCPString label
[protected, pure virtual]
 

Creates a multi selection box

YWidget * YUI::createPackageSelector YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a PackageSelector.

virtual YWidget* YUI::createPackageSelector YWidget parent,
YWidgetOpt opt,
const YCPString floppyDevice
[protected, pure virtual]
 

Creates a PackageSelector widget.

"floppyDevice" may be an empty string if no such device was specified in the YCP code. Usually it is something like "/dev/fd0".

YWidget * YUI::createPartitionSplitter YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a PartitionSplitter.

YWidget * YUI::createPartitionSplitter YWidget parent,
YWidgetOpt opt,
int  usedSize,
int  totalFreeSize,
int  newPartSize,
int  minNewPartSize,
int  minFreeSize,
const YCPString usedLabel,
const YCPString freeLabel,
const YCPString newPartLabel,
const YCPString freeFieldLabel,
const YCPString newPartFieldLabel
[protected, virtual]
 

Creates a PartitionSplitter widget.

This is a special widget that the UI may or may not support. Overwrite this method at your own discretion. If you do, remember to overwrite the has...() method as well!

Parameters:
parent the parent widget
opt the widget options
usedSize size of the used part of the partition
totalFreeSize total size of the free part of the partition ( before the split )
newPartSize suggested size of the new partition
minNewPartSize minimum size of the new partition
minFreeSize minimum remaining free size of the old partition
usedLabel BarGraph label for the used part of the old partition
freeLabel BarGraph label for the free part of the old partition
newPartLabel BarGraph label for the new partition
freeFieldLabel label for the remaining free space field
newPartFieldLabel label for the new partition size field

YWidget * YUI::createPkgSpecial YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a PkgSpecial subwidget.

virtual YWidget* YUI::createPkgSpecial YWidget parent,
YWidgetOpt opt,
const YCPString subwidget
[protected, pure virtual]
 

Creates a PkgSpecial widget, i.e. a specific subwidget.

YWidget * YUI::createProgressBar YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a ProgressBar.

virtual YWidget* YUI::createProgressBar YWidget parent,
YWidgetOpt opt,
const YCPString label,
const YCPInteger &  maxprogress,
const YCPInteger &  progress
[protected, pure virtual]
 

Creates a progress bar

YWidget * YUI::createPushButton YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
bool  isIconButton
[protected]
 

Helper function of createWidgetTree. Creates a PushButton or an IconButton.

virtual YWidget* YUI::createPushButton YWidget parent,
YWidgetOpt opt,
const YCPString label
[protected, pure virtual]
 

Creates a push button.

Parameters:
label Label of the button

YWidget * YUI::createRadioButton YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg
[protected]
 

Helper function of createWidgetTree. Creates a RadioButton.

virtual YWidget* YUI::createRadioButton YWidget parent,
YWidgetOpt opt,
YRadioButtonGroup rbg,
const YCPString label,
bool  checked
[protected, pure virtual]
 

Creates a radio button and inserts it into a radio button group

Parameters:
label Label of the radio button
rbg the radio button group the new button will belong to

YWidget * YUI::createRadioButtonGroup YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg
[protected]
 

Helper function of createWidgetTree. Creates a RadioButtonGroup.

virtual YContainerWidget* YUI::createRadioButtonGroup YWidget parent,
YWidgetOpt opt
[protected, pure virtual]
 

Creates a radio button group.

YWidget * YUI::createReplacePoint YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg
[protected]
 

Helper function of createWidgetTree. Creates a replace point

Parameters:
parent the widget or dialog this widget is contained in
term The term specifying the widget, e.g. `ReplacePoint( `PushButton( "OK" ) )
optList The list of widget options( as specified with `opt( ... ) )
argnr the index of the first non-id and non-opt argument( 0, 1 or 2 )
rbg Pointer to the current radio button group

virtual YContainerWidget* YUI::createReplacePoint YWidget parent,
YWidgetOpt opt
[protected, pure virtual]
 

Creates a replace point.

YWidget * YUI::createRichText YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a RichText.

virtual YWidget* YUI::createRichText YWidget parent,
YWidgetOpt opt,
const YCPString text
[protected, pure virtual]
 

Creates a rich text widget

Parameters:
text Initial text of the label

YWidget * YUI::createSelectionBox YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a SelectionBox.

virtual YWidget* YUI::createSelectionBox YWidget parent,
YWidgetOpt opt,
const YCPString label
[protected, pure virtual]
 

Creates a selection box

YWidget * YUI::createSlider YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a Slider.

YWidget * YUI::createSlider YWidget parent,
YWidgetOpt opt,
const YCPString label,
int  minValue,
int  maxValue,
int  initialValue
[protected, virtual]
 

Creates a Slider widget.

This is a special widget that the UI may or may not support. Overwrite this method at your own discretion. If you do, remember to overwrite the has...() method as well!

YWidget * YUI::createSpacing YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
bool  horizontal,
bool  vertical
[protected]
 

Helper function of createWidgetTree. Creates one of HSpacing, VSpacing.

Parameters:
horizontal true if this is a HSpacing
vertical true if this is a VSpacing

virtual YWidget* YUI::createSpacing YWidget parent,
YWidgetOpt opt,
float  size,
bool  horizontal,
bool  vertical
[protected, pure virtual]
 

Creates a spacing widget

virtual YContainerWidget* YUI::createSplit YWidget parent,
YWidgetOpt opt,
YUIDimension  dimension
[protected, pure virtual]
 

Creates a split

YWidget * YUI::createSquash YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg,
bool  hsquash,
bool  vsquash
[protected]
 

Helper function of createWidgetTree. Creates one of HSquash, VSquash, HVSquash.

Parameters:
hsquash whether the child is being squashed horizontally
vsquash whether the child is being squashed vertically

virtual YContainerWidget* YUI::createSquash YWidget parent,
YWidgetOpt opt,
bool  hsquash,
bool  vsquash
[protected, pure virtual]
 

Creates a squash widget

YWidget * YUI::createTable YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a Table.

virtual YWidget* YUI::createTable YWidget parent,
YWidgetOpt opt,
vector< string >  header
[protected, pure virtual]
 

Creates a table widget

YWidget * YUI::createTextEntry YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
bool  password
[protected]
 

Helper function of createWidgetTree. Creates one of TextEntry, Password

Parameters:
password true if this should be password entry field

virtual YWidget* YUI::createTextEntry YWidget parent,
YWidgetOpt opt,
const YCPString label,
const YCPString text
[protected, pure virtual]
 

Creates a text entry or password entry field.

YWidget * YUI::createTree YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a Tree.

virtual YWidget* YUI::createTree YWidget parent,
YWidgetOpt opt,
const YCPString label
[protected, pure virtual]
 

Creates a tree

void YUI::createUIThread  )  [protected]
 

Creates and launches the ui thread.

YWidget * YUI::createWeight YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg,
YUIDimension  dim
[protected]
 

Helper function of createWidgetTree. Creates a weight widget.

Parameters:
dim dimension of the weight, either YD_HORIZ or YD_VERT

This is an exception from the general rule: No YWeight widget is created, just the weight is passed as widget options to a newly created child widget. The YWeight widget is plain superfluos - YWidget can handle everything itself.

YWidget * YUI::createWidgetTree YWidget parent,
YRadioButtonGroup rbg,
const YCPTerm term
 

Overloaded version for convenience. Supplies empty widget options.

YWidget * YUI::createWidgetTree YWidget parent,
YWidgetOpt opt,
YRadioButtonGroup rbg,
const YCPTerm term
 

Creates a new widget tree.

Parameters:
parent the widget or dialog this widget is contained in
term YCPTerm describing the widget
rbg Pointer to the current radio button group
Returns:
pointer to the new widget or 0 if it was not successful. And error has been logged in this case

YWidget * YUI::createWizard YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a Wizard widget.

YWidget * YUI::createWizard YWidget parent,
YWidgetOpt opt,
const YCPValue backButtonId,
const YCPString backButtonLabel,
const YCPValue abortButtonId,
const YCPString abortButtonLabel,
const YCPValue nextButtonId,
const YCPString nextButtonLabel
[protected, virtual]
 

Creates a Wizard frame.

YDialog * YUI::currentDialog  )  const
 

Looks up the topmost dialog

int YUI::defaultFunctionKey YCPString  label  ) 
 

Returns the default function key number for a widget with the specified label or 0 if there is none. Any keyboard shortcuts that may be contained in 'label' are stripped away before any comparison.

void YUI::deleteMacroPlayer  )  [protected]
 

Delete the internal macro player and set the pointer to 0.

void YUI::deleteMacroRecorder  )  [protected]
 

Delete the internal macro recorder and set the pointer to 0.

YCPValue YUI::doUserInput const char *  builtin_name,
long  timeout_millisec,
bool  wait,
bool  detailed
[protected]
 

Mid-level handler for the user input related UI commands: UserInput() TimeoutUserInput() WaitForEvent() PollInput()

'builtin_name' is the name of the specific UI builtin command (to use the correct name in the log file).

'timeout_millisec' is the timeout in milliseconds to use (0 for "wait forever").

'wait' specifies if this should wait until an event is available if there is none yet.

'detailed' specifies if a full-fledged event map is desired as return value (WaitForEvent()) or one simple YCPValue (an ID).

YCPValue YUI::evaluateAskForExistingDirectory const YCPString startDir,
const YCPString headline
 

Implementations for most UI builtins. Each method corresponds directly to one UI builtin.

YCPValue YUI::evaluateAskForExistingFile const YCPString startWith,
const YCPString filter,
const YCPString headline
 

AskForExistingFile( string startWith, string filter, string headline ) -> string

Open a file selection box and prompt the user for an existing file.

startWith is the initial directory or file.

filter is one or more blank-separated file patterns, e.g. "*.png *.jpg"

headline is an explanatory text for the file selection box. Graphical UIs may omit that if no window manager is running.

Returns the selected file name or nil if the user canceled the operation.

YCPValue YUI::evaluateAskForSaveFileName const YCPString startWith,
const YCPString filter,
const YCPString headline
 

AskForSaveFileName( string startWith, string filter, string headline ) -> string

Open a file selection box and prompt the user for a file to save data to. Automatically asks for confirmation if the user selects an existing file. A

startWith is the initial directory or file.

filter is one or more blank-separated file patterns, e.g. "*.png *.jpg"

headline is an explanatory text for the file selection box. Graphical UIs may omit that if no window manager is running.

Returns the selected file name or nil if the user canceled the operation.

void YUI::evaluateBusyCursor  ) 
 

BusyCursor() -> void

Sets the mouse cursor to the busy cursor, if the UI supports such a feature.

This should normally not be necessary. The UI handles mouse cursors itself: When input is possible (i.e. inside UserInput() ), there is automatically a normal cursor, otherwise, there is the busy cursor. Override this at your own risk.

YCPValue YUI::evaluateCallback const YCPTerm term,
bool  to_wfm
[protected]
 

Implements the WFM or SCR callback command.

YCPValue YUI::evaluateChangeWidget const YCPValue id_value,
const YCPValue property,
const YCPValue new_value
 

ChangeWidget( `id( any widgetId ), symbol property, any newValue ) -> boolean ChangeWidget( symbol widgetId, symbol property, any newValue ) -> boolean

Changes a property of a widget of the topmost dialog. id specified the widget to change, property specifies the property that should be changed, newvalue gives the new value.

For example in order to change the label of a TextEntry with id `name to "anything", you write ChangeWidget( `id(`name), `Label, "anything" ).

Returns true on success.

void YUI::evaluateCheckShortcuts  ) 
 

CheckShortcuts() -> void

Perform an explicit shortcut check after postponing shortcut checks. Use this after calling PostponeShortcutCheck().

The normal sequence looks like this:

PostponeShortcutChecks(); ReplaceWidget( ... ); ReplaceWidget( ... ); ... ReplaceWidget( ... ); CheckShortcuts(); ... UserInput();

YCPValue YUI::evaluateCloseDialog  ) 
 

CloseDialog() -> boolean

Closes the most recently opened dialog. It is an error to call CloseDialog if no dialog is open.

Returns true on success.

void YUI::evaluateDumpWidgetTree  ) 
 

DumpWidgetTree() -> void

Debugging function: Dump the widget tree of the current dialog to the log file.

void YUI::evaluateFakeUserInput const YCPValue next_input  ) 
 

FakeUserInput( any nextUserInput ) -> void FakeUserInput() -> void

Prepare a fake value for the next call to UserInput() - i.e. the next UserInput() will return exactly this value. This is only useful in connection with macros.

If called without a parameter, the next call to UserInput() will return "nil".

YCPMap YUI::evaluateGetDisplayInfo  ) 
 

GetDisplayInfo() -> map

Get information about the current display and the UI's capabilities.

Returns a map with the following contents:

Width integer The overall display width.

Unit: characters for text mode UIs, pixels for graphical UIs.

-1 means unknown.

Height integer The overall display height.

-1 means unknown.

Depth integer The display color depth. Meaningful only for graphical displays.

-1 means unknown.

Colors </td integer The number of colors that can be displayed simultaneously at any one time.

-1 means unknown.

DefaultWidth integer The width of a `opt( `defaultsize ) dialog.
DefaultHeight integer The height of a `opt( `defaultsize ) dialog.
TextMode boolean true if text mode only supported. Don't misuse this! See remark below.
HasImageSupport boolean true if images can be displayed.
HasLocalImageSupport boolean true if images can be loaded from local files rather than having to use SCR::Read( .target.byte, ... ).
HasAnimationSupport boolean true if animations can be displayed, i.e. if the Image widget supports `opt( `animated ).
HasIconSupport boolean true if icons can be displayed.
HasFullUtf8Support boolean true if all UTF-8 characters can be displayed simultaneously.

Important: Don't misuse this function to simply not support the NCurses UI properly! Always think twice before checking for text mode. If you think there is no proper layout etc. solution for NCurses, it might be time to reconsider the complexity or even the concept of your dialog.

YCPString YUI::evaluateGetLanguage const YCPBoolean strip  ) 
 

GetLanguage( boolean strip_encoding ) -> string

Retrieves the current language setting from of the user interface. Since YaST2 is a client server architecture, we distinguish between the language setting of the user interface and that of the configuration modules. If the module or the translator wants to know which language the user currently uses, it can call GetLanguage. The return value is an ISO language code, such as "de" or "de_DE".

If "strip_encoding" is set to "true", all encoding or similar information is cut off, i.e. everything from the first "." or "@" on. Otherwise the current contents of the "LANG" environment variable is returned ( which very likely ends with ".UTF-8" since this is the encoding YaST2 uses internally).

YCPValue YUI::evaluateGetModulename const YCPTerm term  ) 
 

YCPString YUI::evaluateGetProductName  ) 
 

YCPString YUI::evaluateGlyph const YCPSymbol glyphSym  ) 
 

Glyph( symbol glyph ) -> string

Return a special character ( a 'glyph' ) according to the symbol specified.

Not all UIs may be capable of displaying every glyph; if a specific UI doesn't support it, a textual representation ( probably in plain ASCII ) will be returned.

This is also why there is only a limited number of predefined glyphs: An ASCII equivalent is required which is sometimes hard to find for some characters defined in Unicode / UTF-8.

Please note the value returned may consist of more than one character; for example, Glyph( `ArrowRight ) may return something like "-&gt;".

Predefined glyphs include:

  • `ArrowLeft
  • `ArrowRight
  • `ArrowUp
  • `ArrowDown
  • `CheckMark
  • `BulletArrowRight
  • `BulletCircle
  • `BulletSquare

If an unknown glyph symbol is specified, 'nil' is returned.

See also the Glyphs.ycp UI example:
Glyphs.png
Glyphs in the Qt UI

Glyphs-ncurses.png

Glyphs in the NCurses UI

YCPValue YUI::evaluateHasSpecialWidget const YCPSymbol widget  ) 
 

HasSpecialWidget( `symbol widget ) -> boolean

Checks for support of a special widget type. Use this prior to creating a widget of this kind. Do not use this to check for ordinary widgets like PushButton etc. - just the widgets where the widget documentation explicitly states it is an optional widget not supported by all UIs.

Returns true if the UI supports the special widget and false if not.

YCPValue YUI::evaluateLocale const YCPLocale &   )  [protected]
 

Evaluates a locale. Evaluate _( "string" ) to "string".

void YUI::evaluateMakeScreenShot const YCPString filename  ) 
 

MakeScreenShot( string filename ) -> void

Make a screen shot if the specific UI supports that. The Qt UI opens a file selection box if filename is empty.

void YUI::evaluateNormalCursor  ) 
 

NormalCursor() -> void

Sets the mouse cursor to the normal cursor ( after BusyCursor ), if the UI supports such a feature.

This should normally not be necessary. The UI handles mouse cursors itself: When input is possible (i.e. inside UserInput() ), there is automatically a normal cursor, otherwise, there is the busy cursor. Override this at your own risk.

YCPBoolean YUI::evaluateOpenDialog const YCPTerm term,
const YCPTerm term = YCPNull()
 

void YUI::evaluatePlayMacro const YCPString filename  ) 
 

PlayMacro( string macroFileName ) -> void

Execute everything in macro file "macroFileName". Any errors are sent to the log file only. The macro can be terminated only from within the macro file.

YCPValue YUI::evaluatePollInput  ) 
 

PollInput() -> any

Doesn't wait but just looks if the user has clicked some button, has closed the window or has activated some widget that has the `notify option set. Returns the id of the widget that has been selected or `cancel if the user selected the implicite cancel button ( for example he closes the window). Returns nil if no user input has occured.

Read more details and usage example in the YaST2 UI Event Handling Documentation.

void YUI::evaluatePostponeShortcutCheck  ) 
 

PostponeShortcutCheck() -> void

Postpone keyboard shortcut checking during multiple changes to a dialog.

Normally, keyboard shortcuts are checked automatically when a dialog is created or changed. This can lead to confusion, however, when multiple changes to a dialog ( repeated ReplaceWidget() calls ) cause unwanted intermediate states that may result in shortcut conflicts while the dialog is not final yet. Use this function to postpone this checking until all changes to the dialog are done and then explicitly check with CheckShortcuts(). Do this before the next call to UserInput() or PollInput() to make sure the dialog doesn't change "on the fly" while the user tries to use one of those shortcuts.

The next call to UserInput() or PollInput() will automatically perform that check if it hasn't happened yet, any an error will be issued into the log file.

Use only when really necessary. The automatic should do well in most cases.

The normal sequence looks like this:

PostponeShortcutChecks(); ReplaceWidget( ... ); ReplaceWidget( ... ); ... ReplaceWidget( ... ); CheckShortcuts(); ... UserInput();

YCPValue YUI::evaluateQueryWidget const YCPValue id_value,
const YCPValue property
 

QueryWidget( `id( any id ), symbol | term property ) -> any QueryWidget( symbol widgetId ), symbol | term property ) -> any

Queries a property of a widget of the topmost dialog. For example in order to query the current text of a TextEntry with id `name, you write QueryWidget( `id(`name), `Value ). In some cases the propery can be given as term in order to further specify it. An example is QueryWidget( `id( `table ), `Item( 17 ) ) for a table where you query a certain item.

void YUI::evaluateRecalcLayout  ) 
 

RecalcLayout() -> void

Recompute the layout of the current dialog.

This is a very expensive operation.

Use this after changing widget properties that might affect their size - like the a Label widget's value. Call this once ( ! ) after changing all such widget properties.

YCPValue YUI::evaluateRecode const YCPString from,
const YCPString to,
const YCPString text
 

Recode ( string from, string to, string text ) -> any

Recode encoding of string from or to "UTF-8" encoding. One of from/to must be "UTF-8", the other should be an iso encoding specifier (i.e. "ISO-8859-1" for western languages, "ISO-8859-2" for eastern languages, etc. )

void YUI::evaluateRecordMacro const YCPString filename  ) 
 

RecordMacro( string macroFileName ) -> void

Begin recording a macro. Write the macro contents to file "macroFilename".

void YUI::evaluateRedrawScreen  ) 
 

RedrawScreen() -> void

Redraws the screen after it very likely has become garbled by some other output.

This should normally not be necessary: The ( specific ) UI redraws the screen automatically whenever required. Under rare circumstances, however, the screen might have changes due to circumstances beyond the UI's control: For text based UIs, for example, system commands that cause output to every tty might make this necessary. Call this in the YCP code after such a command.

YCPBoolean YUI::evaluateReplaceWidget const YCPValue value_id,
const YCPTerm term
 

Implements the UI command ReplaceWidget.

YCPValue YUI::evaluateRunPkgSelection const YCPValue value_id  ) 
 

RunPkgSelection( `id( any pkgSelId ) -> any

Not to be used outside the package selection Initialize and run the PackageSelector widget identified by 'pkgSelId'. Black magic to everybody outside. ;- )

Returns `cancel if the user wishes to cancel his selections.

void YUI::evaluateSetConsoleFont const YCPString magic,
const YCPString font,
const YCPString screen_map,
const YCPString unicode_map,
const YCPString encoding
 

YCPBoolean YUI::evaluateSetFocus const YCPValue id_value  ) 
 

SetFocus( `id( any widgetId ) ) -> boolean SetFocus( symbol widgetId ) ) -> boolean

Sets the keyboard focus to the specified widget. Notice that not all widgets can accept the keyboard focus; this is limited to interactive widgets like PushButtton, TextEntry, SelectionBox etc. - manager widgets like VBox, HBox etc. will not accept the keyboard focus. They will not propagate the keyboard focus to some child widget that accepts the focus. Instead, an error message will be emitted into the log file.

Returns true on success (i.e. the widget accepted the focus).

void YUI::evaluateSetFunctionKeys const YCPMap new_keys  ) 
 

void YUI::evaluateSetKeyboard  ) 
 

void YUI::evaluateSetLanguage const YCPString lang,
const YCPString encoding = YCPNull()
 

void YUI::evaluateSetModulename const YCPString name  ) 
 

void YUI::evaluateSetProductName const YCPString name  ) 
 

void YUI::evaluateStopRecordMacro  ) 
 

StopRecordingMacro() -> void

Stop macro recording. This is only necessary if you don't wish to record everything until the program terminates.

YCPValue YUI::evaluateTimeoutUserInput const YCPInteger &  timeout  ) 
 

TimeoutUserInput( integer timeout_millisec ) -> any

Waits for the user to click some button, close the window or activate some widget that has the `notify option set or until the specified timeout is expired. The return value is the id of the widget that has been selected or `cancel if the user selected the implicit cancel button (for example he closes the window). Upon timeout, `timeout is returned.

Read more details and usage example in the YaST2 UI Event Handling Documentation.

YCPValue YUI::evaluateUserInput  ) 
 

UserInput() -> any

Waits for the user to click some button, close the window or activate some widget that has the `notify option set. The return value is the id of the widget that has been selected or `cancel if the user selected the implicit cancel button (for example he closes the window).

Read more details and usage example in the YaST2 UI Event Handling Documentation.

YCPValue YUI::evaluateWaitForEvent const YCPInteger &  timeout = YCPNull()  ) 
 

WaitForEvent() -> map WaitForEvent( integer timeout_millisec ) -> map

Extended event handling - very much like UserInput(), but returns much more detailed information about the event that occured in a map.

Read more details and usage example in the YaST2 UI Event Handling Documentation.

YCPBoolean YUI::evaluateWidgetExists const YCPValue id_value  ) 
 

WidgetExists( `id( any widgetId ) ) -> boolean WidgetExists( symbol widgetId ) ) -> boolean

Check whether or not a widget with the given ID currently exists in the current dialog. Use this to avoid errors in the log file before changing the properties of widgets that might or might not be there.

YCPValue YUI::evaluateWizardCommand const YCPTerm command  ) 
 

WizardCommand( term wizardCommand ) -> boolean

Issue a command to a wizard widget with ID 'wizardId'.

This builtin is not for general use. Use the Wizard.ycp module instead.

For available wizard commands see file YQWizard.cc . If the current UI does not provide a wizard widget, 'false' is returned. It is safe to call this even for UIs that don't provide a wizard widget. In this case, all calls to this builtin simply return 'false'.

Returns true on success.

virtual bool YUI::eventsBlocked  )  const [inline, virtual]
 

Returns 'true' if events are currently blocked.

Reimplent this if you reimplement blockEvents().

YEvent * YUI::filterInvalidEvents YEvent event  )  [protected]
 

Filter out invalid events.

Silently discard events from widgets that have become invalid.

This may legitimately happen if some widget triggered an event yet nobody cared for that event (i.e. called UserInput() or PollInput() ) and the widget has been destroyed meanwhile.

Silently discard events from all but the current ( topmost ) dialog.

This may happen even here even though the specific UI should have taken care about that: Events may still be in the queue. They might have been valid (i.e. belonged to the topmost dialog ) when they arrived, but maybe simply nobody has evaluated them.

YRadioButtonGroup * YUI::findRadioButtonGroup YContainerWidget root,
YWidget w,
bool *  contains
[protected]
 

Helper function for replaceWidget. Searches the current dialog for the radio button group that applies to a certain widget w. The searched for widget must be a radio button group that is an ancestor of w but there must be no other more immediate ancestor radio button to w.

Parameters:
root root widget where to begin searching
w the widget we search a button group for.
contains output parameter - is set to true if the subtree root contains the widget w. Otherwise it is kept unchanged.

Y2Component* YUI::getCallback void   )  const [inline]
 

Returns the callback previously set with setCallback().

virtual int YUI::getDefaultHeight  )  [inline, protected, virtual]
 

virtual int YUI::getDefaultWidth  )  [inline, protected, virtual]
 

virtual long YUI::getDisplayColors  )  [inline, protected, virtual]
 

virtual int YUI::getDisplayDepth  )  [inline, protected, virtual]
 

virtual int YUI::getDisplayHeight  )  [inline, protected, virtual]
 

virtual int YUI::getDisplayWidth  )  [inline, protected, virtual]
 

UI-specific getDisplayInfo() functions. See UI builtin GetDisplayInfo() doc for details.

YCPValue YUI::getId const YCPValue v  )  const [protected]
 

Assumes that the value v is of the form `id( any i ) and returns the contained i.

YCPValue YUI::getWidgetId const YCPTerm term,
int *  argnr
[protected]
 

Looks for a widget id in a widget term. If it finds one, returns it and sets argnr to 1, otherwise it creates a new unique widget id and sets argnr to 0. For example PushButton( `id( 17 ), .... ) has with id 17.

Returns:
The widget id on success or YCPNull on failure

YCPList YUI::getWidgetOptions const YCPTerm term,
int *  argnr
[protected]
 

Looks for widget options in the term. Returns the list of options if available, otherwise an empty list. Increases argnr by 1 if options are found. For example PushButton( `id( 17 ), `opt( `kilroy, `color( `red ) ) has the option list [ `kilroy, `color( `red ) ]

Parameters:
term the Widgetterm
argnr in/out: The number of the first non-id argument. Returns the number of the first non-id and non-opt argument.
Returns:
The option list, which may be empty, but never YCPNull

virtual YCPString YUI::glyph const YCPSymbol glyphSymbol  )  [inline, protected, virtual]
 

Implement the 'Glyph()' builtin in the specific UI:

Return a representation for the glyph symbol specified in UTF-8 encoding or an empty string to get a default textual representation.

Derived UIs may or may not choose to overwrite this.

virtual bool YUI::hasAnimationSupport  )  [inline, protected, virtual]
 

virtual bool YUI::hasBarGraph  )  [inline, protected, virtual]
 

virtual bool YUI::hasColoredLabel  )  [inline, protected, virtual]
 

virtual bool YUI::hasDownloadProgress  )  [inline, protected, virtual]
 

virtual bool YUI::hasDumbTab  )  [inline, protected, virtual]
 

virtual bool YUI::hasDummySpecialWidget  )  [inline, protected, virtual]
 

virtual bool YUI::hasFullUtf8Support  )  [inline, protected, virtual]
 

virtual bool YUI::hasIconSupport  )  [inline, protected, virtual]
 

virtual bool YUI::hasImageSupport  )  [inline, protected, virtual]
 

virtual bool YUI::hasLocalImageSupport  )  [inline, protected, virtual]
 

virtual bool YUI::hasPartitionSplitter  )  [inline, protected, virtual]
 

virtual bool YUI::hasSlider  )  [inline, protected, virtual]
 

virtual bool YUI::hasWizard  )  [inline, protected, virtual]
 

void YUI::idleLoop int  fd_ycp  )  [protected, virtual]
 

This virtual method is called when threads are activated in case the execution control is currently on the side of the module. This means that no UserInput() or PollInput() is pending. The module just does some work. The UI <-> module protocol is in the state UI waits for the next command . The UI can override this method when it wants to react to user input or other external events such as repaint requests from the X server.

Parameters:
fd_ycp filedescriptor that should be used to determine when to leave the idle loop. As soon as it is readable, the loop must be left. In order to avoid polling you can combine it with other ui-specific fds and do common select call.

void YUI::internalError const char *  msg  )  [virtual]
 

Issue an internal error. Derived UIs should overwrite this to display the error message in a suitable manner, e.g. open a popup (and wait for confirmation!).

The default implementation writes the error message to stderr. Notice: This function does _not_ abort the program.

bool YUI::isSymbolOrId const YCPValue val  )  const [protected]
 

Checks if the given value is either a symbol or a term `id().

Returns:
'true' if 'val' is a symbol or a valid `id().

void YUI::logUnknownOption const YCPTerm term,
const YCPValue option
[protected]
 

Logs a warning for an unknown widget option

Parameters:
term the widget term, e.g. PushButton( `opt( `unknown ), ... )
option the unknown option itself

void YUI::makeScreenShot string  filename  )  [protected, virtual]
 

UI-specific makeScreenShot function. This default implementation does nothing.

const char * YUI::moduleName  )  [protected]
 

void YUI::normalCursor  )  [protected, virtual]
 

UI-specific normalCursor function. This default implementation does nothing.

int YUI::parseMenuItemList const YCPList itemList,
YMenuButton menu_button,
YMenu parentMenu = 0
 

Parse a menu list (for menu buttons)

int YUI::parseMultiSelectionBoxItemList const YCPList item_list,
YMultiSelectionBox multi_sel_box
 

Parse an item list for a MultiSelectionBox

bool YUI::parseRgb const YCPValue val,
YColor color,
bool  complain
 

Parse an `rgb() value

int YUI::parseTreeItemList const YCPList itemList,
YTree tree,
YTreeItem parentItem = 0
 

Parse a tree item list

bool YUI::playingMacro  )  [inline, protected]
 

Return whether macro playing is in progress or not

void YUI::playMacro string  filename  )  [protected]
 

Play macro in file "filename". Any previous macro execution will be terminated prior to this.

void YUI::playNextMacroBlock  )  [protected]
 

Play the next block of an active macro player.

virtual YEvent* YUI::pollInput  )  [protected, pure virtual]
 

UI-specific PollInput() method.

This is called upon evaluating the UI::PollInput() builtin command. This method should just check if there are any pending events for the topmost dialog (currentDialog() ). This method never waits for any events - if there is no pending event, it returns 0.

If there is a pending event, a pointer to that event (newly created with the "new" operator) is returned. The generic UI component assumes ownership of this newly created object and destroys it when appropriate.

Derived UIs are required to implement this method.

string YUI::productName  )  const [inline]
 

Returns the current product name ("SuSE Linux", "SuSE Linux Enterprise Server", "United Linux", etc.).

This can be set with the UI::SetProductName() builtin. UI::GetProductName is the YCP equivalent to this function.

int YUI::Recode const string &  str,
const string &  from,
const string &  to,
string &  outstr
[static]
 

Might be handy if you have to recode strings from/to utf-8

bool YUI::recordingMacro  )  [inline, protected]
 

Return whether macro recording is in progress or not

void YUI::recordMacro string  filename  )  [protected]
 

Start macro recording to file "filename". Any previous active macro recorder will be terminated( regularly ) prior to this.

void YUI::redrawScreen  )  [protected, virtual]
 

UI-specific redrawScreen method. This default implementation does nothing.

void YUI::registerDialog YDialog  )  [protected]
 

Enters a dialog into the dialog map.

void YUI::rejectAllOptions const YCPTerm term,
const YCPList optList
[protected]
 

Logs warning messages for all widget options other than the standard ones - for widgets that don't handle any options.

Parameters:
term the widget term, e.g. PushButton( `opt( `unknown ), ... )
optList the list of options not yet processed

void YUI::removeDialog  )  [protected]
 

Removes the topmost dialog from the dialog stack and deletes it.

bool YUI::reverseLayout  )  [inline, static]
 

Returns 'true' if widget geometry should be reversed for languages that have right-to-left writing direction (Arabic, Hebrew).

virtual YCPValue YUI::runPkgSelection YWidget packageSelector  )  [inline, protected, virtual]
 

UI-specific runPkgSelection method. This default implementation does nothing. Use this to post-initialize widget stuff that cannot be done in the createPackageSelector() method.

void YUI::setCallback Y2Component callback  )  [inline]
 

Set a callback component.

YCPValue YUI::setConsoleFont const YCPString console_magic,
const YCPString font,
const YCPString screen_map,
const YCPString unicode_map,
const YCPString encoding
[protected, virtual]
 

UI-specific setConsoleFont() function. Returns YCPVoid() if OK and YCPNull() on error. This default implementation does nothing.

YCPValue YUI::setKeyboard  )  [protected, virtual]
 

YCPValue YUI::setLanguage const YCPTerm term  )  [protected, virtual]
 

UI-specific setLanguage() function. Returns YCPVoid() if OK and YCPNull() on error. This default implementation does nothing.

void YUI::setReverseLayout bool  rev  )  [inline, static]
 

Set reverse layout for Arabic / Hebrew support

void YUI::showDialog YDialog dialog  )  [protected, virtual]
 

Shows and activates a previously created dialog. The default implementation does nothing.

Parameters:
dialog dialog to show.

void YUI::signalUIThread  )  [protected]
 

Signals the ui thread by sending one byte through the pipe to it.

void YUI::signalYCPThread  )  [protected]
 

Signals the ycp thread by sending one byte through the pipe to it.

void YUI::stopRecordMacro  )  [protected]
 

Stop macro recording if this is in progress. Nothing happens when no macro recording is in progress.

void YUI::terminateUIThread  )  [protected]
 

Tells the ui thread that it should terminate and waits until it does so.

virtual bool YUI::textMode  )  [inline, protected, virtual]
 

void YUI::topmostConstructorHasFinished  ) 
 

Must be called after the constructor of the Qt/NCurses ui is ready. Starts the ui thread.

void YUI::uiThreadMainLoop  ) 
 

This method implements the UI thread in case it is existing. The loop consists of calling idleLoop, getting the next command from the YCPUIComponent, evaluating it, which possibly invovles calling userInput() or pollInput() and writes the answer back to the other thread where the request came from.

void YUI::unblockEvents  )  [inline]
 

Unblock events previously blocked. This is just an alias for blockEvents( false) for better readability.

Note: This method is intentionally not virtual.

virtual YEvent* YUI::userInput unsigned long  timeout_millisec = 0  )  [protected, pure virtual]
 

UI-specific UserInput() method.

This is called upon evaluating the UI::UserInput() builtin command. This method should remain in its own event loop until an event for the topmost dialog (currentDialog() ) is available or until the specified timeout (in milliseconds, 0 for "wait forever") is expired (in which case it should return the pointer to a YTimeoutEvent).

This method is to return a pointer to an event created with the "new" operator. The generic UI component assumes ownership of this newly created object and destroys it when appropriate.

The caller will gracefully handle if this method returns 0, albeit this is always an error which may result in an error message in the log file.

Derived UIs are required to implement this method.

bool YUI::waitForUIThread  )  [protected]
 

Waits for the ui thread to send one byte through the pipe to the ycp thread and reads this byte from the pipe.

bool YUI::waitForYCPThread  )  [protected]
 

Waits for the ycp thread to send one byte through the pipe to the ycp thread and reads this byte from the pipe.

YWidget * YUI::widgetWithId YContainerWidget widgetRoot,
const YCPValue id,
bool  log_error = false
 

Overloaded version of widgetWithId. Does not search for the widget id in the topmost dialog but in given widget tree.

Parameters:
widgetRoot root of the widget tree
id id without `id( .. )
log_error set to true if you want me to log an error if the id is not existing.

YWidget * YUI::widgetWithId const YCPValue id,
bool  log_error = false
 

Looks up a widget with a certain id. Returns 0 if no such exists. Only the topmost dialog ist searched for the id.

Parameters:
id id without `id( .. )
log_error set to true if you want me to log an error if the id is not existing.


Friends And Related Function Documentation

void* start_ui_thread void *  ui_int  )  [friend]
 


Member Data Documentation

YUIBuiltinCallData YUI::_builtinCallData [protected]
 

Inter-thread communication between the YCP thread and the UI thread: The YCP thread supplies data here and signals the UI thread, the UI thread picks up the data, executes the function, puts the result here and signals the YCP thread that waits until the result is available.

Y2Component* YUI::_callback [protected]
 

The callback component previously set with setCallback().

bool YUI::_events_blocked [protected]
 

Flag that keeps track of blocked events. Never query this directly, use eventsBlocked() instead.

string YUI::_moduleName [protected]
 

The current module name as set by the SetModuleName UI command.

string YUI::_productName [protected]
 

The current product name ("SuSE Linux", "United Linux", ...).

bool YUI::_reverseLayout = false [static, protected]
 

Returns 'true' if widget geometry should be reversed for languages that have right-to-left writing direction (Arabic, Hebrew).

YCPMap YUI::default_fkeys [protected]
 

The current mapping of widget labels to default function keys.

dialogstack_type YUI::dialogstack [protected]
 

Container for all dialogs. Each dialog has a unique id, which is a YCPValue.

deque<YCPValue> YUI::fakeUserInputQueue [protected]
 

Queue for synthetic (faked) user input events.

long long YUI::id_counter [protected]
 

Counter for creating unique widget ids

YMacroPlayer* YUI::macroPlayer [protected]
 

The current macro player.

YMacroRecorder* YUI::macroRecorder [protected]
 

The current macro recorder.

int YUI::pipe_from_ui[2] [protected]
 

Used to synchronize data transfer with the ui thread. It stores a pair of file descriptors of a pipe. For each YCP value we get from the ui thread, we read one aribrary byte from here.

int YUI::pipe_to_ui[2] [protected]
 

Used to synchronize data transfer with the ui thread. It stores a pair of file descriptors of a pipe. For each YCP value we send to the ui thread, we write one aribrary byte here.

bool YUI::terminate_ui_thread [protected]
 

This is a flag that signals the ui thread that it should terminate. This is done by setting the flag to true. The ui thread replies by setting the flag back to false directly after terminating itself.

pthread_t YUI::ui_thread [protected]
 

Handle to the ui thread.

bool YUI::with_threads [protected]
 

true if a seperate UI thread is created


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