kpluginselector.h

00001 /*  This file is part of the KDE project
00002     Copyright (C) 2002-2003 Matthias Kretz <kretz@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or
00005     modify it under the terms of the GNU Library General Public
00006     License version 2 as published by the Free Software Foundation.
00007 
00008     This library is distributed in the hope that it will be useful,
00009     but WITHOUT ANY WARRANTY; without even the implied warranty of
00010     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011     Library General Public License for more details.
00012 
00013     You should have received a copy of the GNU Library General Public License
00014     along with this library; see the file COPYING.LIB.  If not, write to
00015     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016     Boston, MA 02110-1301, USA.
00017 
00018 */
00019 
00020 #ifndef KPLUGINSELECTOR_H
00021 #define KPLUGINSELECTOR_H
00022 
00023 #include <qwidget.h>
00024 #include <qstring.h>
00025 
00026 #include <kdelibs_export.h>
00027 
00028 class KInstance;
00029 class KPluginInfo;
00030 class QWidgetStack;
00031 class KConfig;
00032 class KConfigGroup;
00033 
00058 class KUTILS_EXPORT KPluginSelector : public QWidget
00059 {
00060     friend class KPluginSelectionWidget;
00061 
00062     Q_OBJECT
00063     public:
00067         KPluginSelector( QWidget * parent, const char * name = 0 );
00068         ~KPluginSelector();
00069 
00099         void addPlugins( const QString & instanceName,
00100                 const QString & catname = QString::null,
00101                 const QString & category = QString::null,
00102                 KConfig * config = 0 );
00103 
00108         void addPlugins( const KInstance * instance,
00109                 const QString & catname = QString::null,
00110                 const QString & category = QString::null,
00111                 KConfig * config = 0 );
00112 
00138         void addPlugins( const QValueList<KPluginInfo*> & plugininfos,
00139                 const QString & catname = QString::null,
00140                 const QString & category = QString::null,
00141                 KConfig * config = 0 );
00142 
00150         void setShowEmptyConfigPage( bool );
00151 
00159         void load();
00160 
00164         void save();
00165 
00169         void defaults();
00170 
00171     signals:
00175         void changed( bool );
00176 
00182         void configCommitted( const QCString & instanceName );
00183 
00184     private:
00190         QWidgetStack * widgetStack();
00191 
00197         void configPage( int id );
00198 
00202         void checkNeedForTabWidget();
00203 
00207     void addPluginsInternal( const QValueList<KPluginInfo*> plugininfos,
00208                                  const QString & catname, const QString & category,
00209                                  KConfigGroup* cfgGroup );
00210 
00211     class KPluginSelectorPrivate;
00212         KPluginSelectorPrivate * d;
00213 };
00214 
00215 // vim: sw=4 sts=4 et tw=80
00216 #endif // KPLUGINSELECTOR_H
KDE Home | KDE Accessibility Home | Description of Access Keys