kdeui Library API Documentation

kcmodule.h

00001 /*
00002    This file is part of the KDE libraries
00003 
00004    Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
00005 
00006    This library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Library General Public
00008    License as published by the Free Software Foundation; either
00009    version 2 of the License, or (at your option) any later version.
00010 
00011    This library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Library General Public License for more details.
00015 
00016    You should have received a copy of the GNU Library General Public License
00017    along with this library; see the file COPYING.LIB.  If not, write to
00018    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00019    Boston, MA 02111-1307, USA.
00020 
00021 */
00022 #ifndef __KCMODULE_H__
00023 #define __KCMODULE_H__
00024 
00025 #include <qwidget.h>
00026 #include <qstringlist.h>
00027 class KAboutData;
00028 class KCModulePrivate;
00029 class KInstance;
00030 
00062 class KCModule : public QWidget
00063 {
00064   Q_OBJECT
00065 
00066 public:
00067 
00074   enum Button {Help=1, Default=2, Apply=16,
00075                Reset=4, /* obsolete, do not use! */
00076                Cancel=8, /* obsolete, do not use! */
00077                Ok=32, /* obsolete, do not use! */
00078            SysDefault=64 /* obsolete, do not use! */ };
00079 
00080   /*
00081    * Base class for all KControlModules.
00082    * Make sure you have a QStringList argument in your
00083    * implementation.
00084    */
00085   KCModule(QWidget *parent=0, const char *name=0, const QStringList &args=QStringList() );
00086 
00087   KCModule(KInstance *instance, QWidget *parent=0, const QStringList &args=QStringList() );
00088 
00089   /*
00090    * Destroys the module.
00091    */
00092   ~KCModule();
00093 
00108   virtual void load() {};
00109   // ### KDE 4: Call load() automatically through a single-shot timer
00110   //            from the constructor
00111 
00125   virtual void save() {};
00126 
00133   virtual void defaults() {};
00134 
00143   virtual void sysdefaults() { defaults(); };
00144 
00154   virtual QString quickHelp() const { return QString::null; };
00155 
00161   virtual const KAboutData *aboutData() const { return 0; }
00162 
00171   int buttons() const { return _btn; };
00172 
00185   QString rootOnlyMsg() const;
00186 
00197   bool useRootOnlyMsg() const;
00198 
00199   KInstance *instance() const;
00200 
00201 signals:
00202 
00210   void changed(bool state);
00211 
00220   void quickHelpChanged();
00221 
00222 protected:
00223 
00236   void setButtons(int btn) { _btn = btn; };
00237 
00247   void setRootOnlyMsg(const QString& msg);
00248 
00257   void setUseRootOnlyMsg(bool on);
00258 
00259 private:
00260 
00261   int _btn;
00262 protected:
00263   virtual void virtual_hook( int id, void* data );
00264 private:
00265   KCModulePrivate *d;
00266 };
00267 
00268 #endif
KDE Logo
This file is part of the documentation for kdeui Library Version 3.2.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Mar 4 22:43:49 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003