12#include "kwalletbackend.h"
13#include <QDBusConnection>
14#include <QDBusContext>
15#include <QDBusServiceWatcher>
21#include "kwalletsessionstore.h"
27class KWalletTransaction;
28class KWalletSessionStore;
29class KWalletFreedesktopService;
39 static QString encodeWalletName(
const QString &name);
40 static QString decodeWalletName(
const QString &mangledName);
42 int nextTransactionId()
const;
44 openAsync(
const QString &wallet, qlonglong wId,
const QString &appid,
bool handleSession,
const QDBusConnection &
connection,
const QDBusMessage &
message);
47 int close(
int handle,
bool force,
const QString &appid,
const QDBusMessage &
message);
51 bool isEnabled()
const;
54 int open(
const QString &wallet, qlonglong wId,
const QString &appid);
57 int openPath(
const QString &path, qlonglong wId,
const QString &appid);
60 int openAsync(
const QString &wallet, qlonglong wId,
const QString &appid,
bool handleSession);
63 int openPathAsync(
const QString &path, qlonglong wId,
const QString &appid,
bool handleSession);
69 int close(
const QString &wallet,
bool force);
70 int close(
int handle,
bool force,
const QString &appid);
73 Q_NOREPLY
void sync(
int handle,
const QString &appid);
76 int deleteWallet(
const QString &wallet);
79 bool isOpen(
const QString &wallet);
80 bool isOpen(
int handle);
83 QStringList users(
const QString &wallet)
const;
86 void changePassword(
const QString &wallet, qlonglong wId,
const QString &appid);
89 QStringList wallets()
const;
92 QStringList folderList(
int handle,
const QString &appid);
95 bool hasFolder(
int handle,
const QString &folder,
const QString &appid);
98 bool createFolder(
int handle,
const QString &folder,
const QString &appid);
101 bool removeFolder(
int handle,
const QString &folder,
const QString &appid);
104 QStringList entryList(
int handle,
const QString &folder,
const QString &appid);
109 QByteArray readEntry(
int handle,
const QString &folder,
const QString &key,
const QString &appid);
110 QByteArray readMap(
int handle,
const QString &folder,
const QString &key,
const QString &appid);
111 QString readPassword(
int handle,
const QString &folder,
const QString &key,
const QString &appid);
113#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72)
115 QVariantMap readEntryList(
int handle,
const QString &folder,
const QString &key,
const QString &appid);
118#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72)
120 QVariantMap readMapList(
int handle,
const QString &folder,
const QString &key,
const QString &appid);
123#if KWALLET_BUILD_DEPRECATED_SINCE(5, 72)
125 QVariantMap readPasswordList(
int handle,
const QString &folder,
const QString &key,
const QString &appid);
128 QVariantMap entriesList(
int handle,
const QString &folder,
const QString &appid);
129 QVariantMap mapList(
int handle,
const QString &folder,
const QString &appid);
130 QVariantMap passwordList(
int handle,
const QString &folder,
const QString &appid);
133 int renameEntry(
int handle,
const QString &folder,
const QString &oldName,
const QString &newName,
const QString &appid);
135 int renameWallet(
const QString &oldName,
const QString &newName);
138 int writeEntry(
int handle,
const QString &folder,
const QString &key,
const QByteArray &value,
int entryType,
const QString &appid);
139 int writeEntry(
int handle,
const QString &folder,
const QString &key,
const QByteArray &value,
const QString &appid);
140 int writeMap(
int handle,
const QString &folder,
const QString &key,
const QByteArray &value,
const QString &appid);
141 int writePassword(
int handle,
const QString &folder,
const QString &key,
const QString &value,
const QString &appid);
144 bool hasEntry(
int handle,
const QString &folder,
const QString &key,
const QString &appid);
147 int entryType(
int handle,
const QString &folder,
const QString &key,
const QString &appid);
150 int removeEntry(
int handle,
const QString &folder,
const QString &key,
const QString &appid);
153 bool disconnectApplication(
const QString &wallet,
const QString &application);
158 bool folderDoesNotExist(
const QString &wallet,
const QString &folder);
159 bool keyDoesNotExist(
const QString &wallet,
const QString &folder,
const QString &key);
161 void closeAllWallets();
163 QString networkWallet();
165 QString localWallet();
167 void screenSaverChanged(
bool);
172 int pamOpen(
const QString &wallet,
const QByteArray &passwordHash,
int sessionTimeout);
175 void walletAsyncOpened(
int id,
int handle);
176 void walletListDirty();
177 void walletCreated(
const QString &wallet);
178 void walletOpened(
const QString &wallet);
179 void walletDeleted(
const QString &wallet);
180 void walletClosed(
const QString &wallet);
183 void walletClosed(
int handle);
186 void walletClosedId(
int handle);
188 void allWalletsClosed();
189 void folderListUpdated(
const QString &wallet);
190 void folderUpdated(
const QString &,
const QString &);
191 void entryUpdated(
const QString &,
const QString &,
const QString &);
192 void entryRenamed(
const QString &,
const QString &,
const QString &,
const QString &);
193 void entryDeleted(
const QString &,
const QString &,
const QString &);
194 void applicationDisconnected(
const QString &wallet,
const QString &application);
197 void slotServiceOwnerChanged(
const QString &name,
const QString &oldOwner,
const QString &newOwner);
198 void emitWalletListDirty();
199 void timedOutClose(
int handle);
200 void timedOutSync(
int handle);
201 void notifyFailures();
202 void processTransactions();
203 void activatePasswordDialog();
205 void connectToScreenSaver();
210 int internalOpen(
const QString &appid,
const QString &wallet,
bool isPath, WId w,
bool modal,
const QString &service);
212 int internalClose(KWallet::Backend *
const w,
const int handle,
const bool force,
const bool saveBeforeClose =
true);
214 bool isAuthorizedApp(
const QString &appid,
const QString &wallet, WId w);
216 KWallet::Backend *getWallet(
const QString &appid,
int handle);
218 int generateHandle();
220 void doCloseSignals(
int,
const QString &);
221 void emitFolderUpdated(
const QString &,
const QString &);
222 void emitEntryUpdated(
const QString &,
const QString &,
const QString &);
223 void emitEntryRenamed(
const QString &,
const QString &,
const QString &,
const QString &);
224 void emitEntryDeleted(
const QString &,
const QString &,
const QString &);
226 bool implicitAllow(
const QString &wallet,
const QString &app);
227 bool implicitDeny(
const QString &wallet,
const QString &app);
229 void doTransactionChangePassword(
const QString &appid,
const QString &wallet, qlonglong wId);
230 void doTransactionOpenCancelled(
const QString &appid,
const QString &wallet,
const QString &service);
231 int doTransactionOpen(
const QString &appid,
const QString &wallet,
bool isPath, qlonglong wId,
bool modal,
const QString &service);
232 void initiateSync(
int handle);
234 void setupDialog(QWidget *dialog, WId wId,
const QString &appid,
bool modal);
235 void checkActiveDialog();
237 QPair<int, KWallet::Backend *> findWallet(
const QString &walletName)
const;
239 typedef QHash<int, KWallet::Backend *> Wallets;
245 bool _leaveOpen, _closeIdle, _launchManager, _enabled;
246 bool _openPrompt, _firstUse, _showingFailureNotify;
248 QMap<QString, QStringList> _implicitAllowMap, _implicitDenyMap;
249 KTimeout _closeTimers;
250 KTimeout _syncTimers;
252 static bool _processing;
254 KWalletTransaction *_curtrans;
255 QList<KWalletTransaction *> _transactions;
256 QPointer<QWidget> activeDialog;
259 QDBusInterface *screensaver;
263 KWalletSessionStore _sessions;
264 QDBusServiceWatcher _serviceWatcher;
266 std::unique_ptr<KWalletFreedesktopService> _fdoService;
QDBusConnection connection() const const
const QDBusMessage & message() const const