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 00188 void setAboutData( KAboutData* about ); 00189 00198 int buttons() const { return _btn; }; 00199 00212 QString rootOnlyMsg() const; 00213 00224 bool useRootOnlyMsg() const; 00225 00226 KInstance *instance() const; 00227 00228 protected: 00239 KConfigDialogManager* addConfig( KConfigSkeleton *config, QWidget* widget ); 00240 00246 void setQuickHelp( const QString& help ); 00247 00248 signals: 00249 00257 void changed(bool state); 00258 00267 void quickHelpChanged(); 00268 00269 protected slots: 00270 00275 void changed(); 00276 00277 protected: 00278 00291 void setButtons(int btn) { _btn = btn; }; 00292 00302 void setRootOnlyMsg(const QString& msg); 00303 00312 void setUseRootOnlyMsg(bool on); 00313 00314 private: 00315 00316 int _btn; 00317 protected: 00318 virtual void virtual_hook( int id, void* data ); 00319 private: 00320 KCModulePrivate *d; 00321 00325 void init(); 00326 00327 }; 00328 00329 #endif //__KCMODULE_H__ 00330
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sun Oct 17 11:27:26 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003