Changeset View
Changeset View
Standalone View
Standalone View
src/kcmodule.h
Show All 19 Lines | |||||
20 | 20 | | |||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #ifndef KCMODULE_H | 23 | #ifndef KCMODULE_H | ||
24 | #define KCMODULE_H | 24 | #define KCMODULE_H | ||
25 | 25 | | |||
26 | #include <kconfigwidgets_export.h> | 26 | #include <kconfigwidgets_export.h> | ||
27 | 27 | | |||
28 | #ifndef KCONFIGWIDGETS_NO_KAUTH | ||||
28 | #include <kauthaction.h> | 29 | #include <kauthaction.h> | ||
30 | #endif | ||||
29 | 31 | | |||
30 | #include <QVariant> | 32 | #include <QVariant> | ||
31 | #include <QWidget> | 33 | #include <QWidget> | ||
32 | 34 | | |||
33 | class QStringList; | 35 | class QStringList; | ||
34 | class KAboutData; | 36 | class KAboutData; | ||
35 | class KConfigDialogManager; | 37 | class KConfigDialogManager; | ||
36 | class KCoreConfigSkeleton; | 38 | class KCoreConfigSkeleton; | ||
▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Line(s) | 101 | public: | |||
220 | 222 | | |||
221 | /** | 223 | /** | ||
222 | * Returns the value previously set with setNeedsAuthorization() or setAuthAction(). By default it's @c false. | 224 | * Returns the value previously set with setNeedsAuthorization() or setAuthAction(). By default it's @c false. | ||
223 | * | 225 | * | ||
224 | * @return @c true if the module's save() method requires authorization, @c false otherwise | 226 | * @return @c true if the module's save() method requires authorization, @c false otherwise | ||
225 | */ | 227 | */ | ||
226 | bool needsAuthorization() const; | 228 | bool needsAuthorization() const; | ||
227 | 229 | | |||
230 | #ifndef KCONFIGWIDGETS_NO_KAUTH | ||||
228 | /** | 231 | /** | ||
229 | * @brief Set if the module's save() method requires authorization to be executed | 232 | * @brief Set if the module's save() method requires authorization to be executed | ||
230 | * | 233 | * | ||
231 | * It will still have to execute the action itself using the KAuth library, so | 234 | * It will still have to execute the action itself using the KAuth library, so | ||
232 | * this method is not technically needed to perform the action, but | 235 | * this method is not technically needed to perform the action, but | ||
233 | * using this method will ensure that hosting | 236 | * using this method will ensure that hosting | ||
234 | * applications like System Settings or kcmshell behave correctly. | 237 | * applications like System Settings or kcmshell behave correctly. | ||
235 | * | 238 | * | ||
236 | * @param action the action that will be used by this KCModule | 239 | * @param action the action that will be used by this KCModule | ||
237 | */ | 240 | */ | ||
238 | void setAuthAction(const KAuth::Action &action); | 241 | void setAuthAction(const KAuth::Action &action); | ||
239 | 242 | | |||
240 | /** | 243 | /** | ||
241 | * Returns the action previously set with setAuthAction(). By default its an invalid action. | 244 | * Returns the action previously set with setAuthAction(). By default its an invalid action. | ||
242 | * | 245 | * | ||
243 | * @return The action that has to be authorized to execute the save() method. | 246 | * @return The action that has to be authorized to execute the save() method. | ||
244 | */ | 247 | */ | ||
245 | KAuth::Action authAction() const; | 248 | KAuth::Action authAction() const; | ||
249 | #endif | ||||
246 | 250 | | |||
247 | /** | 251 | /** | ||
248 | * Returns the value set by setExportText(); | 252 | * Returns the value set by setExportText(); | ||
249 | * @deprecated since 5.0, obsolete feature | 253 | * @deprecated since 5.0, obsolete feature | ||
250 | */ | 254 | */ | ||
251 | KCONFIGWIDGETS_DEPRECATED QString exportText() const; | 255 | KCONFIGWIDGETS_DEPRECATED QString exportText() const; | ||
252 | 256 | | |||
253 | /** | 257 | /** | ||
▲ Show 20 Lines • Show All 123 Lines • ▼ Show 20 Line(s) | 376 | protected Q_SLOTS: | |||
377 | void changed(); | 381 | void changed(); | ||
378 | 382 | | |||
379 | /** | 383 | /** | ||
380 | * A managed widget was changed, the widget settings and the current | 384 | * A managed widget was changed, the widget settings and the current | ||
381 | * settings are compared and a corresponding changed() signal is emitted | 385 | * settings are compared and a corresponding changed() signal is emitted | ||
382 | */ | 386 | */ | ||
383 | void widgetChanged(); | 387 | void widgetChanged(); | ||
384 | 388 | | |||
389 | #ifndef KCONFIGWIDGETS_NO_KAUTH | ||||
385 | /** | 390 | /** | ||
386 | * The status of the auth action, if one, has changed | 391 | * The status of the auth action, if one, has changed | ||
387 | */ | 392 | */ | ||
388 | void authStatusChanged(KAuth::Action::AuthStatus status); | 393 | void authStatusChanged(KAuth::Action::AuthStatus status); | ||
394 | #endif | ||||
389 | 395 | | |||
390 | protected: | 396 | protected: | ||
391 | 397 | | |||
392 | /** | 398 | /** | ||
393 | * Sets the buttons to display. | 399 | * Sets the buttons to display. | ||
394 | * | 400 | * | ||
395 | * Help: shows a "Help" button. | 401 | * Help: shows a "Help" button. | ||
396 | * | 402 | * | ||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |