kcmodulecontainer.h
/* This file is part of the KDE libraries
Copyright (C) 2004 Frans Englich <frans.englich@telia.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KCMODULECONTAINER_H
#define KCMODULECONTAINER_H
#include <qvaluelist.h>
#include <qstring.h>
#include <qstringlist.h>
#include <kcmodule.h>
#include <kcmoduleloader.h>
class QTabWidget;
class QWidget;
class QVBoxLayout;
class KCModuleProxy;
class KUTILS_EXPORT KCModuleContainer : public KCModule
{
Q_OBJECT
public:
KCModuleContainer( QWidget* parent, const char* name, const QStringList& mods );
KCModuleContainer( QWidget *parent, const char* name, const QString& mods = QString() );
void addModule( const QString& module );
virtual ~KCModuleContainer();
void save();
void load();
void defaults();
protected:
void finalize();
typedef QValueList<KCModuleProxy*> ModuleList;
ModuleList changedModules;
ModuleList allModules; // KDE 4 put in the Private class and abstract with getter
private slots:
void tabSwitched( QWidget * module );
void moduleChanged(KCModuleProxy *proxy);
void runAsRoot();
void rootExited();
private:
void init();
class KCModuleContainerPrivate;
KCModuleContainerPrivate *d;
};
#define KCMODULECONTAINER( modules, factoryName ) \
extern "C" \
{ \
KCModule *create_## factoryName(QWidget *parent, const char *name) \
{ \
return new KCModuleContainer( parent, name, QString( modules ) ); \
} \
\
bool test_## factoryName() \
{ \
QStringList modList = QStringList::split( ",", QString(modules).remove( " " )); \
for ( QStringList::Iterator it = modList.begin(); it != modList.end(); ++it ) \
if ( KCModuleLoader::testModule( *it ) ) \
return true; \
return false; \
} \
}
#endif // KCMODULECONTAINER_H
KCModuleContainer::changedModules
ModuleList changedModules
A list containing KCModuleProxy objects which have changed and must be saved.
Definition: kcmodulecontainer.h:137
KCModule::load
virtual void load()
KCModuleContainer
KCModuleContainer is a convenience class encapsulating several KCModules.
Definition: kcmodulecontainer.h:53
KCModule::defaults
virtual void defaults()
KCModuleProxy
Encapsulates a KCModule for embedding.
Definition: kcmoduleproxy.h:68
KCModuleContainer::allModules
ModuleList allModules
A list of all modules which are encapsulated.
Definition: kcmodulecontainer.h:142
KCModule::save
virtual void save()
KCModule

KDE Home | KDE Accessibility Home | Description of Access Keys