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 
00023 #ifndef __KCMODULE_H__
00024 #define __KCMODULE_H__
00025 
00026 #include <qwidget.h>
00027 
00028 class QStringList;
00029 
00030 class KAboutData;
00031 class KConfigDialogManager;
00032 class KConfigSkeleton;
00033 class KCModulePrivate;
00034 class KInstance;
00035 
00066 class KCModule : public QWidget
00067 {
00068   Q_OBJECT
00069 
00070 public:
00071 
00078   enum Button {Help=1, Default=2, Apply=16,
00079                Reset=4, /* obsolete, do not use! */
00080                Cancel=8, /* obsolete, do not use! */
00081                Ok=32, /* obsolete, do not use! */
00082            SysDefault=64 /* obsolete, do not use! */ };
00083 
00084   /*
00085    * Base class for all KControlModules.
00086    * Make sure you have a QStringList argument in your
00087    * implementation.
00088    */
00089   KCModule(QWidget *parent=0, const char *name=0, const QStringList &args=QStringList() );
00090 
00091   KCModule(KInstance *instance, QWidget *parent=0, const QStringList &args=QStringList() );
00092 
00093   /*
00094    * Destroys the module.
00095    */
00096   ~KCModule();
00097 
00117   virtual void load();
00118   // ### KDE 4: Call load() automatically through a single-shot timer
00119   //            from the constructor // and change documentation
00120 
00139   virtual void save();
00140 
00151   virtual void defaults();
00152 
00161   virtual void sysdefaults() { defaults(); };
00162   // KDE 4 deprecate
00163 
00173   virtual QString quickHelp() const;
00174 
00182   virtual const KAboutData *aboutData() const;
00183   
00187    void setAboutData( KAboutData* about );
00188 
00197   int buttons() const { return _btn; };
00198 
00211   QString rootOnlyMsg() const;
00212 
00223   bool useRootOnlyMsg() const;
00224 
00225   KInstance *instance() const;
00226 
00227 protected:
00237   KConfigDialogManager* addConfig( KConfigSkeleton *config, QWidget* widget );
00238 
00242   void setQuickHelp( const QString& help );
00243 
00244 signals:
00245 
00253   void changed(bool state);
00254 
00263   void quickHelpChanged();
00264 
00265 protected slots:
00266 
00271   void changed();
00272 
00273 protected:
00274 
00287   void setButtons(int btn) { _btn = btn; };
00288 
00298   void setRootOnlyMsg(const QString& msg);
00299 
00308   void setUseRootOnlyMsg(bool on);
00309 
00310 private:
00311 
00312   int _btn;
00313 protected:
00314   virtual void virtual_hook( int id, void* data );
00315 private:
00316   KCModulePrivate *d;
00317 
00321   void init();
00322 
00323 };
00324 
00325 #endif //__KCMODULE_H__
00326 
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Nov 27 13:42:56 2004 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003