KDEUI
kcmodule.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef KCMODULE_H
00024 #define KCMODULE_H
00025
00026 #include <kdeui_export.h>
00027
00028 #include <QtCore/QVariant>
00029 #include <QtGui/QWidget>
00030
00031 #ifdef Q_WS_X11
00032 #include <fixx11h.h>
00033 #endif
00034
00035 class QStringList;
00036 class KAboutData;
00037 class KConfigDialogManager;
00038 class KConfigSkeleton;
00039 class KCModulePrivate;
00040 class KComponentData;
00041
00042 namespace KAuth {
00043 class Action;
00044 }
00045
00106 class KDEUI_EXPORT KCModule : public QWidget
00107 {
00108 Q_OBJECT
00109
00110 public:
00111
00119 enum Button { NoAdditionalButton=0, Help=1, Default=2, Apply=4 };
00120 Q_DECLARE_FLAGS( Buttons, Button )
00121
00122 #ifdef KDE3_SUPPORT
00123 KDE_CONSTRUCTOR_DEPRECATED KCModule( QWidget *parent, const char *name, const QStringList& args = QStringList() );
00124
00125 KDE_CONSTRUCTOR_DEPRECATED KCModule(const KComponentData &componentData, QWidget *parent, const QStringList& args);
00126 #endif
00127
00134 explicit KCModule(const KComponentData &componentData, QWidget *parent = 0, const QVariantList& args = QVariantList());
00135
00139 ~KCModule();
00140
00150 virtual QString quickHelp() const;
00151
00159 virtual const KAboutData *aboutData() const;
00160
00164 void setAboutData( const KAboutData* about );
00165
00174 Buttons buttons() const;
00175
00188 QString rootOnlyMessage() const;
00189
00200 bool useRootOnlyMessage() const;
00201
00202 KComponentData componentData() const;
00203
00207 QList<KConfigDialogManager*> configs() const;
00208
00227 void setNeedsAuthorization(bool needsAuth);
00228
00234 bool needsAuthorization() const;
00235
00241 KAuth::Action *authAction() const;
00242
00243 public Q_SLOTS:
00257 virtual void load();
00258
00278 virtual void save();
00279
00291 virtual void defaults();
00292
00293 protected:
00303 KConfigDialogManager* addConfig( KConfigSkeleton *config, QWidget* widget );
00304
00308 void setQuickHelp( const QString& help );
00309
00310 virtual void showEvent(QShowEvent *ev);
00311
00312 friend class KCModuleProxy;
00313
00314 Q_SIGNALS:
00315
00323 void changed(bool state);
00324
00333 void quickHelpChanged();
00334
00343 void rootOnlyMessageChanged(bool use, QString message);
00344
00345 protected Q_SLOTS:
00346
00350 void changed();
00351
00356 void widgetChanged();
00357
00361 void authStatusChanged(int);
00362
00363 protected:
00364
00379 void setButtons(Buttons btn);
00380
00389 void setRootOnlyMessage(const QString& message);
00390
00399 void setUseRootOnlyMessage(bool on);
00400
00404 bool managedWidgetChangeState() const;
00405
00410 void unmanagedWidgetChangeState(bool);
00411
00412 private:
00413 KCModulePrivate *const d;
00414 };
00415
00416 Q_DECLARE_OPERATORS_FOR_FLAGS( KCModule::Buttons )
00417
00418 #endif //KCMODULE_H
00419