• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

KUtils

kcmodulecontainer.h

Go to the documentation of this file.
00001 /* This file is part of the KDE libraries
00002     Copyright (C) 2004 Frans Englich <frans.englich@telia.com>
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 as published by the Free Software Foundation; either
00007     version 2 of the License, or (at your option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012     Library General Public License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to
00016     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017     Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KCMODULECONTAINER_H
00021 #define KCMODULECONTAINER_H
00022 
00023 #include <qvaluelist.h>
00024 #include <qstring.h>
00025 #include <qstringlist.h>
00026 
00027 #include <kcmodule.h>
00028 #include <kcmoduleloader.h>
00029 
00030 class QTabWidget;
00031 class QWidget;
00032 class QVBoxLayout;
00033 
00034 class KCModuleProxy;
00035 
00053 class KUTILS_EXPORT KCModuleContainer : public KCModule
00054 {
00055     Q_OBJECT
00056     public:
00068         KCModuleContainer( QWidget* parent, const char* name, const QStringList& mods );
00069 
00087         KCModuleContainer( QWidget *parent, const char* name, const QString& mods = QString() );
00088 
00096         void addModule( const QString& module );
00097 
00101         virtual ~KCModuleContainer();
00102 
00107         void save();
00108 
00113         void load();
00114 
00119         void defaults();
00120 
00121     protected:
00122 
00129         void finalize();
00130 
00131         typedef QValueList<KCModuleProxy*> ModuleList;
00132 
00137         ModuleList changedModules;
00138 
00142         ModuleList allModules; // KDE 4 put in the Private class and abstract with getter
00143 
00144     private slots:
00145 
00149         void tabSwitched( QWidget * module );
00150 
00151         void moduleChanged(KCModuleProxy *proxy);
00152 
00156         void runAsRoot();
00157 
00161         void rootExited();
00162 
00163     private:
00164 
00165         void init();
00166 
00167         class KCModuleContainerPrivate;
00168         KCModuleContainerPrivate *d;
00169 
00170 };
00171 
00188 #define KCMODULECONTAINER( modules, factoryName ) \
00189 extern "C" \
00190 { \
00191     KCModule *create_## factoryName(QWidget *parent, const char *name) \
00192     { \
00193         return new KCModuleContainer( parent, name, QString( modules ) ); \
00194     } \
00195     \
00196     bool test_## factoryName() \
00197     { \
00198         QStringList modList = QStringList::split( ",", QString(modules).remove( " " )); \
00199         for ( QStringList::Iterator it = modList.begin(); it != modList.end(); ++it ) \
00200             if ( KCModuleLoader::testModule( *it ) ) \
00201                 return true; \
00202         return false; \
00203     } \
00204 }
00205 
00206 #endif // KCMODULECONTAINER_H
00207 

KUtils

Skip menu "KUtils"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • dcop
  • DNSSD
  • interfaces
  • Kate
  • kconf_update
  • KDECore
  • KDED
  • kdefx
  • KDEsu
  • kdeui
  • KDocTools
  • KHTML
  • KImgIO
  • KInit
  • kio
  • kioslave
  • KJS
  • KNewStuff
  • KParts
  • KUtils
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal