libyui-qt  2.53.0
YQPackageSelectorPluginStub.cc
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: YQPackageSelectorPluginStub.cc
20 
21  Authors: Katharina Machalkova <kmachalkova@suse.cz>
22  Stephan Kulow <coolo@suse.de>
23 
24 /-*/
25 
26 
27 #include "YQPackageSelectorPluginStub.h"
28 
29 #define YUILogComponent "qt-ui"
30 #include <yui/YUILog.h>
31 
32 #define PLUGIN_BASE_NAME "qt-pkg"
33 
34 
36  : YPackageSelectorPlugin( PLUGIN_BASE_NAME )
37 {
38  if ( success() )
39  {
40  yuiMilestone() << "Loaded " << PLUGIN_BASE_NAME
41  << " plugin successfully from " << pluginLibFullPath()
42  << endl;
43  }
44 
45 
46  impl = (YQPackageSelectorPluginIf*) locateSymbol("PSP");
47 
48  if ( ! impl )
49  {
50  yuiError() << "Plugin " << PLUGIN_BASE_NAME << " does not provide PSP symbol" << endl;
51  }
52 }
53 
54 
56 {
57  // NOP
58 }
59 
60 
61 YPackageSelector *
62 YQPackageSelectorPluginStub::createPackageSelector( YWidget * parent, long modeFlags )
63 {
64  if ( ! impl )
65  YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
66 
67  return impl->createPackageSelector( parent, modeFlags );
68 }
69 
70 
71 YWidget *
72 YQPackageSelectorPluginStub::createPatternSelector( YWidget * parent, long modeFlags )
73 {
74  if ( ! impl )
75  YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
76 
77  return impl->createPatternSelector( parent, modeFlags );
78 }
79 
80 
81 YWidget *
82 YQPackageSelectorPluginStub::createSimplePatchSelector( YWidget * parent, long modeFlags )
83 {
84  if ( ! impl )
85  YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
86 
87  return impl->createSimplePatchSelector( parent, modeFlags );
88 }
89 
YQPackageSelectorPluginStub()
Constructor: Load the plugin library for the package selector.
virtual YPackageSelector * createPackageSelector(YWidget *parent, long modeFlags)
Create a package selector.
virtual YWidget * createPatternSelector(YWidget *parent, long modeFlags)
Create a pattern selector (optional widget).
virtual ~YQPackageSelectorPluginStub()
Destructor.
virtual YWidget * createSimplePatchSelector(YWidget *parent, long modeFlags)
Create a simple patch selector (optional widget).