libyui-ncurses
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:
46  YNCursesUI( bool withThreads, bool topmostConstructor = true );
47 
51  ~YNCursesUI();
52 
53 
54 protected:
61  virtual YWidgetFactory * createWidgetFactory();
62 
70  virtual YOptionalWidgetFactory * createOptionalWidgetFactory();
71 
72  /*
73  * Create the YApplication object that provides global methods.
74  *
75  * Reimplemented from YUI.
76  **/
77  virtual YApplication * createApplication();
78 
79 
80  virtual bool want_colors();
81  virtual void init_title();
82 
86  static YNCursesUI * _ui;
87 
92 
93 public:
94 
98  static YNCursesUI * ui() { return _ui; }
99 
103  virtual void idleLoop( int fd_ycp );
104 
112  virtual void setConsoleFont( const std::string & console_magic,
113  const std::string & font,
114  const std::string & screen_map,
115  const std::string & unicode_map,
116  const std::string & lang );
117 
121  virtual YEvent * runPkgSelection( YWidget * packageSelector );
122 
128 
133  YWidget * askSendWidgetID();
134 
139  void sendEvent( NCursesEvent event );
140 
144  void idleLoopSetEnabled( bool enabled = true );
145 };
146 
147 
154 YUI * createUI( bool withThreads );
155 
156 
157 #endif // YNCursesUI_h
Definition: NCurses.h:72
static YNCursesUI * _ui
Definition: YNCursesUI.h:86
virtual YWidgetFactory * createWidgetFactory()
Definition: YNCursesUI.cc:126
bool idle_loop_enabled
Definition: YNCursesUI.h:91
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:349
virtual YOptionalWidgetFactory * createOptionalWidgetFactory()
Definition: YNCursesUI.cc:136
YWidget * askSendWidgetID()
Definition: YNCursesUI.cc:439
static YNCursesUI * ui()
Definition: YNCursesUI.h:98
void sendEvent(NCursesEvent event)
Definition: YNCursesUI.cc:460
Definition: YNCursesUI.h:38
YNCursesUI(bool withThreads, bool topmostConstructor=true)
Definition: YNCursesUI.cc:64
virtual void idleLoop(int fd_ycp)
Definition: YNCursesUI.cc:159
Definition: NCPackageSelectorPluginStub.h:40
NCPackageSelectorPluginStub * packageSelectorPlugin()
Definition: YNCursesUI.cc:213
virtual YEvent * runPkgSelection(YWidget *packageSelector)
Definition: YNCursesUI.cc:231
Definition: NCurses.h:141
void idleLoopSetEnabled(bool enabled=true)
Definition: YNCursesUI.cc:154
~YNCursesUI()
Definition: YNCursesUI.cc:117