#include <YUI.h>
Public Types | |
enum | ImageType { IT_SUSEHEADER, IT_YAST2 } |
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) |
int | parseTreeItemList (const YCPList &itemList, YTree *tree, YTreeItem *parentItem=0) |
int | parseMultiSelectionBoxItemList (const YCPList &item_list, YMultiSelectionBox *multi_sel_box) |
bool | parseRgb (const YCPValue &val, YColor *color, bool complain) |
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) |
YCPBoolean | evaluateReplaceWidget (const YCPValue &value_id, const YCPTerm &term) |
int | defaultFunctionKey (YCPString label) |
string | productName () const |
YCPValue | callBuiltin (void *function, int argc, YCPValue argv[]) |
void | setCallback (Y2Component *callback) |
Y2Component * | getCallback () const |
YCPValue | evaluateAskForExistingDirectory (const YCPString &startDir, const YCPString &headline) |
YCPValue | evaluateAskForExistingFile (const YCPString &startDir, const YCPString &filter, const YCPString &headline) |
YCPValue | evaluateAskForSaveFileName (const YCPString &startDir, const YCPString &filter, const YCPString &headline) |
void | evaluateBusyCursor () |
YCPValue | evaluateChangeWidget (const YCPValue &value_id, const YCPValue &property, const YCPValue &new_value) |
void | evaluateCheckShortcuts () |
YCPValue | evaluateCloseDialog () |
void | evaluateDumpWidgetTree () |
void | evaluateFakeUserInput (const YCPValue &next_input) |
YCPMap | evaluateGetDisplayInfo () |
YCPString | evaluateGetLanguage (const YCPBoolean &strip_encoding) |
YCPValue | evaluateGetModulename (const YCPTerm &term) |
YCPString | evaluateGetProductName () |
YCPString | evaluateGlyph (const YCPSymbol &symbol) |
YCPValue | evaluateHasSpecialWidget (const YCPSymbol &widget) |
void | evaluateMakeScreenShot (const YCPString &filename) |
void | evaluateNormalCursor () |
YCPBoolean | evaluateOpenDialog (const YCPTerm &term, const YCPTerm &term=YCPNull()) |
void | evaluatePlayMacro (const YCPString &filename) |
void | evaluatePostponeShortcutCheck () |
YCPValue | evaluateQueryWidget (const YCPValue &value_id, const YCPValue &property) |
void | evaluateRecalcLayout () |
YCPValue | evaluateRecode (const YCPString &from, const YCPString &to, const YCPString &text) |
void | evaluateRecordMacro (const YCPString &filename) |
void | evaluateRedrawScreen () |
YCPValue | evaluateRunPkgSelection (const YCPValue &value_id) |
void | evaluateSetConsoleFont (const YCPString &magic, const YCPString &font, const YCPString &screen_map, const YCPString &unicode_map, const YCPString &encoding) |
void | evaluateSetKeyboard () |
YCPBoolean | evaluateSetFocus (const YCPValue &value_id) |
void | evaluateSetFunctionKeys (const YCPMap &new_keys) |
void | evaluateSetLanguage (const YCPString &lang, const YCPString &encoding=YCPNull()) |
void | evaluateSetModulename (const YCPString &name) |
void | evaluateSetProductName (const YCPString &name) |
void | evaluateStopRecordMacro () |
YCPBoolean | evaluateWidgetExists (const YCPValue &value_id) |
YCPValue | evaluateUserInput () |
YCPValue | evaluateTimeoutUserInput (const YCPInteger &timeout) |
YCPValue | evaluateWaitForEvent (const YCPInteger &timeout=YCPNull()) |
YCPValue | evaluateWizardCommand (const YCPTerm &command) |
YCPValue | evaluatePollInput () |
void | uiThreadMainLoop () |
Static Public Member Functions | |
int | Recode (const string &str, const string &from, const string &to, string &outstr) |
bool | reverseLayout () |
void | setReverseLayout (bool rev) |
YCPValue | callFunction (void *function, int argc, YCPValue argv[]) |
Protected Types | |
typedef vector< YDialog * > | dialogstack_type |
Protected Member Functions | |
YUI (bool with_threads) | |
const char * | moduleName () |
virtual void | idleLoop (int fd_ycp) |
virtual 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 * | createImage (YWidget *parent, YWidgetOpt &opt, ImageType img, 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 * | createDumbTab (YWidget *parent, YWidgetOpt &opt) |
virtual bool | hasDumbTab () |
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 * | 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 void | busyCursor () |
virtual void | normalCursor () |
virtual void | redrawScreen () |
virtual void | makeScreenShot (string filename) |
virtual YCPValue | runPkgSelection (YWidget *packageSelector) |
virtual YCPValue | askForExistingDirectory (const YCPString &startDir, const YCPString &headline)=0 |
virtual YCPValue | askForExistingFile (const YCPString &startWith, const YCPString &filter, const YCPString &headline)=0 |
virtual YCPValue | askForSaveFileName (const YCPString &startWith, const YCPString &filter, const YCPString &headline)=0 |
YCPValue | callback (const YCPValue &value) |
YCPValue | evaluateLocale (const YCPLocale &) |
void | recordMacro (string filename) |
void | stopRecordMacro () |
void | playMacro (string filename) |
bool | recordingMacro () |
bool | playingMacro () |
void | terminateUIThread () |
void | createUIThread () |
void | signalUIThread () |
bool | waitForUIThread () |
void | signalYCPThread () |
bool | waitForYCPThread () |
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) |
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 * | 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 * | 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 * | 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) |
YCPValue | getWidgetId (const YCPTerm &term, int *argnr) |
YCPList | getWidgetOptions (const YCPTerm &term, int *argnr) |
void | logUnknownOption (const YCPTerm &term, const YCPValue &option) |
void | rejectAllOptions (const YCPTerm &term, const YCPList &optList) |
void | registerDialog (YDialog *) |
void | removeDialog () |
bool | checkId (const YCPValue &val, bool complain=true) const |
bool | isSymbolOrId (const YCPValue &val) const |
YCPValue | getId (const YCPValue &v) const |
void | deleteMacroRecorder () |
void | deleteMacroPlayer () |
void | playNextMacroBlock () |
Protected Attributes | |
dialogstack_type | dialogstack |
long long | id_counter |
bool | with_threads |
pthread_t | ui_thread |
YUIBuiltinCallData | _builtinCallData |
int | pipe_to_ui [2] |
int | pipe_from_ui [2] |
bool | terminate_ui_thread |
string | _moduleName |
string | _productName |
YMacroRecorder * | macroRecorder |
YMacroPlayer * | macroPlayer |
deque< YCPValue > | fakeUserInputQueue |
YCPMap | default_fkeys |
bool | _events_blocked |
Y2Component * | _callback |
Static Protected Attributes | |
bool | _reverseLayout = false |
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.
|
Define type for the dialog map |
|
Constants for different predifined images |
|
Constructor. |
|
Destructor. |
|
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. |
|
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. |
|
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. |
|
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. |
|
UI-specific busyCursor function. This default implementation does nothing. |
|
|
|
Call a UI builtin function in the correct thread (the UI thread). This is called from libycp/YExpression via the UI builtin declarations that call UICallHandler. |
|
Call 'function' with 'argc' YCPValue parameters and return the result of 'function'. |
|
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.
|
|
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.
|
|
Helper function of createWidgetTree. Creates an alignment (`Left, `Right, `Top, `Bottom based on the alignment parameters.
|
|
Creates an alignment widget |
|
Helper function of createWidgetTree. Creates a BarGraph. |
|
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! |
|
Helper function of createWidgetTree. Creates a CheckBox. |
|
Creates a check box
|
|
Helper function of createWidgetTree. Creates a ColoredLabel. |
|
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! |
|
Helper function of createWidgetTree. Creates a ComboBox. |
|
Creates a combo box |
|
Creates a dialog.
|
|
Helper function of createWidgetTree. Creates a DownloadProgress. |
|
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! |
|
Helper function of createWidgetTree. Creates a DumbTab. |
|
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! |
|
Helper function of createWidgetTree. Creates a DummySpecialWidget. |
|
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! |
|
Helper function of createWidgetTree. Creates one of Empty, HStretch, VStretch, Stretch |
|
Creates an empty widget |
|
Helper function of createWidgetTree. Creates a frame widget. |
|
Creates a frame widget |
|
Helper function of createWidgetTree. Creates an Image. |
|
Creates an image widget from a predefined set of images |
|
Creates an image widget from a file name |
|
Creates an image widget from a YCP byteblock |
|
Helper function of createWidgetTree. Creates an IntField. |
|
Creates an IntField widget. |
|
Helper function of createWidgetTree. Creates a label.
|
|
Creates a label.
|
|
Helper function of createWidgetTree. Creates one of HBox, VBox
|
|
Helper function of createWidgetTree. Creates a LogView. |
|
Creates a log view widget
|
|
Helper function for createWidgetTreeTree. Creates a menu button. |
|
Creates a menu button.
|
|
Helper function of createWidgetTree. Creates a MultiLineEdit. |
|
Creates a MultiLineEdit widget. |
|
Helper function for createWidgetTreeTree. Creates a MultiSelectionBox. |
|
Creates a multi selection box |
|
Helper function of createWidgetTree. Creates a PackageSelector. |
|
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". |
|
Helper function of createWidgetTree. Creates a PartitionSplitter. |
|
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!
|
|
Helper function of createWidgetTree. Creates a PkgSpecial subwidget. |
|
Creates a PkgSpecial widget, i.e. a specific subwidget. |
|
Helper function of createWidgetTree. Creates a ProgressBar. |
|
Creates a progress bar |
|
Helper function of createWidgetTree. Creates a PushButton or an IconButton. |
|
Creates a push button.
|
|
Helper function of createWidgetTree. Creates a RadioButton. |
|
Creates a radio button and inserts it into a radio button group
|
|
Helper function of createWidgetTree. Creates a RadioButtonGroup. |
|
Creates a radio button group. |
|
Helper function of createWidgetTree. Creates a replace point
|
|
Creates a replace point. |
|
Helper function of createWidgetTree. Creates a RichText. |
|
Creates a rich text widget
|
|
Helper function of createWidgetTree. Creates a SelectionBox. |
|
Creates a selection box |
|
Helper function of createWidgetTree. Creates a Slider. |
|
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! |
|
Helper function of createWidgetTree. Creates one of HSpacing, VSpacing.
|
|
Creates a spacing widget |
|
Creates a split |
|
Helper function of createWidgetTree. Creates one of HSquash, VSquash, HVSquash.
|
|
Creates a squash widget |
|
Helper function of createWidgetTree. Creates a Table. |
|
Creates a table widget |
|
Helper function of createWidgetTree. Creates one of TextEntry, Password
|
|
Creates a text entry or password entry field. |
|
Helper function of createWidgetTree. Creates a Tree. |
|
Creates a tree |
|
Creates and launches the ui thread. |
|
Helper function of createWidgetTree. Creates a weight widget.
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. |
|
Overloaded version for convenience. Supplies empty widget options. |
|
Creates a new widget tree.
|
|
Helper function of createWidgetTree. Creates a Wizard widget. |
|
Creates a Wizard frame. |
|
Looks up the topmost dialog |
|
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. |
|
Delete the internal macro player and set the pointer to 0. |
|
Delete the internal macro recorder and set the pointer to 0. |
|
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). |
|
Implementations for most UI builtins. Each method corresponds directly to one UI builtin. |
|
AskForExistingFile( string startWith, string filter, string headline ) -> string Open a file selection box and prompt the user for an existing file. startWith is the initial directory or file. filter is one or more blank-separated file patterns, e.g. "*.png *.jpg" headline is an explanatory text for the file selection box. Graphical UIs may omit that if no window manager is running. Returns the selected file name or nil if the user canceled the operation. |
|
AskForSaveFileName( string startWith, string filter, string headline ) -> string Open a file selection box and prompt the user for a file to save data to. Automatically asks for confirmation if the user selects an existing file. A startWith is the initial directory or file. filter is one or more blank-separated file patterns, e.g. "*.png *.jpg" headline is an explanatory text for the file selection box. Graphical UIs may omit that if no window manager is running. Returns the selected file name or nil if the user canceled the operation. |
|
BusyCursor() -> void Sets the mouse cursor to the busy cursor, if the UI supports such a feature. This should normally not be necessary. The UI handles mouse cursors itself: When input is possible (i.e. inside UserInput() ), there is automatically a normal cursor, otherwise, there is the busy cursor. Override this at your own risk. |
|
|
ChangeWidget( `id( any widgetId ), symbol property, any newValue ) -> boolean ChangeWidget( symbol widgetId, symbol property, any newValue ) -> boolean
Changes a property of a widget of the topmost dialog.
For example in order to change the label of a TextEntry with id `name to "anything", you write Returns true on success. |
|
CheckShortcuts() -> void
Perform an explicit shortcut check after postponing shortcut checks. Use this after calling The normal sequence looks like this:
|
|
CloseDialog() -> boolean
Closes the most recently opened dialog. It is an error to call Returns true on success. |
|
DumpWidgetTree() -> void Debugging function: Dump the widget tree of the current dialog to the log file. |
|
FakeUserInput( any nextUserInput ) -> void FakeUserInput() -> void Prepare a fake value for the next call to UserInput() - i.e. the next UserInput() will return exactly this value. This is only useful in connection with macros. If called without a parameter, the next call to UserInput() will return "nil". |
|
GetDisplayInfo() -> map Get information about the current display and the UI's capabilities. Returns a map with the following contents:
Important: Don't misuse this function to simply not support the NCurses UI properly! Always think twice before checking for text mode. If you think there is no proper layout etc. solution for NCurses, it might be time to reconsider the complexity or even the concept of your dialog. |
|
GetLanguage( boolean strip_encoding ) -> string
Retrieves the current language setting from of the user interface. Since YaST2 is a client server architecture, we distinguish between the language setting of the user interface and that of the configuration modules. If the module or the translator wants to know which language the user currently uses, it can call 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). |
|
|
|
|
|
Glyph( symbol glyph ) -> string Return a special character ( a 'glyph' ) according to the symbol specified. Not all UIs may be capable of displaying every glyph; if a specific UI doesn't support it, a textual representation ( probably in plain ASCII ) will be returned. This is also why there is only a limited number of predefined glyphs: An ASCII equivalent is required which is sometimes hard to find for some characters defined in Unicode / UTF-8. Please note the value returned may consist of more than one character; for example, Glyph( `ArrowRight ) may return something like "->". Predefined glyphs include:
If an unknown glyph symbol is specified, 'nil' is returned. See also the Glyphs.ycp UI example:
![]() Glyphs in the NCurses UI |
|
HasSpecialWidget( `symbol widget ) -> boolean Checks for support of a special widget type. Use this prior to creating a widget of this kind. Do not use this to check for ordinary widgets like PushButton etc. - just the widgets where the widget documentation explicitly states it is an optional widget not supported by all UIs. Returns true if the UI supports the special widget and false if not. |
|
Evaluates a locale. Evaluate _( "string" ) to "string". |
|
MakeScreenShot( string filename ) -> void Make a screen shot if the specific UI supports that. The Qt UI opens a file selection box if filename is empty. |
|
NormalCursor() -> void Sets the mouse cursor to the normal cursor ( after BusyCursor ), if the UI supports such a feature. This should normally not be necessary. The UI handles mouse cursors itself: When input is possible (i.e. inside UserInput() ), there is automatically a normal cursor, otherwise, there is the busy cursor. Override this at your own risk. |
|
|
|
PlayMacro( string macroFileName ) -> void Execute everything in macro file "macroFileName". Any errors are sent to the log file only. The macro can be terminated only from within the macro file. |
|
PollInput() -> any
Doesn't wait but just looks if the user has clicked some button, has closed the window or has activated some widget that has the Read more details and usage example in the YaST2 UI Event Handling Documentation. |
|
PostponeShortcutCheck() -> void Postpone keyboard shortcut checking during multiple changes to a dialog.
Normally, keyboard shortcuts are checked automatically when a dialog is created or changed. This can lead to confusion, however, when multiple changes to a dialog ( repeated ReplaceWidget() calls ) cause unwanted intermediate states that may result in shortcut conflicts while the dialog is not final yet. Use this function to postpone this checking until all changes to the dialog are done and then explicitly check with
The next call to Use only when really necessary. The automatic should do well in most cases. The normal sequence looks like this:
|
|
QueryWidget( `id( any id ), symbol | term property ) -> any QueryWidget( symbol widgetId ), symbol | term property ) -> any
Queries a property of a widget of the topmost dialog. For example in order to query the current text of a TextEntry with id `name, you write |
|
RecalcLayout() -> void Recompute the layout of the current dialog. This is a very expensive operation. Use this after changing widget properties that might affect their size - like the a Label widget's value. Call this once ( ! ) after changing all such widget properties. |
|
Recode ( string from, string to, string text ) -> any Recode encoding of string from or to "UTF-8" encoding. One of from/to must be "UTF-8", the other should be an iso encoding specifier (i.e. "ISO-8859-1" for western languages, "ISO-8859-2" for eastern languages, etc. ) |
|
RecordMacro( string macroFileName ) -> void Begin recording a macro. Write the macro contents to file "macroFilename". |
|
RedrawScreen() -> void Redraws the screen after it very likely has become garbled by some other output. This should normally not be necessary: The ( specific ) UI redraws the screen automatically whenever required. Under rare circumstances, however, the screen might have changes due to circumstances beyond the UI's control: For text based UIs, for example, system commands that cause output to every tty might make this necessary. Call this in the YCP code after such a command. |
|
Implements the UI command ReplaceWidget. |
|
RunPkgSelection( `id( any pkgSelId ) -> any Not to be used outside the package selection Initialize and run the PackageSelector widget identified by 'pkgSelId'. Black magic to everybody outside. ;- ) Returns `cancel if the user wishes to cancel his selections. |
|
|
|
SetFocus( `id( any widgetId ) ) -> boolean SetFocus( symbol widgetId ) ) -> boolean Sets the keyboard focus to the specified widget. Notice that not all widgets can accept the keyboard focus; this is limited to interactive widgets like PushButtton, TextEntry, SelectionBox etc. - manager widgets like VBox, HBox etc. will not accept the keyboard focus. They will not propagate the keyboard focus to some child widget that accepts the focus. Instead, an error message will be emitted into the log file. Returns true on success (i.e. the widget accepted the focus). |
|
|
|
|
|
|
|
|
|
|
|
StopRecordingMacro() -> void Stop macro recording. This is only necessary if you don't wish to record everything until the program terminates. |
|
TimeoutUserInput( integer timeout_millisec ) -> any
Waits for the user to click some button, close the window or activate some widget that has the Read more details and usage example in the YaST2 UI Event Handling Documentation. |
|
UserInput() -> any
Waits for the user to click some button, close the window or activate some widget that has the Read more details and usage example in the YaST2 UI Event Handling Documentation. |
|
WaitForEvent() -> map WaitForEvent( integer timeout_millisec ) -> map Extended event handling - very much like UserInput(), but returns much more detailed information about the event that occured in a map. Read more details and usage example in the YaST2 UI Event Handling Documentation. |
|
WidgetExists( `id( any widgetId ) ) -> boolean WidgetExists( symbol widgetId ) ) -> boolean Check whether or not a widget with the given ID currently exists in the current dialog. Use this to avoid errors in the log file before changing the properties of widgets that might or might not be there. |
|
WizardCommand( term wizardCommand ) -> boolean Issue a command to a wizard widget with ID 'wizardId'. This builtin is not for general use. Use the Wizard.ycp module instead. For available wizard commands see file YQWizard.cc . If the current UI does not provide a wizard widget, 'false' is returned. It is safe to call this even for UIs that don't provide a wizard widget. In this case, all calls to this builtin simply return 'false'. Returns true on success. |
|
Returns 'true' if events are currently blocked. Reimplent this if you reimplement blockEvents(). |
|
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. |
|
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.
|
|
Returns the callback previously set with setCallback(). |
|
|
|
|
|
|
|
|
|
|
|
UI-specific getDisplayInfo() functions. See UI builtin GetDisplayInfo() doc for details. |
|
Assumes that the value v is of the form `id( any i ) and returns the contained i. |
|
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 ) ]
|
|
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. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
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. |
|
Checks if the given value is either a symbol or a term `id().
|
|
Logs a warning for an unknown widget option
|
|
UI-specific makeScreenShot function. This default implementation does nothing. |
|
|
|
UI-specific normalCursor function. This default implementation does nothing. |
|
Parse a menu list (for menu buttons) |
|
Parse an item list for a MultiSelectionBox |
|
Parse an `rgb() value |
|
Parse a tree item list |
|
Return whether macro playing is in progress or not |
|
Play macro in file "filename". Any previous macro execution will be terminated prior to this. |
|
Play the next block of an active macro player. |
|
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. |
|
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. |
|
Might be handy if you have to recode strings from/to utf-8 |
|
Return whether macro recording is in progress or not |
|
Start macro recording to file "filename". Any previous active macro recorder will be terminated( regularly ) prior to this. |
|
UI-specific redrawScreen method. This default implementation does nothing. |
|
Enters a dialog into the dialog map. |
|
Logs warning messages for all widget options other than the standard ones - for widgets that don't handle any options.
|
|
Removes the topmost dialog from the dialog stack and deletes it. |
|
Returns 'true' if widget geometry should be reversed for languages that have right-to-left writing direction (Arabic, Hebrew). |
|
UI-specific runPkgSelection method. This default implementation does nothing. Use this to post-initialize widget stuff that cannot be done in the createPackageSelector() method. |
|
Set a callback component. |
|
UI-specific setConsoleFont() function. Returns YCPVoid() if OK and YCPNull() on error. This default implementation does nothing. |
|
|
|
UI-specific setLanguage() function. Returns YCPVoid() if OK and YCPNull() on error. This default implementation does nothing. |
|
Set reverse layout for Arabic / Hebrew support |
|
Shows and activates a previously created dialog. The default implementation does nothing.
|
|
Signals the ui thread by sending one byte through the pipe to it. |
|
Signals the ycp thread by sending one byte through the pipe to it. |
|
Stop macro recording if this is in progress. Nothing happens when no macro recording is in progress. |
|
Tells the ui thread that it should terminate and waits until it does so. |
|
|
|
Must be called after the constructor of the Qt/NCurses ui is ready. Starts the ui thread. |
|
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. |
|
Unblock events previously blocked. This is just an alias for blockEvents( false) for better readability. Note: This method is intentionally not 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. |
|
Waits for the ui thread to send one byte through the pipe to the ycp thread and reads this byte from the pipe. |
|
Waits for the ycp thread to send one byte through the pipe to the ycp thread and reads this byte from the pipe. |
|
Overloaded version of widgetWithId. Does not search for the widget id in the topmost dialog but in given widget tree.
|
|
Looks up a widget with a certain id. Returns 0 if no such exists. Only the topmost dialog ist searched for the id.
|
|
|
|
Inter-thread communication between the YCP thread and the UI thread: The YCP thread supplies data here and signals the UI thread, the UI thread picks up the data, executes the function, puts the result here and signals the YCP thread that waits until the result is available. |
|
The callback component previously set with setCallback(). |
|
Flag that keeps track of blocked events. Never query this directly, use eventsBlocked() instead. |
|
The current module name as set by the SetModuleName UI command. |
|
The current product name ("SuSE Linux", "United Linux", ...). |
|
Returns 'true' if widget geometry should be reversed for languages that have right-to-left writing direction (Arabic, Hebrew). |
|
The current mapping of widget labels to default function keys. |
|
Container for all dialogs. Each dialog has a unique id, which is a YCPValue. |
|
Queue for synthetic (faked) user input events. |
|
Counter for creating unique widget ids |
|
The current macro player. |
|
The current macro recorder. |
|
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. |
|
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. |
|
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. |
|
Handle to the ui thread. |
|
true if a seperate UI thread is created |