#include <YUI.h>
Public Member Functions | |
| virtual | ~YUI () |
| YDialog * | currentDialog () 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) |
| YWidget * | createWidgetTree (YWidget *parent, YWidgetOpt &opt, YRadioButtonGroup *rbg, const YCPTerm &term) |
| YWidget * | createWidgetTree (YWidget *parent, YRadioButtonGroup *rbg, const YCPTerm &term) |
| YWidget * | widgetWithId (const YCPValue &id, bool log_error=false) |
| YWidget * | widgetWithId (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) |
| Y2Component * | getCallback () 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. | |
| void | evaluateBeep () |
| Beeps the system bell Beeps the system bell. This is implemented by the frontend, which may do a visual beep if the system is set up that way (eg. for accessiblity purposes). | |
| 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 &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. | |
| 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 YUI * | ui () |
| 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 YEvent * | userInput (unsigned long timeout_millisec=0)=0 |
| virtual YEvent * | pollInput ()=0 |
| virtual void | showDialog (YDialog *dialog) |
| virtual void | closeDialog (YDialog *dialog) |
| virtual YCPString | glyph (const YCPSymbol &glyphSymbol) |
| virtual YDialog * | createDialog (YWidgetOpt &opt)=0 |
| virtual YContainerWidget * | createSplit (YWidget *parent, YWidgetOpt &opt, YUIDimension dimension)=0 |
| virtual YContainerWidget * | createReplacePoint (YWidget *parent, YWidgetOpt &opt)=0 |
| virtual YContainerWidget * | createAlignment (YWidget *parent, YWidgetOpt &opt, YAlignmentType halign, YAlignmentType valign)=0 |
| virtual YContainerWidget * | createSquash (YWidget *parent, YWidgetOpt &opt, bool hsquash, bool vsquash)=0 |
| virtual YContainerWidget * | createRadioButtonGroup (YWidget *parent, YWidgetOpt &opt)=0 |
| virtual YContainerWidget * | createFrame (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0 |
| virtual YWidget * | createEmpty (YWidget *parent, YWidgetOpt &opt)=0 |
| virtual YWidget * | createSpacing (YWidget *parent, YWidgetOpt &opt, float size, bool horizontal, bool vertical)=0 |
| virtual YWidget * | createLabel (YWidget *parent, YWidgetOpt &opt, const YCPString &text)=0 |
| virtual YWidget * | createRichText (YWidget *parent, YWidgetOpt &opt, const YCPString &text)=0 |
| virtual YWidget * | createLogView (YWidget *parent, YWidgetOpt &opt, const YCPString &label, int visibleLines, int maxLines)=0 |
| virtual YWidget * | createPushButton (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0 |
| virtual YWidget * | createMenuButton (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0 |
| virtual YWidget * | createRadioButton (YWidget *parent, YWidgetOpt &opt, YRadioButtonGroup *rbg, const YCPString &label, bool checked)=0 |
| virtual YWidget * | createCheckBox (YWidget *parent, YWidgetOpt &opt, const YCPString &label, bool checked)=0 |
| virtual YWidget * | createTextEntry (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPString &text)=0 |
| virtual YWidget * | createMultiLineEdit (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPString &text)=0 |
| virtual YWidget * | createSelectionBox (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0 |
| virtual YWidget * | createMultiSelectionBox (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0 |
| virtual YWidget * | createComboBox (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0 |
| virtual YWidget * | createTree (YWidget *parent, YWidgetOpt &opt, const YCPString &label)=0 |
| virtual YWidget * | createTable (YWidget *parent, YWidgetOpt &opt, vector< string > header)=0 |
| virtual YWidget * | createProgressBar (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPInteger &maxprogress, const YCPInteger &progress)=0 |
| virtual YWidget * | createImage (YWidget *parent, YWidgetOpt &opt, YCPByteblock imagedata, YCPString defaulttext)=0 |
| virtual YWidget * | createImage (YWidget *parent, YWidgetOpt &opt, YCPString file_name, YCPString defaulttext)=0 |
| virtual YWidget * | createIntField (YWidget *parent, YWidgetOpt &opt, const YCPString &label, int minValue, int maxValue, int initialValue)=0 |
| virtual YWidget * | createPackageSelector (YWidget *parent, YWidgetOpt &opt, const YCPString &floppyDevice)=0 |
| virtual YWidget * | createPkgSpecial (YWidget *parent, YWidgetOpt &opt, const YCPString &subwidget)=0 |
| virtual YWidget * | createDummySpecialWidget (YWidget *parent, YWidgetOpt &opt) |
| virtual bool | hasDummySpecialWidget () |
| virtual YWidget * | createDownloadProgress (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPString &filename, int expectedSize) |
| virtual bool | hasDownloadProgress () |
| virtual YWidget * | createBarGraph (YWidget *parent, YWidgetOpt &opt) |
| virtual bool | hasBarGraph () |
| virtual YWidget * | createColoredLabel (YWidget *parent, YWidgetOpt &opt, YCPString label, YColor foreground, YColor background, int margin) |
| virtual bool | hasColoredLabel () |
| virtual YWidget * | createDate (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPString &date) |
| virtual bool | hasDate () |
| virtual YWidget * | createTime (YWidget *parent, YWidgetOpt &opt, const YCPString &label, const YCPString &time) |
| virtual bool | hasTime () |
| virtual YWidget * | createDumbTab (YWidget *parent, YWidgetOpt &opt) |
| virtual bool | hasDumbTab () |
| virtual YWidget * | createMultiProgressMeter (YWidget *parent, YWidgetOpt &opt, bool horizontal, const YCPList &maxValues) |
| virtual bool | hasMultiProgressMeter () |
| virtual YWidget * | createSlider (YWidget *parent, YWidgetOpt &opt, const YCPString &label, int minValue, int maxValue, int initialValue) |
| virtual bool | hasSlider () |
| virtual YWidget * | 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) |
| virtual bool | hasPartitionSplitter () |
| virtual YWidget * | createPatternSelector (YWidget *parent, YWidgetOpt &opt) |
| virtual bool | hasPatternSelector () |
| virtual YWidget * | createWizard (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 void | beep () |
| 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 () |
| YEvent * | filterInvalidEvents (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. | |
| YRadioButtonGroup * | findRadioButtonGroup (YContainerWidget *root, YWidget *w, bool *contains) |
| YWidget * | createReplacePoint (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg) |
| YWidget * | createEmpty (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool hstretchable, bool vstretchable) |
| YWidget * | createSpacing (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool horizontal, bool vertical) |
| YWidget * | createFrame (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg) |
| YWidget * | createWeight (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg, YUIDimension dim) |
| YWidget * | createAlignment (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg, YAlignmentType halign, YAlignmentType valign) |
| YWidget * | createMarginBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg) |
| YWidget * | createMinSize (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg, bool hor, bool vert) |
| YWidget * | createSquash (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg, bool hsquash, bool vsquash) |
| YWidget * | createLBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg, YUIDimension dim) |
| YWidget * | createLabel (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool heading) |
| YWidget * | createDate (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createTime (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createRichText (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createLogView (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createPushButton (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool isIconButton) |
| YWidget * | createMenuButton (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createCheckBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createRadioButton (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg) |
| YWidget * | createRadioButtonGroup (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg) |
| YWidget * | createTextEntry (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool password) |
| YWidget * | createMultiLineEdit (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createSelectionBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createMultiSelectionBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createComboBox (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createTree (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createTable (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createProgressBar (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createImage (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createIntField (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createPackageSelector (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createPkgSpecial (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createWizard (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createDummySpecialWidget (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createDownloadProgress (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createBarGraph (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createColoredLabel (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createDumbTab (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, YRadioButtonGroup *rbg) |
| YWidget * | createMultiProgressMeter (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr, bool horizontal) |
| YWidget * | createSlider (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createPartitionSplitter (YWidget *parent, YWidgetOpt &opt, const YCPTerm &term, const YCPList &optList, int argnr) |
| YWidget * | createPatternSelector (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 |
| YMacroRecorder * | macroRecorder |
| YMacroPlayer * | macroPlayer |
| deque< YCPValue > | fakeUserInputQueue |
| YCPMap | default_fkeys |
| bool | _events_blocked |
| Y2Component * | _callback |
Static Protected Attributes | |
| static bool | _reverseLayout |
| static YUI * | _yui |
Friends | |
| void * | start_ui_thread (void *ui_int) |
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.
typedef vector<YDialog *> YUI::dialogstack_type [protected] |
Define type for the dialog map
| YUI::YUI | ( | bool | with_threads | ) | [protected] |
Constructor.
| YUI::~YUI | ( | ) | [virtual] |
Destructor.
| YDialog * YUI::currentDialog | ( | ) | const |
Looks up the topmost dialog
| 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::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 bool YUI::eventsBlocked | ( | ) | const [inline, virtual] |
Returns 'true' if events are currently blocked.
Reimplent this if you reimplement blockEvents().
| void YUI::topmostConstructorHasFinished | ( | ) |
Must be called after the constructor of the Qt/NCurses ui is ready. Starts the ui thread.
| 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.
| 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
| int YUI::parseMenuItemList | ( | const YCPList & | itemList, | |
| YMenuButton * | menu_button, | |||
| YMenu * | parentMenu = 0 | |||
| ) |
Parse a menu list (for menu buttons)
| YWidget* YUI::createWidgetTree | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| YRadioButtonGroup * | rbg, | |||
| const YCPTerm & | term | |||
| ) |
Creates a new widget tree.
| parent | the widget or dialog this widget is contained in | |
| term | YCPTerm describing the widget | |
| rbg | Pointer to the current radio button group |
| YWidget * YUI::createWidgetTree | ( | YWidget * | parent, | |
| YRadioButtonGroup * | rbg, | |||
| const YCPTerm & | term | |||
| ) |
Overloaded version for convenience. Supplies empty widget options.
Looks up a widget with a certain id. Returns 0 if no such exists. Only the topmost dialog ist searched for the id.
| 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 | ( | 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.
| 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. |
| 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.
| 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.
| 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.
| 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.
| 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).
| static void YUI::setReverseLayout | ( | bool | rev | ) | [inline, static] |
Set reverse layout for Arabic / Hebrew support
Call 'function' with 'argc' YCPValue parameters and return the result of 'function'.
| void YUI::setCallback | ( | Y2Component * | callback | ) | [inline] |
Set a callback component.
| Y2Component* YUI::getCallback | ( | ) | const [inline] |
Returns the callback previously set with setCallback().
| 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
| 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. |
| 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
| 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. |
| 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.
| void YUI::evaluateBeep | ( | ) |
Beeps the system bell Beeps the system bell. This is implemented by the frontend, which may do a visual beep if the system is set up that way (eg. for accessiblity purposes).
Beep
| 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" ).
| symbol | widgetId Can also be specified as `id( any widgetId ) | |
| symbol | property | |
| any | newValue |
| 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();
| 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", ...) ]
| term | ID (optional) |
| 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()
| void YUI::evaluateDumpWidgetTree | ( | ) |
Debugging function Debugging function: Dumps the widget tree of the current dialog to the log file.
DumpWidgetTree
| 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
| YCPMap YUI::evaluateGetDisplayInfo | ( | ) |
Gets Display Info Gets information about the current display and the UI's capabilities.
GetDisplayInfo
| 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).
| boolean | strip_encoding |
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
| 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 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 "->".
If an unknown glyph symbol is specified, 'nil' is returned.
| symbol | glyph |
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.
| void YUI::evaluateMakeScreenShot | ( | const YCPString & | filename | ) |
| 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.
| 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.
| term | options | |
| term | widget |
| 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
| string | macroFileName |
| 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();
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
| symbol | widgetId Can also be specified as `id( any id ) | |
| symbol|term | property |
| 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.
| 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
| string | from | |
| string | to | |
| string | text |
| void YUI::evaluateRecordMacro | ( | const YCPString & | filename | ) |
Records Macro into a file Begins recording a macro. Write the macro contents to file "macroFilename".
RecordMacro
| string | macroFileName |
| 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.
| 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.
| symbol | id | |
| term | newWidget |
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. ;- )
| any | pkgSelId |
| 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
| string | console_magic | |
| string | font | |
| string | screen_map | |
| string | unicode_map | |
| string | encoding |
| void YUI::evaluateSetKeyboard | ( | ) |
Sets Keyboard.
SetKeyboard
| 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
| symbol | widgetId |
| 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.
| map | fkeys |
| 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
| string | lang Language selected by user string encoding |
| 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
| string | module |
| 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.
| string | prod |
| 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
| 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
| symbol | widgetId |
| 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
| 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
| integer | timeout_millisec |
| 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
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'.
| term | wizardCommand |
| 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
| 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.
| 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.
Assumes that the value v is of the form `id( any i ) and returns the contained i.
| const char * YUI::moduleName | ( | ) | [protected] |
| 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.
| 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. |
| 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.
| 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.
| void YUI::showDialog | ( | YDialog * | dialog | ) | [protected, virtual] |
Shows and activates a previously created dialog. The default implementation does nothing.
| dialog | dialog to show. |
| 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.
| dialog | dialog to close. |
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 YDialog* YUI::createDialog | ( | YWidgetOpt & | opt | ) | [protected, pure virtual] |
Creates a dialog.
| widget | Widget the dialog contains. Each dialog contains exactly one widget. |
| virtual YContainerWidget* YUI::createSplit | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| YUIDimension | dimension | |||
| ) | [protected, pure virtual] |
Creates a split
| virtual YContainerWidget* YUI::createReplacePoint | ( | YWidget * | parent, | |
| YWidgetOpt & | opt | |||
| ) | [protected, pure virtual] |
Creates a replace point.
| virtual YContainerWidget* YUI::createAlignment | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| YAlignmentType | halign, | |||
| YAlignmentType | valign | |||
| ) | [protected, pure virtual] |
Creates an alignment widget
| virtual YContainerWidget* YUI::createSquash | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| bool | hsquash, | |||
| bool | vsquash | |||
| ) | [protected, pure virtual] |
Creates a squash widget
| virtual YContainerWidget* YUI::createRadioButtonGroup | ( | YWidget * | parent, | |
| YWidgetOpt & | opt | |||
| ) | [protected, pure virtual] |
Creates a radio button group.
| virtual YContainerWidget* YUI::createFrame | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label | |||
| ) | [protected, pure virtual] |
Creates a frame widget
| virtual YWidget* YUI::createEmpty | ( | YWidget * | parent, | |
| YWidgetOpt & | opt | |||
| ) | [protected, pure virtual] |
Creates an empty widget
| virtual YWidget* YUI::createSpacing | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| float | size, | |||
| bool | horizontal, | |||
| bool | vertical | |||
| ) | [protected, pure virtual] |
Creates a spacing widget
| virtual YWidget* YUI::createLabel | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | text | |||
| ) | [protected, pure virtual] |
Creates a label.
| 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 ) |
| virtual YWidget* YUI::createRichText | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | text | |||
| ) | [protected, pure virtual] |
Creates a rich text widget
| text | Initial text of the label |
| virtual YWidget* YUI::createLogView | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label, | |||
| int | visibleLines, | |||
| int | maxLines | |||
| ) | [protected, pure virtual] |
Creates a log view widget
| label | label above the log view | |
| visibleLines | default number of vislible lines | |
| maxLines | number of lines to store (use 0 for "all") |
| virtual YWidget* YUI::createPushButton | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label | |||
| ) | [protected, pure virtual] |
Creates a push button.
| label | Label of the button |
| virtual YWidget* YUI::createMenuButton | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label | |||
| ) | [protected, pure virtual] |
Creates a menu button.
| label | Label of the button |
| 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
| label | Label of the radio button | |
| rbg | the radio button group the new button will belong to |
| virtual YWidget* YUI::createCheckBox | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label, | |||
| bool | checked | |||
| ) | [protected, pure virtual] |
Creates a check box
| label | Label of the checkbox | |
| true | if it is checked |
| 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.
| virtual YWidget* YUI::createMultiLineEdit | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label, | |||
| const YCPString & | text | |||
| ) | [protected, pure virtual] |
Creates a MultiLineEdit widget.
| virtual YWidget* YUI::createSelectionBox | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label | |||
| ) | [protected, pure virtual] |
Creates a selection box
| virtual YWidget* YUI::createMultiSelectionBox | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label | |||
| ) | [protected, pure virtual] |
Creates a multi selection box
| virtual YWidget* YUI::createComboBox | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label | |||
| ) | [protected, pure virtual] |
Creates a combo box
| virtual YWidget* YUI::createTree | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label | |||
| ) | [protected, pure virtual] |
Creates a tree
| virtual YWidget* YUI::createTable | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| vector< string > | header | |||
| ) | [protected, pure virtual] |
Creates a table widget
| virtual YWidget* YUI::createProgressBar | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label, | |||
| const YCPInteger & | maxprogress, | |||
| const YCPInteger & | progress | |||
| ) | [protected, pure virtual] |
Creates a progress bar
| virtual YWidget* YUI::createImage | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| YCPByteblock | imagedata, | |||
| YCPString | defaulttext | |||
| ) | [protected, pure virtual] |
Creates an image widget from a YCP byteblock
| 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::createIntField | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label, | |||
| int | minValue, | |||
| int | maxValue, | |||
| int | initialValue | |||
| ) | [protected, pure virtual] |
Creates an IntField widget.
| 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".
| 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::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!
| virtual bool YUI::hasDummySpecialWidget | ( | ) | [inline, protected, virtual] |
| 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!
| virtual bool YUI::hasDownloadProgress | ( | ) | [inline, protected, virtual] |
| 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!
| virtual bool YUI::hasBarGraph | ( | ) | [inline, protected, virtual] |
| 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!
| virtual bool YUI::hasColoredLabel | ( | ) | [inline, protected, virtual] |
| YWidget * YUI::createDate | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label, | |||
| const YCPString & | date | |||
| ) | [protected, virtual] |
Creates a Date input filed
| virtual bool YUI::hasDate | ( | ) | [inline, protected, virtual] |
| YWidget * YUI::createTime | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPString & | label, | |||
| const YCPString & | time | |||
| ) | [protected, virtual] |
Creates a Time input filed
| virtual bool YUI::hasTime | ( | ) | [inline, protected, virtual] |
| 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!
| virtual bool YUI::hasDumbTab | ( | ) | [inline, protected, virtual] |
| 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!
| virtual bool YUI::hasMultiProgressMeter | ( | ) | [inline, protected, virtual] |
| 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!
| virtual bool YUI::hasSlider | ( | ) | [inline, protected, virtual] |
| 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!
| 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 |
| virtual bool YUI::hasPartitionSplitter | ( | ) | [inline, protected, virtual] |
| YWidget * YUI::createPatternSelector | ( | YWidget * | parent, | |
| YWidgetOpt & | opt | |||
| ) | [protected, virtual] |
Creates a pattern selector.
| virtual bool YUI::hasPatternSelector | ( | ) | [inline, protected, virtual] |
| 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.
| virtual bool YUI::hasWizard | ( | ) | [inline, protected, virtual] |
UI-specific setLanguage() function. Returns YCPVoid() if OK and YCPNull() on error. This default implementation does nothing.
| 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] |
| virtual int YUI::getDisplayWidth | ( | ) | [inline, protected, virtual] |
UI-specific getDisplayInfo() functions. See UI builtin GetDisplayInfo() doc for details.
| virtual int YUI::getDisplayHeight | ( | ) | [inline, protected, virtual] |
| virtual int YUI::getDisplayDepth | ( | ) | [inline, protected, virtual] |
| virtual long YUI::getDisplayColors | ( | ) | [inline, protected, virtual] |
| virtual int YUI::getDefaultWidth | ( | ) | [inline, protected, virtual] |
| virtual int YUI::getDefaultHeight | ( | ) | [inline, protected, virtual] |
| virtual bool YUI::textMode | ( | ) | [inline, protected, virtual] |
| virtual bool YUI::hasImageSupport | ( | ) | [inline, protected, virtual] |
| virtual bool YUI::hasLocalImageSupport | ( | ) | [inline, protected, virtual] |
| virtual bool YUI::hasAnimationSupport | ( | ) | [inline, protected, virtual] |
| virtual bool YUI::hasIconSupport | ( | ) | [inline, protected, virtual] |
| virtual bool YUI::hasFullUtf8Support | ( | ) | [inline, protected, virtual] |
| virtual bool YUI::richTextSupportsTable | ( | ) | [inline, protected, virtual] |
| virtual bool YUI::leftHandedMouse | ( | ) | [inline, protected, virtual] |
| void YUI::busyCursor | ( | ) | [protected, virtual] |
UI-specific busyCursor function. This default implementation does nothing.
| void YUI::normalCursor | ( | ) | [protected, virtual] |
UI-specific normalCursor function. This default implementation does nothing.
| void YUI::redrawScreen | ( | ) | [protected, virtual] |
UI-specific redrawScreen method. This default implementation does nothing.
| void YUI::makeScreenShot | ( | string | filename | ) | [protected, virtual] |
UI-specific makeScreenShot function. This default implementation does nothing.
| void YUI::beep | ( | ) | [protected, virtual] |
UI-specific beep method.
Emit acoustic signal or something equivalent. This default implementation does nothing.
UI-specific runPkgSelection method. This default implementation does nothing. Use this to post-initialize widget stuff that cannot be done in the createPackageSelector() method.
| 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.
| YCPValue YUI::evaluateLocale | ( | const YCPLocale & | ) | [protected] |
Evaluates a locale. Evaluate _( "string" ) to "string".
| 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::stopRecordMacro | ( | ) | [protected] |
Stop macro recording if this is in progress. Nothing happens when no macro recording is in progress.
| void YUI::playMacro | ( | string | filename | ) | [protected] |
Play macro in file "filename". Any previous macro execution will be terminated prior to this.
| bool YUI::recordingMacro | ( | ) | [inline, protected] |
Return whether macro recording is in progress or not
| bool YUI::playingMacro | ( | ) | [inline, protected] |
Return whether macro playing is in progress or not
| void YUI::terminateUIThread | ( | ) | [protected] |
Tells the ui thread that it should terminate and waits until it does so.
| void YUI::createUIThread | ( | ) | [protected] |
Creates and launches the ui thread.
| void YUI::signalUIThread | ( | ) | [protected] |
Signals the ui thread by sending one byte through the pipe to it.
| 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.
| void YUI::signalYCPThread | ( | ) | [protected] |
Signals the ycp thread by sending one byte through the pipe to it.
| 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.
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.
| 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).
| 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.
| 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. |
| 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
| 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 |
| 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
| 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.
| horizontal | true if this is a HSpacing | |
| vertical | true if this is a VSpacing |
| 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.
| 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.
| 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::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.
| halign | the horizontal alignment | |
| valign | the vertical alignment |
| 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::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.
| hor | use minimum width | |
| vert | use minimum height |
| 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.
| hsquash | whether the child is being squashed horizontally | |
| vsquash | whether the child is being squashed vertically |
| 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
| dim | Dimension of the layoutbox |
| 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.
| heading | true if the label is a Heading() |
| YWidget * YUI::createDate | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
| YWidget * YUI::createTime | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
| YWidget * YUI::createRichText | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a RichText.
| YWidget * YUI::createLogView | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a LogView.
| 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.
| YWidget * YUI::createMenuButton | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function for createWidgetTreeTree. Creates a menu button.
| YWidget * YUI::createCheckBox | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a CheckBox.
| 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.
| 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.
| 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
| password | true if this should be password entry field |
| YWidget * YUI::createMultiLineEdit | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a MultiLineEdit.
| YWidget * YUI::createSelectionBox | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a SelectionBox.
| YWidget * YUI::createMultiSelectionBox | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function for createWidgetTreeTree. Creates a MultiSelectionBox.
| YWidget * YUI::createComboBox | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a ComboBox.
| YWidget * YUI::createTree | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a Tree.
| YWidget * YUI::createTable | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a Table.
| YWidget * YUI::createProgressBar | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a ProgressBar.
| YWidget * YUI::createImage | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates an Image.
| YWidget * YUI::createIntField | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates an IntField.
| YWidget * YUI::createPackageSelector | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a PackageSelector.
| YWidget * YUI::createPkgSpecial | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a PkgSpecial subwidget.
| 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::createDummySpecialWidget | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a DummySpecialWidget.
| 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::createBarGraph | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a BarGraph.
| 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::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::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::createSlider | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a Slider.
| 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::createPatternSelector | ( | YWidget * | parent, | |
| YWidgetOpt & | opt, | |||
| const YCPTerm & | term, | |||
| const YCPList & | optList, | |||
| int | argnr | |||
| ) | [protected] |
Helper function of createWidgetTree. Creates a PatternSelector.
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.
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 ) ]
| 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. |
Logs a warning for an unknown widget option
| term | the widget term, e.g. PushButton( `opt( `unknown ), ... ) | |
| option | the unknown option itself |
Logs warning messages for all widget options other than the standard ones - for widgets that don't handle any options.
| term | the widget term, e.g. PushButton( `opt( `unknown ), ... ) | |
| optList | the list of options not yet processed |
| void YUI::registerDialog | ( | YDialog * | ) | [protected] |
Enters a dialog into the dialog map.
| void YUI::removeDialog | ( | ) | [protected] |
Removes the topmost dialog from the dialog stack and deletes it.
| bool YUI::isSymbolOrId | ( | const YCPValue & | val | ) | const [protected] |
Checks if the given value is either a symbol or a term `id().
| void YUI::deleteMacroRecorder | ( | ) | [protected] |
Delete the internal macro recorder and set the pointer to 0.
| void YUI::deleteMacroPlayer | ( | ) | [protected] |
Delete the internal macro player and set the pointer to 0.
| void YUI::playNextMacroBlock | ( | ) | [protected] |
Play the next block of an active macro player.
| void* start_ui_thread | ( | void * | ui_int | ) | [friend] |
dialogstack_type YUI::dialogstack [protected] |
Container for all dialogs. Each dialog has a unique id, which is a YCPValue.
long long YUI::id_counter [protected] |
Counter for creating unique widget ids
bool YUI::with_threads [protected] |
true if a seperate UI thread is created
pthread_t YUI::ui_thread [protected] |
Handle to the ui thread.
YUIBuiltinCallData YUI::_builtinCallData [protected] |
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.
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.
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.
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", ...).
YMacroRecorder* YUI::macroRecorder [protected] |
The current macro recorder.
YMacroPlayer* YUI::macroPlayer [protected] |
The current macro player.
deque<YCPValue> YUI::fakeUserInputQueue [protected] |
Queue for synthetic (faked) user input events.
YCPMap YUI::default_fkeys [protected] |
The current mapping of widget labels to default function keys.
bool YUI::_events_blocked [protected] |
Flag that keeps track of blocked events. Never query this directly, use eventsBlocked() instead.
bool YUI::_reverseLayout [static, protected] |
Returns 'true' if widget geometry should be reversed for languages that have right-to-left writing direction (Arabic, Hebrew).
Y2Component* YUI::_callback [protected] |
The callback component previously set with setCallback().
1.5.0