kcmodule.h
/*
This file is part of the KDE libraries
Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
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 KCMODULE_H
#define KCMODULE_H
#include <qwidget.h>
#include <kdelibs_export.h>
class QStringList;
class KAboutData;
class KConfigDialogManager;
class KConfigSkeleton;
class KCModulePrivate;
class KInstance;
class KDEUI_EXPORT KCModule : public QWidget
{
Q_OBJECT
public:
enum Button {Help=1, Default=2, Apply=16,
Reset=4, /* obsolete, do not use! */
Cancel=8, /* obsolete, do not use! */
Ok=32, /* obsolete, do not use! */
SysDefault=64 /* obsolete, do not use! */ };
/*
* Base class for all KControlModules.
* Make sure you have a QStringList argument in your
* implementation.
*/
KCModule(QWidget *parent=0, const char *name=0, const QStringList &args=QStringList() );
KCModule(KInstance *instance, QWidget *parent=0, const QStringList &args=QStringList() );
/*
* Destroys the module.
*/
~KCModule();
virtual void load();
// ### KDE 4: Call load() automatically through a single-shot timer
// from the constructor // and change documentation
virtual void save();
virtual void defaults();
virtual void sysdefaults() { defaults(); }
// KDE 4 deprecate
virtual QString quickHelp() const;
virtual const KAboutData *aboutData() const;
void setAboutData( KAboutData* about );
int buttons() const { return _btn; }
QString rootOnlyMsg() const;
bool useRootOnlyMsg() const;
KInstance *instance() const;
const QPtrList<KConfigDialogManager>& configs() const;
protected:
KConfigDialogManager* addConfig( KConfigSkeleton *config, QWidget* widget );
void setQuickHelp( const QString& help );
signals:
void changed(bool state);
void quickHelpChanged();
protected slots:
void changed();
void widgetChanged();
protected:
void setButtons(int btn) { _btn = btn; }
void setRootOnlyMsg(const QString& msg);
void setUseRootOnlyMsg(bool on);
bool managedWidgetChangeState() const;
void unmanagedWidgetChangeState(bool);
private:
int _btn;
protected:
virtual void virtual_hook( int id, void* data );
private:
KCModulePrivate *d;
void init();
};
#endif //KCMODULE_H
KCModule::setButtons
void setButtons(int btn)
Sets the buttons to display.
Definition: kcmodule.h:309
KConfigDialogManager
KConfigSkeleton
KInstance
KAboutData
KCModule::sysdefaults
virtual void sysdefaults()
Set the configuration to system default values.
Definition: kcmodule.h:166
KCModule::Button
Button
An enumeration type for the buttons used by this module.
Definition: kcmodule.h:81
KCModule::buttons
int buttons() const
Indicate which buttons will be used.
Definition: kcmodule.h:203
KCModule
The base class for control center modules.
Definition: kcmodule.h:69

KDE Home | KDE Accessibility Home | Description of Access Keys