KDEUI
kcmodule.h
Go to the documentation of this file.
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., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 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 KCoreConfigSkeleton; 00039 class KConfigSkeleton; 00040 class KCModulePrivate; 00041 class KComponentData; 00042 00043 namespace KAuth { 00044 class Action; 00045 } 00046 00107 class KDEUI_EXPORT KCModule : public QWidget 00108 { 00109 Q_OBJECT 00110 00111 public: 00112 00120 enum Button { NoAdditionalButton=0, Help=1, Default=2, Apply=4, Export=8 }; 00121 Q_DECLARE_FLAGS( Buttons, Button ) 00122 00123 #ifdef KDE3_SUPPORT 00124 KDE_CONSTRUCTOR_DEPRECATED KCModule( QWidget *parent, const char *name, const QStringList& args = QStringList() ); 00125 00126 KDE_CONSTRUCTOR_DEPRECATED KCModule(const KComponentData &componentData, QWidget *parent, const QStringList& args); 00127 #endif 00128 00135 explicit KCModule(const KComponentData &componentData, QWidget *parent = 0, const QVariantList& args = QVariantList()); 00136 00140 ~KCModule(); 00141 00151 virtual QString quickHelp() const; 00152 00160 virtual const KAboutData *aboutData() const; 00161 00165 void setAboutData( const KAboutData* about ); 00166 00175 Buttons buttons() const; 00176 00189 QString rootOnlyMessage() const; 00190 00201 bool useRootOnlyMessage() const; 00202 00203 KComponentData componentData() const; 00204 00208 QList<KConfigDialogManager*> configs() const; 00209 00227 void setNeedsAuthorization(bool needsAuth); 00228 00234 bool needsAuthorization() const; 00235 00241 KAuth::Action *authAction() const; 00242 00246 QString exportText() const; 00247 00251 void setExportText(const QString &); 00252 00253 public Q_SLOTS: 00267 virtual void load(); 00268 00288 virtual void save(); 00289 00301 virtual void defaults(); 00302 00303 protected: 00313 KConfigDialogManager* addConfig( KCoreConfigSkeleton *config, QWidget* widget ); 00314 00324 KConfigDialogManager* addConfig( KConfigSkeleton *config, QWidget* widget ); 00325 00329 void setQuickHelp( const QString& help ); 00330 00331 virtual void showEvent(QShowEvent *ev); 00332 00333 friend class KCModuleProxy; 00334 00335 Q_SIGNALS: 00336 00344 void changed(bool state); 00345 00354 void quickHelpChanged(); 00355 00364 void rootOnlyMessageChanged(bool use, QString message); 00365 00366 protected Q_SLOTS: 00367 00371 void changed(); 00372 00377 void widgetChanged(); 00378 00382 void authStatusChanged(int); 00383 00384 protected: 00385 00400 void setButtons(Buttons btn); 00401 00410 void setRootOnlyMessage(const QString& message); 00411 00420 void setUseRootOnlyMessage(bool on); 00421 00425 bool managedWidgetChangeState() const; 00426 00431 void unmanagedWidgetChangeState(bool); 00432 00433 private: 00434 KCModulePrivate *const d; 00435 }; 00436 00437 Q_DECLARE_OPERATORS_FOR_FLAGS( KCModule::Buttons ) 00438 00439 #endif //KCMODULE_H 00440
KDE 4.6 API Reference