libyui-qt  2.46.13
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 
35  : YPackageSelectorPlugin( PLUGIN_BASE_NAME )
36 {
37  if ( success() )
38  {
39  yuiMilestone() << "Loaded " << PLUGIN_BASE_NAME
40  << " plugin successfully from " << pluginLibFullPath()
41  << std::endl;
42  }
43 
44 
45  impl = (YQPackageSelectorPluginIf*) locateSymbol("PSP");
46 
47  if ( ! impl )
48  {
49  yuiError() << "Plugin " << PLUGIN_BASE_NAME << " does not provide PSP symbol" << std::endl;
50  }
51 }
52 
53 
55 {
56  // NOP
57 }
58 
59 
60 YPackageSelector *
61 YQPackageSelectorPluginStub::createPackageSelector( YWidget * parent, long modeFlags )
62 {
63  if ( ! impl )
64  YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
65 
66  return impl->createPackageSelector( parent, modeFlags );
67 }
68 
69 
70 YWidget *
71 YQPackageSelectorPluginStub::createPatternSelector( YWidget * parent, long modeFlags )
72 {
73  if ( ! impl )
74  YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
75 
76  return impl->createPatternSelector( parent, modeFlags );
77 }
78 
79 
80 YWidget *
81 YQPackageSelectorPluginStub::createSimplePatchSelector( YWidget * parent, long modeFlags )
82 {
83  if ( ! impl )
84  YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
85 
86  return impl->createSimplePatchSelector( parent, modeFlags );
87 }
88 
YQPackageSelectorPluginStub()
Constructor: Load the plugin library for the package selector.
virtual ~YQPackageSelectorPluginStub()
Destructor.
virtual YWidget * createSimplePatchSelector(YWidget *parent, long modeFlags)
Create a simple patch selector (optional widget).
virtual YWidget * createPatternSelector(YWidget *parent, long modeFlags)
Create a pattern selector (optional widget).
virtual YPackageSelector * createPackageSelector(YWidget *parent, long modeFlags)
Create a package selector.