yast2-ncurses: YNCursesUI.h Source File

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

# YNCursesUI.h

Go to the documentation of this file.

    00001 /*---------------------------------------------------------------------\
    00002 |                                                                      |
    00003 |                      __   __    ____ _____ ____                      |
    00004 |                      \ \ / /_ _/ ___|_   _|___ \                     |
    00005 |                       \ V / _` \___ \ | |   __) |                    |
    00006 |                        | | (_| |___) || |  / __/                     |
    00007 |                        |_|\__,_|____/ |_| |_____|                    |
    00008 |                                                                      |
    00009 |                               core system                            |
    00010 |                                                        (C) SuSE GmbH |
    00011 \----------------------------------------------------------------------/
    00012
    00013    File:       YNCursesUI.h
    00014
    00015    Author:     Michael Andres <ma@suse.de>
    00016    Maintainer: Michael Andres <ma@suse.de>
    00017
    00018 /-*/
    00019 // -*- c++ -*-
    00020
    00021 #ifndef YNCursesUI_h
    00022 #define YNCursesUI_h
    00023
    00024 #include <iosfwd>
    00025
    00026 #include <Y2.h>
    00027 #include "YUI.h"
    00028 #include "NCurses.h"
    00029
    00030 class YUI;
    00031 class NCDialog;
    00032
    00038 class YNCursesUI : public NCurses, public YUI
    00039 {
    00040 public:
    00044    YNCursesUI( int argc, char ** argv, bool with_threads, const char * macro_file );
    00045
    00049    ~YNCursesUI();
    00050
    00051
    00052   protected:
    00053
    00054     virtual bool want_colors();
    00055     virtual void init_title();
    00056
    00060    static YNCursesUI * _ui;
    00061
    00062   public:
    00063
    00064 //    Y2NCursesUI( bool with_threads, const char * macro_file, Y2Component *callback );
    00065 //    virtual ~Y2NCursesUI();
    00066
    00070     static YNCursesUI * ui() { return _ui; }
    00071
    00075     virtual void idleLoop( int fd_ycp );
    00076
    00083     virtual YEvent * userInput( unsigned long timeout_millisec );
    00084
    00090     virtual YEvent * pollInput();
    00091
    00095     virtual YDialog * createDialog( YWidgetOpt & opt );
    00096
    00100     virtual void showDialog( YDialog * dialog );
    00101
    00105     virtual void closeDialog( YDialog * dialog );
    00106
    00107     //
    00108     // Widget creation functions - container widgets
    00109     //
    00110
    00114     virtual YContainerWidget * createSplit( YWidget * parent, YWidgetOpt & opt,
    00115                                             YUIDimension dimension );
    00116
    00120     virtual YContainerWidget * createReplacePoint( YWidget * parent, YWidgetOpt & opt );
    00121
    00125     virtual YContainerWidget * createAlignment( YWidget * parent, YWidgetOpt & opt,
    00126                                                 YAlignmentType halign,
    00127                                                 YAlignmentType valign);
    00128
    00132     virtual YContainerWidget * createSquash( YWidget * parent, YWidgetOpt & opt,
    00133                                              bool hsquash,
    00134                                              bool vsquash );
    00135
    00139     virtual YContainerWidget * createRadioButtonGroup( YWidget * parent, YWidgetOpt & opt );
    00140
    00144     virtual YContainerWidget * createFrame( YWidget * parent, YWidgetOpt & opt,
    00145                                             const YCPString & label );
    00146
    00147     //
    00148     // Widget creation functions - leaf widgets
    00149     //
    00150
    00154     virtual YWidget * createEmpty( YWidget * parent, YWidgetOpt & opt );
    00155
    00159     virtual YWidget * createSpacing( YWidget * parent, YWidgetOpt & opt,
    00160                                      float size,
    00161                                      bool horizontal,
    00162                                      bool vertical );
    00163
    00170     virtual YWidget * createLabel( YWidget * parent, YWidgetOpt & opt,
    00171                                    const YCPString & text );
    00172
    00177     virtual YWidget * createRichText( YWidget * parent, YWidgetOpt & opt,
    00178                                       const YCPString & text );
    00179
    00186     virtual YWidget * createLogView( YWidget * parent, YWidgetOpt & opt,
    00187                                      const YCPString & label,
    00188                                      int visibleLines,
    00189                                      int maxLines );
    00190
    00196     virtual YWidget * createMultiLineEdit( YWidget * parent, YWidgetOpt & opt,
    00197                                            const YCPString & label,
    00198                                            const YCPString & text);
    00199
    00205     virtual YWidget * createPushButton( YWidget * parent, YWidgetOpt & opt,
    00206                                         const YCPString & label );
    00207
    00212     virtual YWidget * createMenuButton( YWidget * parent, YWidgetOpt & opt,
    00213                                         const YCPString & label );
    00214
    00220     virtual YWidget * createRadioButton( YWidget * parent, YWidgetOpt & opt,
    00221                                          YRadioButtonGroup * rbg,
    00222                                          const YCPString & label,
    00223                                          bool checked );
    00224
    00230     virtual YWidget * createCheckBox( YWidget * parent, YWidgetOpt & opt,
    00231                                       const YCPString & label,
    00232                                       bool checked );
    00233
    00237     virtual YWidget * createTextEntry( YWidget * parent, YWidgetOpt & opt,
    00238                                        const YCPString & label,
    00239                                        const YCPString & text );
    00240
    00244     virtual YWidget * createSelectionBox( YWidget * parent, YWidgetOpt & opt,
    00245                                           const YCPString & label );
    00246
    00250     virtual YWidget * createMultiSelectionBox( YWidget *parent, YWidgetOpt & opt,
    00251                                                const YCPString & label );
    00252
    00256     virtual YWidget * createComboBox( YWidget * parent, YWidgetOpt & opt,
    00257                                       const YCPString & label );
    00258
    00262     virtual YWidget * createTree( YWidget * parent, YWidgetOpt & opt,
    00263                                   const YCPString & label );
    00264
    00268     virtual YWidget * createTable( YWidget * parent, YWidgetOpt & opt,
    00269                                    vector<string> header );
    00270
    00274     virtual YWidget * createProgressBar( YWidget * parent, YWidgetOpt & opt,
    00275                                          const YCPString & label,
    00276                                          const YCPInteger & maxprogress,
    00277                                          const YCPInteger & progress);
    00278
    00282     virtual YWidget * createImage( YWidget * parent, YWidgetOpt & opt,
    00283                                    YCPByteblock imagedata,
    00284                                    YCPString defaulttext);
    00285
    00289     virtual YWidget * createImage( YWidget * parent, YWidgetOpt & opt,
    00290                                    YCPString filename,
    00291                                    YCPString defaulttext);
    00292
    00296     virtual YWidget * createIntField( YWidget * parent, YWidgetOpt & opt,
    00297                                       const YCPString & label,
    00298                                       int minValue, int maxValue,
    00299                                       int initialValue );
    00300
    00304     virtual YWidget * createPackageSelector( YWidget *parent,
    00305                                              YWidgetOpt &opt,
    00306                                              const YCPString & floppyDevice );
    00307
    00311     virtual YCPValue runPkgSelection( YWidget * packageSelector );
    00312
    00316     virtual YWidget * createPkgSpecial( YWidget *parent,
    00317                                         YWidgetOpt &opt,
    00318                                         const YCPString &subwidget );
    00319
    00325     virtual YCPValue setLanguage( const YCPTerm & term );
    00326
    00331     virtual YCPValue setConsoleFont ( const YCPString & console_magic,
    00332                                       const YCPString & font,
    00333                                       const YCPString & screen_map,
    00334                                       const YCPString & unicode_map,
    00335                                       const YCPString & encoding );
    00336
    00337     virtual YCPValue setKeyboard ( );
    00338
    00352     virtual YCPValue askForExistingDirectory ( const YCPString & startDir,
    00353                                                const YCPString & headline );
    00354
    00369     virtual YCPValue askForExistingFile ( const YCPString & startWith,
    00370                                           const YCPString & filter,
    00371                                           const YCPString & headline );
    00372
    00373
    00389     virtual YCPValue askForSaveFileName ( const YCPString & startWith,
    00390                                           const YCPString & filter,
    00391                                           const YCPString & headline );
    00392
    00393
    00398     virtual void redrawScreen() { Refresh(); }
    00399
    00404     virtual int  getDisplayWidth()           { return cols(); }
    00405     virtual int  getDisplayHeight()          { return lines(); }
    00406     virtual int  getDisplayDepth()           { return -1; }
    00407     virtual long getDisplayColors()          { return NCattribute::colors(); }
    00408     virtual int  getDefaultWidth()           { return cols(); }
    00409     virtual int  getDefaultHeight()          { return lines(); }
    00410     virtual bool textMode()                  { return true; }
    00411     virtual bool hasImageSupport()           { return false; }
    00412     virtual bool hasIconSupport()            { return false; }
    00413
    00414     virtual bool hasFullUtf8Support();
    00415
    00416   private:
    00417
    00418     bool setLanguage( string lang );
    00419 };
    00420
    00421 #endif // YNCursesUI_h
    00422