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 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)
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)
int defaultFunctionKey (YCPString label)
string productName () const
virtual long deviceUnits (YUIDimension dim, float layout_units)
virtual float layoutUnits (YUIDimension dim, long device_units)
YCPValue callBuiltin (void *function, int argc, YCPValue argv[])
void setCallback (Y2Component *callback)
Y2ComponentgetCallback () const
YCPValue evaluateAskForExistingDirectory (const YCPString &startDir, const YCPString &headline)
 Opens a directory selection box and prompt the user for an existing directory. Opens a directory selection box and prompt the user for an existing directory.
YCPValue evaluateAskForExistingFile (const YCPString &startDir, const YCPString &filter, const YCPString &headline)
 Opens a file selection box and prompt the user for an existing file. Opens a file selection box and prompt the user for an existing file.
YCPValue evaluateAskForSaveFileName (const YCPString &startDir, const YCPString &filter, const YCPString &headline)
 Opens a file selection box and prompt the user for a file to save data to. Opens 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.
void evaluateBusyCursor ()
 Sets the mouse cursor to the busy cursor Sets the mouse cursor to the busy cursor, if the UI supports such a feature.
YCPValue evaluateChangeWidget (const YCPValue &value_id, const YCPValue &property, const YCPValue &new_value)
 Changes widget contents 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.
void evaluateCheckShortcuts ()
 Performs an explicit shortcut check after postponing shortcut checks. Performs an explicit shortcut check after postponing shortcut checks. Use this after calling PostponeShortcutCheck().
YCPValue evaluateCollectUserInput ()
 Collects the content of all input widgets in a dialog or in a container This function returns a list of maps describing the content of all input widgets in the current dialog (or in the widget with the specified ID, if any is given), such as TextEntry, ComboBox, SelectionBox, ... widgets (but not Labels, RichText, etc., that don't accept user input).
YCPValue evaluateCollectUserInput (const YCPTerm &widgetId)
YCPValue evaluateCloseDialog ()
 Closes an open dialog Closes the most recently opened dialog. It is an error to call CloseDialog if no dialog is open.
void evaluateDumpWidgetTree ()
 Debugging function Debugging function: Dumps the widget tree of the current dialog to the log file.
void evaluateFakeUserInput (const YCPValue &next_input)
 Fakes User Input Prepares 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.
YCPMap evaluateGetDisplayInfo ()
 Gets Display Info Gets information about the current display and the UI's capabilities.
YCPString evaluateGetLanguage (const YCPBoolean &strip_encoding)
 Gets Language 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".
YCPValue evaluateGetModulename (const YCPTerm &term)
 Gets the name of a Module This is tricky. The UI doesn't care about the current module name, only the translator does. However, since the translator acts as a filter between a client and the UI, it cant directly return the module name. The current implementation inserts the modules name in the translator and it arrives here as the term argument. So the example has no arguments, but the internal code checks for a string argument.
YCPString evaluateGetProductName ()
 Gets Product Name Returns the current product name ("SuSE Linux", "United Linux", etc.) for display in dialogs. This can be set with SetProductName().
YCPString evaluateGlyph (const YCPSymbol &symbol)
 Returns a special character ( a 'glyph' ) Returns a special character ( a 'glyph' ) according to the symbol specified.
YCPValue evaluateHasSpecialWidget (const YCPSymbol &widget)
 Checks for support of a special widget type. 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.
void evaluateMakeScreenShot (const YCPString &filename)
 Makes Screen Shot Makes a screen shot if the specific UI supports that. The Qt UI opens a file selection box if filename is empty.
void evaluateNormalCursor ()
 Sets the mouse cursor to the normal cursor Sets the mouse cursor to the normal cursor ( after BusyCursor ), if the UI supports such a feature.
YCPBoolean evaluateOpenDialog (const YCPTerm &term, const YCPTerm &term=YCPNull())
 Opens a new dialog. Opens a new dialog. widget is a term representation of the widget being displayed.Opens a Dialog with options Same as the OpenDialog with one argument, but you can specify options with a term of the form `opt.
void evaluatePlayMacro (const YCPString &filename)
 Plays a recorded macro Executes 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.
void evaluatePostponeShortcutCheck ()
 Postpones Shortcut Check Postpone keyboard shortcut checking during multiple changes to a dialog.
YCPValue evaluateQueryWidget (const YCPValue &value_id, const YCPValue &property)
 Queries Widget contents 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 evaluateRecalcLayout ()
 Recalculates Layout Recompute the layout of the current dialog.
YCPValue evaluateRecode (const YCPString &from, const YCPString &to, const YCPString &text)
 Recodes encoding of string from or to "UTF-8" encoding. Recodes 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 evaluateRecordMacro (const YCPString &filename)
 Records Macro into a file Begins recording a macro. Write the macro contents to file "macroFilename".
void evaluateRedrawScreen ()
 Redraws the screen Redraws the screen after it very likely has become garbled by some other output.
YCPBoolean evaluateReplaceWidget (const YCPValue &value_id, const YCPTerm &term)
YCPValue evaluateRunPkgSelection (const YCPValue &value_id)
 Initializes and run the PackageSelector widget Not to be used outside the package selection.
void evaluateSetConsoleFont (const YCPString &magic, const YCPString &font, const YCPString &screen_map, const YCPString &unicode_map, const YCPString &encoding)
 Sets Console Font Switches the text console to the specified font. See the setfont(8) command and the console HowTo for details.
void evaluateSetKeyboard ()
 Sets Keyboard.
YCPBoolean evaluateSetFocus (const YCPValue &value_id)
 Sets Focus to the specified widget 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.
void evaluateSetFunctionKeys (const YCPMap &new_keys)
 Sets the (default) function keys for a number of buttons. This function receives a map with button labels and the respective function key number that should be used if on other `opt( `key_F.. ) is specified.
void evaluateSetLanguage (const YCPString &lang, const YCPString &encoding=YCPNull())
 Sets the language of the UI Tells the UI that the user has selected another language. If the UI has any language dependend output that language setting is honored. lang is an ISO language string, such as de or de_DE. It is required to specify an encoding scheme, since not all user interfaces are capable of UTF-8.
void evaluateSetModulename (const YCPString &name)
 Sets Module Name Does nothing. The SetModulename command is introduced for the translator. But the translator sends all commands to the ui. So the ui shouldn't complain about this command.
void evaluateSetProductName (const YCPString &name)
 Sets Product Name Sets the current product name ("SuSE Linux", "United Linux", etc.) for displaying in dialogs and in RichText widgets (for help text) with the RichText &product; macro.
void evaluateStopRecordMacro ()
 Stops recording macro Stops macro recording. This is only necessary if you don't wish to record everything until the program terminates.
YCPBoolean evaluateWidgetExists (const YCPValue &value_id)
 Checks whether or not a widget with the given ID currently exists Checks 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 evaluateUserInput ()
 User Input 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).
YCPValue evaluateTimeoutUserInput (const YCPInteger &timeout)
 User Input with Timeout 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.
YCPValue evaluateWaitForEvent (const YCPInteger &timeout=YCPNull())
 Waits for Event Extended event handling - very much like UserInput(), but returns much more detailed information about the event that occured in a map.
YCPValue evaluateWizardCommand (const YCPTerm &command)
 Runs a wizard command Issues a command to a wizard widget with ID 'wizardId'. < This builtin is not for general use. Use the Wizard.ycp module instead..
YCPValue evaluatePollInput ()
 Poll Input 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.
void uiThreadMainLoop ()

Static Public Member Functions

static YUIui ()
static int Recode (const string &str, const string &from, const string &to, string &outstr)
static bool reverseLayout ()
static void setReverseLayout (bool rev)
static YCPValue callFunction (void *function, int argc, YCPValue argv[])
static bool checkId (const YCPValue &val, bool complain=true)
static YCPValue getId (const YCPValue &v)

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 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 YWidgetcreateDate (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPString &date)
virtual bool hasDate ()
virtual YWidgetcreateTime (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPString &time)
virtual bool hasTime ()
virtual YWidgetcreateDumbTab (YWidget *parent, YWidgetOpt &opt)
virtual bool hasDumbTab ()
virtual YWidgetcreateMultiProgressMeter (YWidget *parent, YWidgetOpt &opt, bool horizontal, const YCPList &maxValues)
virtual bool hasMultiProgressMeter ()
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 YWidgetcreatePatternSelector (YWidget *parent, YWidgetOpt &opt)
virtual bool hasPatternSelector ()
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 bool richTextSupportsTable ()
virtual bool leftHandedMouse ()
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)
 callback This is used for a callback mechanism. The expression will be sent to the WFM interpreter and evaluated there. USE WITH CAUTION.
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)
YWidgetcreateMarginBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg)
YWidgetcreateMinSize (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg, bool hor, bool vert)
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)
YWidgetcreateDate (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
YWidgetcreateTime (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr)
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)
YWidgetcreateMultiProgressMeter (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool horizontal)
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)
YWidgetcreatePatternSelector (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 isSymbolOrId (const YCPValue &val) 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

static bool _reverseLayout = false
static YUI_yui = 0

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


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
[static]
 

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

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

YWidget * YUI::createDate YWidget parent,
YWidgetOpt opt,
const YCPString label,
const YCPString date
[protected, virtual]
 

Creates a Date input filed

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,
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::createMarginBox YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg
[protected]
 

Helper function of createWidgetTree. Creates a MarginBox.

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::createMinSize YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
YRadioButtonGroup rbg,
bool  hor,
bool  vert
[protected]
 

Helper function of createWidgetTree. Creates a MinWidth, MinHeight, or MinSize.

Parameters:
hor use minimum width
vert use minimum height

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::createMultiProgressMeter YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr,
bool  horizontal
[protected]
 

Helper function of createWidgetTree. Creates a MultiProgressMeter.

YWidget * YUI::createMultiProgressMeter YWidget parent,
YWidgetOpt opt,
bool  horizontal,
const YCPList maxValues
[protected, virtual]
 

Creates a (horizontal or vertical) MultiProgressMeter.

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::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::createPatternSelector YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

Helper function of createWidgetTree. Creates a PatternSelector.

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

Creates a pattern selector.

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::createTime YWidget parent,
YWidgetOpt opt,
const YCPTerm term,
const YCPList optList,
int  argnr
[protected]
 

YWidget * YUI::createTime YWidget parent,
YWidgetOpt opt,
const YCPString label,
const YCPString time
[protected, virtual]
 

Creates a Time input filed

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

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.

long YUI::deviceUnits YUIDimension  dim,
float  layout_units
[virtual]
 

Convert logical layout spacing units into device dependent units. A default size dialog is assumed to be 80x25 layout spacing units.

Derived UI may want to reimplement this method.

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
 

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

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
 

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

AskForExistingFile

Parameters:
string startWith is the initial directory or file.
string filter is one or more blank-separated file patterns, e.g. "*.png *.jpg"
string headline is an explanatory text for the file selection box. Graphical UIs may omit that if no window manager is running.
Returns:
string 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
 

Opens a file selection box and prompt the user for a file to save data to. Opens 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.

AskForSaveFileName

Parameters:
string startWith is the initial directory or file.
string filter is one or more blank-separated file patterns, e.g. "*.png *.jpg"
string headline is an explanatory text for the file selection box. Graphical UIs may omit that if no window manager is running.
Returns:
string Returns the selected file name or nil if the user canceled the operation.

void YUI::evaluateBusyCursor  ) 
 

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

BusyCursor

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.

Returns:
void

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

callback This is used for a callback mechanism. The expression will be sent to the WFM interpreter and evaluated there. USE WITH CAUTION.

Implements the WFM or SCR callback command.

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

Changes widget contents 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.

ChangeWidget

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

Parameters:
symbol widgetId Can also be specified as `id( any widgetId )
symbol property
any newValue
Returns:
boolean Returns true on success.

void YUI::evaluateCheckShortcuts  ) 
 

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

CheckShortcuts

The normal sequence looks like this:

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

Returns:
void

YCPValue YUI::evaluateCloseDialog  ) 
 

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

CloseDialog()

Returns:
boolean Returns true on success.

YCPValue YUI::evaluateCollectUserInput const YCPTerm widgetId  ) 
 

YCPValue YUI::evaluateCollectUserInput  ) 
 

Collects the content of all input widgets in a dialog or in a container This function returns a list of maps describing the content of all input widgets in the current dialog (or in the widget with the specified ID, if any is given), such as TextEntry, ComboBox, SelectionBox, ... widgets (but not Labels, RichText, etc., that don't accept user input).

CollectUserInput

This function returns a list with a map for each input widget:

$[ "ID" : (widget ID) "Value" : (current value of this widget, depending on "Property") "Property" : (what property this is, `Value, `CurrentItem or whatever)

"WidgetClass" : (one of "TextEntry", "ComboBox", "SelectionBox", ...) "DebugLabel : ((translated) label of this widget, possibly shortened: "Name", ...) ]

Parameters:
term ID (optional)
Returns:
list<map<string, any>> list<map<string, any>> fieldContents = CollectUserInput();

void YUI::evaluateDumpWidgetTree  ) 
 

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

DumpWidgetTree

Returns:
void

void YUI::evaluateFakeUserInput const YCPValue next_input  ) 
 

Fakes User Input Prepares 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.

FakeUserInput

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

any nextUserInput

Returns:
void

YCPMap YUI::evaluateGetDisplayInfo  ) 
 

Gets Display Info Gets information about the current display and the UI's capabilities.

GetDisplayInfo

Returns:
map

YCPString YUI::evaluateGetLanguage const YCPBoolean strip  ) 
 

Gets Language 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".

GetLanguage

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).

Parameters:
boolean strip_encoding
Returns:
string

YCPValue YUI::evaluateGetModulename const YCPTerm term  ) 
 

Gets the name of a Module This is tricky. The UI doesn't care about the current module name, only the translator does. However, since the translator acts as a filter between a client and the UI, it cant directly return the module name. The current implementation inserts the modules name in the translator and it arrives here as the term argument. So the example has no arguments, but the internal code checks for a string argument.

GetModulename

Returns:
string
GetModulename()

YCPString YUI::evaluateGetProductName  ) 
 

Gets Product Name Returns the current product name ("SuSE Linux", "United Linux", etc.) for display in dialogs. This can be set with SetProductName().

GetProductName

Note: In help texts in RichText widgets, a predefined macro &product; can be used for the same purpose.

Returns:
string Product Name sformat( "Welcome to %1", GetProductName() );

YCPString YUI::evaluateGlyph const YCPSymbol glyphSym  ) 
 

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

Glyph

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;".

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

Parameters:
symbol glyph
Returns:
string

YCPValue YUI::evaluateHasSpecialWidget const YCPSymbol widget  ) 
 

Checks for support of a special widget type. 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.

HasSpecialWidget

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  ) 
 

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

MakeScreenShot

Parameters:
string filename
Returns:
void

void YUI::evaluateNormalCursor  ) 
 

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

NormalCursor

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.

Returns:
void

YCPBoolean YUI::evaluateOpenDialog const YCPTerm dialog_term,
const YCPTerm opts = YCPNull()
 

Opens a new dialog. Opens a new dialog. widget is a term representation of the widget being displayed.Opens a Dialog with options Same as the OpenDialog with one argument, but you can specify options with a term of the form `opt.

OpenDialog OpenDialog_with_options

The option `defaultsize makes the dialog be resized to the default size, for example for the Qt interface the -geometry option is honored and for ncurses the dialog fills the whole window.

The option `centered centers the dialog to the desktop. This has no effect for popup dialogs that are a child of a `defaultsize dialog that is currently visible.

The option `decorated add a window border around the dialog, which comes in handy if no window manager is running. This option may be ignored in non-graphical UIs.

`smallDecorations tells the window manager to use only minimal decorations - in particular, no title bar. This is useful for very small popups (like only a one line label and no button). Don't overuse this. This option is ignored for `defaultsize dialogs.

The option `warncolor displays the entire dialog in a bright warning color.

The option `infocolor is a less intrusive color.

Parameters:
term options
term widget
Returns:
boolean
OpenDialog( `opt( `defaultsize ), `Label( "Hi" ) )

void YUI::evaluatePlayMacro const YCPString filename  ) 
 

Plays a recorded macro Executes 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.

PlayMacro

Parameters:
string macroFileName
Returns:
void

YCPValue YUI::evaluatePollInput  ) 
 

Poll Input 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.

PollInput

Returns:
any

void YUI::evaluatePostponeShortcutCheck  ) 
 

Postpones Shortcut Check Postpone keyboard shortcut checking during multiple changes to a dialog.

PostponeShortcutCheck

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();

Returns:
void

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

Queries Widget contents 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.

QueryWidget

Parameters:
symbol widgetId Can also be specified as `id( any id )
symbol|term property
Returns:
any

void YUI::evaluateRecalcLayout  ) 
 

Recalculates Layout Recompute the layout of the current dialog.

RecalcLayout

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.

Returns:
void

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

Recodes encoding of string from or to "UTF-8" encoding. Recodes 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. ).

Recode

Parameters:
string from
string to
string text
Returns:
any

void YUI::evaluateRecordMacro const YCPString filename  ) 
 

Records Macro into a file Begins recording a macro. Write the macro contents to file "macroFilename".

RecordMacro

Parameters:
string macroFileName
Returns:
void

void YUI::evaluateRedrawScreen  ) 
 

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

RedrawScreen

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.

Returns:
void

YCPBoolean YUI::evaluateReplaceWidget const YCPValue id_value,
const YCPTerm new_widget
 

ReplaceWidget

Replaces a complete widget (or widget subtree) with an other widget (or widget tree). You can only replace the widget contained in a ReplacePoint. As parameters to ReplaceWidget specify the id of the ReplacePoint and the new widget.

Parameters:
symbol id
term newWidget
Returns:
boolean

YCPValue YUI::evaluateRunPkgSelection const YCPValue value_id  ) 
 

Initializes and run the PackageSelector widget Not to be used outside the package selection.

RunPkgSelection

Initialize and run the PackageSelector widget identified by 'pkgSelId'.

Black magic to everybody outside. ;- )

Parameters:
any pkgSelId
Returns:
any Returns `cancel if the user wishes to cancel his selections.

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

Sets Console Font Switches the text console to the specified font. See the setfont(8) command and the console HowTo for details.

SetConsoleFont

See also:
setfont(8)
Parameters:
string console_magic
string font
string screen_map
string unicode_map
string encoding
Returns:
void
SetConsoleFont( "( K", "lat2u-16.psf", "latin2u.scrnmap", "lat2u.uni", "latin1" )

YCPBoolean YUI::evaluateSetFocus const YCPValue id_value  ) 
 

Sets Focus to the specified widget 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.

SetFocus

Parameters:
symbol widgetId
Returns:
boolean Returns true on success (i.e. the widget accepted the focus).

void YUI::evaluateSetFunctionKeys const YCPMap new_fkeys  ) 
 

Sets the (default) function keys for a number of buttons. This function receives a map with button labels and the respective function key number that should be used if on other `opt( `key_F.. ) is specified.

SetFunctionKeys

Any keyboard shortcuts in those labels are silently ignored so this is safe to use even if the UI's internal shortcut manager rearranges shortcuts.

Each call to this function overwrites the data of any previous calls.

Parameters:
map fkeys
Returns:
void SetFunctionKeys( $[ "Back": 8, "Next": 10, ... ] );

void YUI::evaluateSetKeyboard  ) 
 

Sets Keyboard.

SetKeyboard

Returns:
void SetKeyboard( )

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

Sets the language of the UI Tells the UI that the user has selected another language. If the UI has any language dependend output that language setting is honored. lang is an ISO language string, such as de or de_DE. It is required to specify an encoding scheme, since not all user interfaces are capable of UTF-8.

SetLanguage

Parameters:
string lang Language selected by user string encoding
Returns:
void
SetLanguage( "de_DE@euro" ) SetLanguage( "en_GB" )

void YUI::evaluateSetModulename const YCPString name  ) 
 

Sets Module Name Does nothing. The SetModulename command is introduced for the translator. But the translator sends all commands to the ui. So the ui shouldn't complain about this command.

SetModulename

Parameters:
string module
Returns:
void SetModulename( "inst_environment" )

void YUI::evaluateSetProductName const YCPString name  ) 
 

Sets Product Name Sets the current product name ("SuSE Linux", "United Linux", etc.) for displaying in dialogs and in RichText widgets (for help text) with the RichText &product; macro.

SetProductName

This product name should be concise and meaningful to the user and not cluttered with detailed version information. Don't use something like "SuSE Linux 12.3-i786 Professional". Use something like "SuSE Linux" instead.

This information can be retrieved with the GetProductName() builtin.

Parameters:
string prod
Returns:
void
SetProductName( "SuSE HyperWall" );

void YUI::evaluateStopRecordMacro  ) 
 

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

StopRecordingMacro

Returns:
void

YCPValue YUI::evaluateTimeoutUserInput const YCPInteger timeout  ) 
 

User Input with Timeout 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.

TimeoutUserInput

Parameters:
integer timeout_millisec
Returns:
any

YCPValue YUI::evaluateUserInput  ) 
 

User Input 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).

UserInput

Returns:
any

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

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

WaitForEvent

timeout_millisec

Returns:
map

YCPBoolean YUI::evaluateWidgetExists const YCPValue id_value  ) 
 

Checks whether or not a widget with the given ID currently exists Checks 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.

WidgetExists

Parameters:
symbol widgetId
Returns:
boolean

YCPValue YUI::evaluateWizardCommand const YCPTerm command  ) 
 

Runs a wizard command Issues a command to a wizard widget with ID 'wizardId'. < This builtin is not for general use. Use the Wizard.ycp module instead..

WizardCommand

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'.

Parameters:
term wizardCommand
Returns:
boolean 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.

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  )  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  )  [static]
 

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::hasDate  )  [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::hasMultiProgressMeter  )  [inline, protected, virtual]
 

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

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

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

virtual bool YUI::hasTime  )  [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().

float YUI::layoutUnits YUIDimension  dim,
long  device_units
[virtual]
 

Convert device dependent units into logical layout spacing units. A default size dialog is assumed to be 80x25 layout spacing units.

Derived UI may want to reimplement this method.

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

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)

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

Parse an `rgb() value

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.

static 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 bool YUI::richTextSupportsTable  )  [inline, protected, virtual]
 

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.

static 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.

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

Access the global UI.

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).

YUI * YUI::_yui = 0 [static, protected]
 

Global reference to the UI

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 Jun 16 18:07:47 2006 for yast2-core by  doxygen 1.4.6