• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • sources
  • kde-4.14
  • kdelibs
  • kdeui
  • widgets
kcmodule.h
Go to the documentation of this file.
1 /*
2  This file is part of the KDE libraries
3 
4  Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 
21 */
22 
23 #ifndef KCMODULE_H
24 #define KCMODULE_H
25 
26 #include <kdeui_export.h>
27 
28 #include <QtCore/QVariant>
29 #include <QtGui/QWidget>
30 
31 #ifdef Q_WS_X11
32 #include <fixx11h.h>
33 #endif
34 
35 class QStringList;
36 class KAboutData;
37 class KConfigDialogManager;
38 class KCoreConfigSkeleton;
39 class KConfigSkeleton;
40 class KCModulePrivate;
41 class KComponentData;
42 
43 namespace KAuth {
44  class Action;
45 }
46 
107 class KDEUI_EXPORT KCModule : public QWidget
108 {
109  Q_OBJECT
110 
111 public:
112 
120  enum Button { NoAdditionalButton=0, Help=1, Default=2, Apply=4, Export=8 };
121  Q_DECLARE_FLAGS( Buttons, Button )
122 
123 #ifdef KDE3_SUPPORT
124  KDE_CONSTRUCTOR_DEPRECATED KCModule( QWidget *parent, const char *name, const QStringList& args = QStringList() );
125 
126  KDE_CONSTRUCTOR_DEPRECATED KCModule(const KComponentData &componentData, QWidget *parent, const QStringList& args);
127 #endif
128 
135  explicit KCModule(const KComponentData &componentData, QWidget *parent = 0, const QVariantList& args = QVariantList());
136 
140  ~KCModule();
141 
151  virtual QString quickHelp() const;
152 
160  virtual const KAboutData *aboutData() const;
161 
165  void setAboutData( const KAboutData* about );
166 
175  Buttons buttons() const;
176 
189  QString rootOnlyMessage() const;
190 
201  bool useRootOnlyMessage() const;
202 
203  KComponentData componentData() const;
204 
208  QList<KConfigDialogManager*> configs() const;
209 
227  void setNeedsAuthorization(bool needsAuth);
228 
234  bool needsAuthorization() const;
235 
241  KAuth::Action *authAction() const;
242 
246  QString exportText() const;
247 
251  void setExportText(const QString &);
252 
253 public Q_SLOTS:
267  virtual void load();
268 
288  virtual void save();
289 
301  virtual void defaults();
302 
303 protected:
313  KConfigDialogManager* addConfig( KCoreConfigSkeleton *config, QWidget* widget );
314 
324  KConfigDialogManager* addConfig( KConfigSkeleton *config, QWidget* widget );
325 
329  void setQuickHelp( const QString& help );
330 
331  virtual void showEvent(QShowEvent *ev);
332 
333  friend class KCModuleProxy;
334 
335 Q_SIGNALS:
336 
344  void changed(bool state);
345 
354  void quickHelpChanged();
355 
364  void rootOnlyMessageChanged(bool use, QString message);
365 
366 protected Q_SLOTS:
367 
371  void changed();
372 
377  void widgetChanged();
378 
382  void authStatusChanged(int);
383 
384 protected:
385 
400  void setButtons(Buttons btn);
401 
410  void setRootOnlyMessage(const QString& message);
411 
420  void setUseRootOnlyMessage(bool on);
421 
425  bool managedWidgetChangeState() const;
426 
431  void unmanagedWidgetChangeState(bool);
432 
433 private:
434  KCModulePrivate *const d;
435 };
436 
437 Q_DECLARE_OPERATORS_FOR_FLAGS( KCModule::Buttons )
438 
439 #endif //KCMODULE_H
440 
KStandardAction::help
KAction * help(const QObject *recvr, const char *slot, QObject *parent)
Display the help.
Definition: kstandardaction.cpp:596
KStandardGuiItem::Apply
Definition: kstandardguiitem.h:50
QWidget
KStandardAction::name
const char * name(StandardAction id)
This will return the internal name of a given standard action.
Definition: kstandardaction.cpp:223
KConfigDialogManager
Provides a means of automatically retrieving, saving and resetting KConfigSkeleton based settings in ...
Definition: kconfigdialogmanager.h:85
KConfigSkeleton
Class for handling preferences settings for an application.
Definition: kconfigskeleton.h:40
KDE_CONSTRUCTOR_DEPRECATED
#define KDE_CONSTRUCTOR_DEPRECATED
QWidget::showEvent
virtual void showEvent(QShowEvent *event)
QShowEvent
KCoreConfigSkeleton
KAboutData
QString
QList< KConfigDialogManager * >
QStringList
Action
fixx11h.h
KCModule::Button
Button
An enumeration type for the buttons used by this module.
Definition: kcmodule.h:120
KStandardAction::Help
Definition: kstandardaction.h:156
kdeui_export.h
KStandardGuiItem::defaults
KGuiItem defaults()
Returns the 'Defaults' gui item.
Definition: kstandardguiitem.cpp:200
KAuth::Action
KStandardAction::save
KAction * save(const QObject *recvr, const char *slot, QObject *parent)
Save the current document.
Definition: kstandardaction.cpp:244
KCModule
The base class for configuration modules.
Definition: kcmodule.h:107
KComponentData
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:23:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal