QtPass  1.2.3
Multi-platform GUI for pass, the standard unix password manager.
qtpasssettings.h
Go to the documentation of this file.
1 #ifndef QTPASSSETTINGS_H
2 #define QTPASSSETTINGS_H
3 
4 #include "enums.h"
5 #include "imitatepass.h"
7 #include "realpass.h"
8 #include "settingsconstants.h"
9 
10 #include <QByteArray>
11 #include <QHash>
12 #include <QPoint>
13 #include <QSettings>
14 #include <QSize>
15 #include <QVariant>
16 
21 class QtPassSettings : public QSettings {
22 private:
23  explicit QtPassSettings();
24 
25  QtPassSettings(const QString &organization, const QSettings::Format format)
26  : QSettings(organization, format) {}
27  QtPassSettings(const QString &organization, const QString &application)
28  : QSettings(organization, application) {}
29 
30  virtual ~QtPassSettings() {}
31 
32  static bool initialized;
33  static QtPassSettings *m_instance;
34 
35  static Pass *pass;
36  static QScopedPointer<RealPass> realPass;
37  static QScopedPointer<ImitatePass> imitatePass;
38 
39 public:
40  static QtPassSettings *getInstance();
41 
42  static QString
43  getVersion(const QString &defaultValue = QVariant().toString());
44  static void setVersion(const QString &version);
45 
46  static QByteArray
47  getGeometry(const QByteArray &defaultValue = QVariant().toByteArray());
48  static void setGeometry(const QByteArray &geometry);
49 
50  static QByteArray
51  getSavestate(const QByteArray &defaultValue = QVariant().toByteArray());
52  static void setSavestate(const QByteArray &saveState);
53 
54  static QPoint getPos(const QPoint &defaultValue = QVariant().toPoint());
55  static void setPos(const QPoint &pos);
56 
57  static QSize getSize(const QSize &defaultValue = QVariant().toSize());
58  static void setSize(const QSize &size);
59 
60  static bool isMaximized(const bool &defaultValue = QVariant().toBool());
61  static void setMaximized(const bool &maximized);
62 
63  static bool isUsePass(const bool &defaultValue = QVariant().toBool());
64  static void setUsePass(const bool &usePass);
65 
66  static int getClipBoardTypeRaw(
67  const Enums::clipBoardType &defaultvalue = Enums::CLIPBOARD_NEVER);
69  const Enums::clipBoardType &defaultvalue = Enums::CLIPBOARD_NEVER);
70  static void setClipBoardType(const int &clipBoardType);
71 
72  static bool isUseSelection(const bool &defaultValue = QVariant().toBool());
73  static void setUseSelection(const bool &useSelection);
74 
75  static bool isUseAutoclear(const bool &defaultValue = QVariant().toBool());
76  static void setUseAutoclear(const bool &useAutoclear);
77 
78  static int getAutoclearSeconds(const int &defaultValue = QVariant().toInt());
79  static void setAutoclearSeconds(const int &autoClearSeconds);
80 
81  static bool
82  isUseAutoclearPanel(const bool &defaultValue = QVariant().toBool());
83  static void setUseAutoclearPanel(const bool &useAutoclearPanel);
84 
85  static int
86  getAutoclearPanelSeconds(const int &defaultValue = QVariant().toInt());
87  static void setAutoclearPanelSeconds(const int &autoClearPanelSeconds);
88 
89  static bool isHidePassword(const bool &defaultValue = QVariant().toBool());
90  static void setHidePassword(const bool &hidePassword);
91 
92  static bool isHideContent(const bool &defaultValue = QVariant().toBool());
93  static void setHideContent(const bool &hideContent);
94 
95  static bool isAddGPGId(const bool &defaultValue = QVariant().toBool());
96  static void setAddGPGId(const bool &addGPGId);
97 
98  static QString
99  getPassStore(const QString &defaultValue = QVariant().toString());
100  static void setPassStore(const QString &passStore);
101 
102  static void initExecutables();
103  static QString
104  getPassExecutable(const QString &defaultValue = QVariant().toString());
105  static void setPassExecutable(const QString &passExecutable);
106 
107  static QString
108  getGitExecutable(const QString &defaultValue = QVariant().toString());
109  static void setGitExecutable(const QString &gitExecutable);
110 
111  static QString
112  getGpgExecutable(const QString &defaultValue = QVariant().toString());
113  static void setGpgExecutable(const QString &gpgExecutable);
114 
115  static QString
116  getPwgenExecutable(const QString &defaultValue = QVariant().toString());
117  static void setPwgenExecutable(const QString &pwgenExecutable);
118 
119  static QString
120  getGpgHome(const QString &defaultValue = QVariant().toString());
121 
122  static bool isUseWebDav(const bool &defaultValue = QVariant().toBool());
123  static void setUseWebDav(const bool &useWebDav);
124 
125  static QString
126  getWebDavUrl(const QString &defaultValue = QVariant().toString());
127  static void setWebDavUrl(const QString &webDavUrl);
128 
129  static QString
130  getWebDavUser(const QString &defaultValue = QVariant().toString());
131  static void setWebDavUser(const QString &webDavUser);
132 
133  static QString
134  getWebDavPassword(const QString &defaultValue = QVariant().toString());
135  static void setWebDavPassword(const QString &webDavPassword);
136 
137  static QString
138  getProfile(const QString &defaultValue = QVariant().toString());
139  static void setProfile(const QString &profile);
140 
141  static bool isUseGit(const bool &defaultValue = QVariant().toBool());
142  static void setUseGit(const bool &useGit);
143 
144  static bool isUseOtp(const bool &defaultValue = QVariant().toBool());
145  static void setUseOtp(const bool &useOtp);
146 
147  static bool isUsePwgen(const bool &defaultValue = QVariant().toBool());
148  static void setUsePwgen(const bool &usePwgen);
149 
150  static bool isAvoidCapitals(const bool &defaultValue = QVariant().toBool());
151  static void setAvoidCapitals(const bool &avoidCapitals);
152 
153  static bool isAvoidNumbers(const bool &defaultValue = QVariant().toBool());
154  static void setAvoidNumbers(const bool &avoidNumbers);
155 
156  static bool isLessRandom(const bool &defaultValue = QVariant().toBool());
157  static void setLessRandom(const bool &lessRandom);
158 
159  static bool isUseSymbols(const bool &defaultValue = QVariant().toBool());
160  static void setUseSymbols(const bool &useSymbols);
161 
163  static void setPasswordConfiguration(const PasswordConfiguration &config);
164  static void setPasswordLength(const int &passwordLength);
165  static void setPasswordCharsselection(const int &passwordCharsselection);
166  static void setPasswordChars(const QString &passwordChars);
167 
168  static bool isUseTrayIcon(const bool &defaultValue = QVariant().toBool());
169  static void setUseTrayIcon(const bool &useTrayIcon);
170 
171  static bool isHideOnClose(const bool &defaultValue = QVariant().toBool());
172  static void setHideOnClose(const bool &hideOnClose);
173 
174  static bool isStartMinimized(const bool &defaultValue = QVariant().toBool());
175  static void setStartMinimized(const bool &startMinimized);
176 
177  static bool isAlwaysOnTop(const bool &defaultValue = QVariant().toBool());
178  static void setAlwaysOnTop(const bool &alwaysOnTop);
179 
180  static bool isAutoPull(const bool &defaultValue = QVariant().toBool());
181  static void setAutoPull(const bool &autoPull);
182 
183  static bool isAutoPush(const bool &defaultValue = QVariant().toBool());
184  static void setAutoPush(const bool &autoPush);
185 
186  static QString
187  getPassTemplate(const QString &defaultValue = QVariant().toString());
188  static void setPassTemplate(const QString &passTemplate);
189 
190  static bool isUseTemplate(const bool &defaultValue = QVariant().toBool());
191  static void setUseTemplate(const bool &useTemplate);
192 
193  static bool
194  isTemplateAllFields(const bool &defaultValue = QVariant().toBool());
195  static void setTemplateAllFields(const bool &templateAllFields);
196 
197  static QHash<QString, QString> getProfiles();
198  static void setProfiles(const QHash<QString, QString> &profiles);
199 
200  static Pass *getPass();
201  static RealPass *getRealPass();
202  static ImitatePass *getImitatePass();
203 };
204 
205 #endif // QTPASSSETTINGS_H
static void setPwgenExecutable(const QString &pwgenExecutable)
static void setAutoclearSeconds(const int &autoClearSeconds)
static int getAutoclearSeconds(const int &defaultValue=QVariant().toInt())
static void setUsePwgen(const bool &usePwgen)
static bool isStartMinimized(const bool &defaultValue=QVariant().toBool())
static bool isMaximized(const bool &defaultValue=QVariant().toBool())
static void setUsePass(const bool &usePass)
static bool isLessRandom(const bool &defaultValue=QVariant().toBool())
static void setPassExecutable(const QString &passExecutable)
static QString getGpgHome(const QString &defaultValue=QVariant().toString())
static bool isAlwaysOnTop(const bool &defaultValue=QVariant().toBool())
static QPoint getPos(const QPoint &defaultValue=QVariant().toPoint())
static void setWebDavPassword(const QString &webDavPassword)
Holds the Password configuration settings.
static void setPasswordChars(const QString &passwordChars)
static void setAutoPush(const bool &autoPush)
static void setGitExecutable(const QString &gitExecutable)
static void setAlwaysOnTop(const bool &alwaysOnTop)
static bool isUseSelection(const bool &defaultValue=QVariant().toBool())
static void setPassTemplate(const QString &passTemplate)
static void setUseGit(const bool &useGit)
static void setPos(const QPoint &pos)
static bool isAvoidNumbers(const bool &defaultValue=QVariant().toBool())
static ImitatePass * getImitatePass()
static void setPasswordConfiguration(const PasswordConfiguration &config)
static void setHideContent(const bool &hideContent)
static bool isUseAutoclearPanel(const bool &defaultValue=QVariant().toBool())
static void setUseWebDav(const bool &useWebDav)
static bool isUseWebDav(const bool &defaultValue=QVariant().toBool())
static void setSize(const QSize &size)
static void setLessRandom(const bool &lessRandom)
static void setAutoPull(const bool &autoPull)
static bool isAddGPGId(const bool &defaultValue=QVariant().toBool())
static bool isUseAutoclear(const bool &defaultValue=QVariant().toBool())
Wrapper for executing pass to handle the password-store.
Definition: realpass.h:10
static bool isHideOnClose(const bool &defaultValue=QVariant().toBool())
static void setProfiles(const QHash< QString, QString > &profiles)
static bool isUseGit(const bool &defaultValue=QVariant().toBool())
Acts as an abstraction for pass or pass imitation.
Definition: pass.h:25
static QString getPassStore(const QString &defaultValue=QVariant().toString())
static void setProfile(const QString &profile)
static void setMaximized(const bool &maximized)
static QString getGitExecutable(const QString &defaultValue=QVariant().toString())
static void setAutoclearPanelSeconds(const int &autoClearPanelSeconds)
static void setUseAutoclearPanel(const bool &useAutoclearPanel)
clipBoardType
Definition: enums.h:10
static bool isUseTrayIcon(const bool &defaultValue=QVariant().toBool())
static bool isUseOtp(const bool &defaultValue=QVariant().toBool())
static void setAvoidNumbers(const bool &avoidNumbers)
static QString getPassExecutable(const QString &defaultValue=QVariant().toString())
static QString getVersion(const QString &defaultValue=QVariant().toString())
static void setHideOnClose(const bool &hideOnClose)
static bool isAvoidCapitals(const bool &defaultValue=QVariant().toBool())
static QByteArray getSavestate(const QByteArray &defaultValue=QVariant().toByteArray())
static QSize getSize(const QSize &defaultValue=QVariant().toSize())
static Pass * getPass()
static void setGpgExecutable(const QString &gpgExecutable)
static QString getWebDavUser(const QString &defaultValue=QVariant().toString())
Imitates pass features when pass is not enabled or available.
Definition: imitatepass.h:11
static void setStartMinimized(const bool &startMinimized)
static bool isUsePwgen(const bool &defaultValue=QVariant().toBool())
static void setSavestate(const QByteArray &saveState)
static void setUseAutoclear(const bool &useAutoclear)
static QString getPassTemplate(const QString &defaultValue=QVariant().toString())
static Enums::clipBoardType getClipBoardType(const Enums::clipBoardType &defaultvalue=Enums::CLIPBOARD_NEVER)
static QString getWebDavUrl(const QString &defaultValue=QVariant().toString())
static QString getPwgenExecutable(const QString &defaultValue=QVariant().toString())
static void setUseOtp(const bool &useOtp)
static bool isUseSymbols(const bool &defaultValue=QVariant().toBool())
static void setUseTemplate(const bool &useTemplate)
static QByteArray getGeometry(const QByteArray &defaultValue=QVariant().toByteArray())
static QtPassSettings * getInstance()
static void setPasswordCharsselection(const int &passwordCharsselection)
static int getAutoclearPanelSeconds(const int &defaultValue=QVariant().toInt())
static void setAddGPGId(const bool &addGPGId)
static QString getGpgExecutable(const QString &defaultValue=QVariant().toString())
static void setWebDavUrl(const QString &webDavUrl)
static bool isUseTemplate(const bool &defaultValue=QVariant().toBool())
static QString getWebDavPassword(const QString &defaultValue=QVariant().toString())
static bool isTemplateAllFields(const bool &defaultValue=QVariant().toBool())
static void setUseSymbols(const bool &useSymbols)
Singleton that stores qtpass&#39; settings, saves and loads config.
static void initExecutables()
static void setTemplateAllFields(const bool &templateAllFields)
static QHash< QString, QString > getProfiles()
static void setUseTrayIcon(const bool &useTrayIcon)
static PasswordConfiguration getPasswordConfiguration()
static void setGeometry(const QByteArray &geometry)
static void setClipBoardType(const int &clipBoardType)
static RealPass * getRealPass()
static bool isHidePassword(const bool &defaultValue=QVariant().toBool())
static bool isHideContent(const bool &defaultValue=QVariant().toBool())
static QString getProfile(const QString &defaultValue=QVariant().toString())
static void setWebDavUser(const QString &webDavUser)
static void setVersion(const QString &version)
static void setHidePassword(const bool &hidePassword)
static void setPassStore(const QString &passStore)
static void setUseSelection(const bool &useSelection)
static void setPasswordLength(const int &passwordLength)
static bool isAutoPull(const bool &defaultValue=QVariant().toBool())
static bool isUsePass(const bool &defaultValue=QVariant().toBool())
static bool isAutoPush(const bool &defaultValue=QVariant().toBool())
static int getClipBoardTypeRaw(const Enums::clipBoardType &defaultvalue=Enums::CLIPBOARD_NEVER)
static void setAvoidCapitals(const bool &avoidCapitals)