libyui-ncurses  2.44.1
 All Classes Functions Variables
YNCursesUI.h
1 /*
2  Copyright (C) 2000-2012 Novell, Inc
3  This library is free software; you can redistribute it and/or modify
4  it under the terms of the GNU Lesser General Public License as
5  published by the Free Software Foundation; either version 2.1 of the
6  License, or (at your option) version 3.0 of the License. This library
7  is distributed in the hope that it will be useful, but WITHOUT ANY
8  WARRANTY; without even the implied warranty of MERCHANTABILITY or
9  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
10  License for more details. You should have received a copy of the GNU
11  Lesser General Public License along with this library; if not, write
12  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
13  Floor, Boston, MA 02110-1301 USA
14 */
15 
16 
17 /*-/
18 
19  File: YNCursesUI.h
20 
21  Authors: Michael Andres <ma@suse.de>
22  Stefan Hundhammer <sh@suse.de>
23 
24 /-*/
25 
26 #ifndef YNCursesUI_h
27 #define YNCursesUI_h
28 
29 #include <iosfwd>
30 
31 #include <yui/YUI.h>
32 #include "NCApplication.h"
33 #include "NCurses.h"
34 
36 
37 
38 class YNCursesUI : public NCurses, public YUI
39 {
40 public:
41  /**
42  * Constructor
43  **/
44  YNCursesUI( bool withThreads );
45 
46  /**
47  * Destructor
48  **/
49  ~YNCursesUI();
50 
51 
52 protected:
53  /**
54  * Create the widget factory that provides all the createXY() methods for
55  * standard (mandatory, i.e. non-optional) widgets.
56  *
57  * Reimplemented from YUI.
58  **/
59  virtual YWidgetFactory * createWidgetFactory();
60 
61  /**
62  * Create the widget factory that provides all the createXY() methods for
63  * optional ("special") widgets and the corresponding hasXYWidget()
64  * methods.
65  *
66  * Reimplemented from YUI.
67  **/
68  virtual YOptionalWidgetFactory * createOptionalWidgetFactory();
69 
70  /*
71  * Create the YApplication object that provides global methods.
72  *
73  * Reimplemented from YUI.
74  **/
75  virtual YApplication * createApplication();
76 
77 
78  virtual bool want_colors();
79  virtual void init_title();
80 
81  /**
82  * Global reference to the UI
83  **/
84  static YNCursesUI * _ui;
85 
86 public:
87 
88  /**
89  * Access the global Y2NCursesUI.
90  */
91  static YNCursesUI * ui() { return _ui; }
92 
93  /**
94  * Idle around until fd_ycp is readable
95  */
96  virtual void idleLoop( int fd_ycp );
97 
98  /**
99  * Set the (text) console font according to the current encoding etc.
100  * See the setfont(8) command and the console HowTo for details.
101  *
102  * This should really be in NCApplication, but it uses so many non-exported
103  * member variables that it's not easy to move it there.
104  **/
105  virtual void setConsoleFont( const std::string & console_magic,
106  const std::string & font,
107  const std::string & screen_map,
108  const std::string & unicode_map,
109  const std::string & lang );
110 
111  /**
112  * Fills the PackageSelector widget and runs package selection.
113  */
114  virtual YEvent * runPkgSelection( YWidget * packageSelector );
115 
116  /**
117  * Returns the package selector plugin singleton of this UI or creates it
118  * (including loading the plugin lib) if it does not exist yet.
119  **/
121 };
122 
123 
124 /**
125  * Create a new UI if there is none yet or return the existing one if there is.
126  *
127  * This is the UI plugin's interface to the outside world, so don't change the
128  * name or signature!
129  **/
130 YUI * createUI( bool withThreads );
131 
132 
133 #endif // YNCursesUI_h
134 
static YNCursesUI * _ui
Definition: YNCursesUI.h:84
virtual YWidgetFactory * createWidgetFactory()
Definition: YNCursesUI.cc:118
virtual void setConsoleFont(const std::string &console_magic, const std::string &font, const std::string &screen_map, const std::string &unicode_map, const std::string &lang)
Definition: YNCursesUI.cc:337
virtual YOptionalWidgetFactory * createOptionalWidgetFactory()
Definition: YNCursesUI.cc:128
static YNCursesUI * ui()
Definition: YNCursesUI.h:91
virtual void idleLoop(int fd_ycp)
Definition: YNCursesUI.cc:147
NCPackageSelectorPluginStub * packageSelectorPlugin()
Definition: YNCursesUI.cc:201
virtual YEvent * runPkgSelection(YWidget *packageSelector)
Definition: YNCursesUI.cc:219
YNCursesUI(bool withThreads)
Definition: YNCursesUI.cc:60