libyui
YUILoader.h
1 /*
2  Copyright (C) 2000-2017 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: YUILoader.h
20 
21  Author: Stefan Hundhammer <shundhammer@suse.de>
22 
23 /-*/
24 
25 
26 #ifndef YUILoader_h
27 #define YUILoader_h
28 
29 
30 #include <string>
31 
32 #include "YUI.h"
33 #include "YExternalWidgets.h"
34 
35 
36 
37 #define YUIPlugin_Qt "qt"
38 #define YUIPlugin_NCurses "ncurses"
39 #define YUIPlugin_Gtk "gtk"
40 
41 #define YUIPlugin_RestAPI "rest-api"
42 #define YUIPlugin_Ncurses_RestAPI "ncurses-rest-api"
43 #define YUIPlugin_Qt_RestAPI "qt-rest-api"
44 
49 class YUILoader
50 {
51 public:
92  static void loadUI( bool withThreads = false );
93 
102  static void deleteUI();
103 
108  static void loadRestAPIPlugin( const std::string & wantedGUI, bool withThreads = false );
109 
115  static void loadPlugin( const std::string & name, bool withThreads = false );
116 
120  static bool pluginExists( const std::string & pluginBaseName );
121 
137  static void loadExternalWidgets( const std::string & name,
138  const std::string & symbol = "_Z21createExternalWidgetsPKc" );
139 
140 private:
141  YUILoader() {}
142  ~YUILoader() {}
143 
155  static void loadExternalWidgetsPlugin( const std::string & name,
156  const std::string & plugin_name,
157  const std::string & symbol );
158 };
159 
160 
169 typedef YUI * (*createUIFunction_t)( bool );
170 
179 typedef YExternalWidgets * (*createEWFunction_t)( const char * );
180 
188 typedef void (*getServerFunction_t)();
189 
190 
191 #endif // YUILoader_h
Definition: YUI.h:49
static void loadPlugin(const std::string &name, bool withThreads=false)
Definition: YUILoader.cc:244
static void loadExternalWidgets(const std::string &name, const std::string &symbol="_Z21createExternalWidgetsPKc")
Definition: YUILoader.cc:300
static void loadRestAPIPlugin(const std::string &wantedGUI, bool withThreads=false)
Definition: YUILoader.cc:181
static bool pluginExists(const std::string &pluginBaseName)
Definition: YUILoader.cc:329
Definition: YUILoader.h:49
static void deleteUI()
Definition: YUILoader.cc:232
Definition: YExternalWidgets.h:29
static void loadUI(bool withThreads=false)
Definition: YUILoader.cc:51