Changeset View
Changeset View
Standalone View
Standalone View
resources/pop3/settings.h
Show All 16 Lines | 1 | /* Copyright 2010 Thomas McGuire <mcguire@kde.org> | |||
---|---|---|---|---|---|
17 | Boston, MA 02110-1301, USA. | 17 | Boston, MA 02110-1301, USA. | ||
18 | */ | 18 | */ | ||
19 | #ifndef SETTINGS_H | 19 | #ifndef SETTINGS_H | ||
20 | #define SETTINGS_H | 20 | #define SETTINGS_H | ||
21 | 21 | | |||
22 | #include "settingsbase.h" | 22 | #include "settingsbase.h" | ||
23 | 23 | | |||
24 | #include <qwindowdefs.h> | 24 | #include <qwindowdefs.h> | ||
25 | #include <QFlag> | ||||
25 | 26 | | |||
26 | /** | 27 | /** | ||
27 | * Extended settings class that allows setting the password over dbus, which is used by the | 28 | * Extended settings class that allows setting the password over dbus, which is used by the | ||
28 | * wizard. | 29 | * wizard. | ||
29 | */ | 30 | */ | ||
30 | class Settings : public SettingsBase | 31 | class Settings : public SettingsBase | ||
31 | { | 32 | { | ||
32 | Q_OBJECT | 33 | Q_OBJECT | ||
33 | Q_CLASSINFO("D-Bus Interface", "org.kde.Akonadi.POP3.Wallet") | 34 | Q_CLASSINFO("D-Bus Interface", "org.kde.Akonadi.POP3.Wallet") | ||
34 | public: | 35 | public: | ||
35 | Settings(const KSharedConfigPtr &config); | 36 | enum class Option { | ||
37 | NoOption = 0, | ||||
38 | ExportToDBus = 1 | ||||
39 | }; | ||||
40 | Q_DECLARE_FLAGS(Options, Option) | ||||
41 | | ||||
42 | explicit Settings(const KSharedConfigPtr &config, Options options = Option::ExportToDBus); | ||||
36 | 43 | | |||
37 | void setWindowId(WId id); | 44 | void setWindowId(WId id); | ||
38 | void setResourceId(const QString &resourceIdentifier); | 45 | void setResourceId(const QString &resourceIdentifier); | ||
39 | static Settings *self(); | | |||
40 | 46 | | |||
41 | public Q_SLOTS: | 47 | public Q_SLOTS: | ||
42 | Q_SCRIPTABLE void setPassword(const QString &password); | 48 | Q_SCRIPTABLE void setPassword(const QString &password); | ||
43 | private: | 49 | private: | ||
44 | WId mWinId; | 50 | WId mWinId; | ||
45 | QString mResourceId; | 51 | QString mResourceId; | ||
46 | }; | 52 | }; | ||
47 | 53 | | |||
54 | Q_DECLARE_OPERATORS_FOR_FLAGS(Settings::Options) | ||||
55 | | ||||
48 | #endif | 56 | #endif |