libyui  3.0.10
 All Classes Functions Variables Enumerations Friends
YExternalWidgets.h
1 /*
2  Copyright (C) 2013 Angelo Naselli <anaselli at linux dot it>
3 
4  This file is part of libyui project
5 
6  This library is free software; you can redistribute it and/or modify
7  it under the terms of the GNU Lesser General Public License as
8  published by the Free Software Foundation; either version 2.1 of the
9  License, or (at your option) version 3.0 of the License. This library
10  is distributed in the hope that it will be useful, but WITHOUT ANY
11  WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13  License for more details. You should have received a copy of the GNU
14  Lesser General Public License along with this library; if not, write
15  to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
16  Floor, Boston, MA 02110-1301 USA
17 */
18 
19 #ifndef YExternalWidgets_h
20 #define YExternalWidgets_h
21 
23 
24 /**
25  * Abstract base class of a libYUI Widget Extension interface.
26  **/
28 {
29  friend class YExternalWidgetsTerminator;
30 
31 protected:
32  /**
33  * Constructor.
34  **/
36 
37 public:
38 
39  /**
40  * Destructor.
41  **/
42  virtual ~YExternalWidgets();
43 
44 
45  /**
46  * Access the global YUI external widgets.
47  *
48  * NOTE that only one external widget plugin can be loaded, further implementation
49  * may allow more.
50  **/
52 
53  /**
54  * Return the external widget factory that provides all the createXY() methods for
55  * user defined widgets.
56  *
57  * This will create the factory upon the first call and return a pointer to
58  * the one and only (singleton) factory upon each subsequent call.
59  * This may throw exceptions if the factory cannot be created.
60  *
61  * It is up to user extend YExternalWidgetFactory to add createXY() methods in
62  * his/her implementation. So once YExternalWidgetFactory is extended with
63  * all the createXY() methods, three sub-plugins must be defined one for each
64  * supported graphical environment, e.g. Gtk, ncurses and QT, following the
65  * libyui implementation rules.
66  *
67  * For instance an external widgets plugin called yui-foo that needs Gtk, ncurses
68  * and QT specialization will require also yui-foo-gtk, yui-foo-ncurses and
69  * yui-foo-qt plugin implementation.
70  *
71  **/
73 
74 protected:
75 
76  /**
77  * Create the external widgets factory that provides all the createXY() methods for
78  *
79  * Derived classes are required to implement this. Usually createXY() is virtual,
80  * real implementation is demanded to derived classes that implement Gtk, ncurses and QT
81  * specialization.
82  **/
84 
85 private:
86 
87  static YExternalWidgets *_externalWidgets;
88 };
89 
90 #endif // YExternalWidgets_h
virtual YExternalWidgetFactory * createExternalWidgetFactory()=0
virtual ~YExternalWidgets()
static YExternalWidgets * externalWidgets()
static YExternalWidgetFactory * externalWidgetFactory()