KWallet
9#include <QDBusObjectPath>
12#include <libsecret/secret.h>
18struct GObjectDeleter {
20 void operator()(T *obj)
const
29using GObjectPtr = std::unique_ptr<T, GObjectDeleter>;
30using SecretServicePtr = GObjectPtr<SecretService>;
31using SecretCollectionPtr = GObjectPtr<SecretCollection>;
32using SecretItemPtr = GObjectPtr<SecretItem>;
34class SecretServiceClient :
public QObject
50 bool useKSecretBackend()
const;
51 bool isAvailable()
const;
53 bool unlockCollection(
const QString &collectionName,
bool *ok);
55 QString defaultCollection(
bool *ok);
56 void setDefaultCollection(
const QString &collectionName,
bool *ok);
57 QStringList listCollections(
bool *ok);
58 QStringList listFolders(
const QString &collectionName,
bool *ok);
60 QStringList listEntries(
const QString &folder,
const QString &collectionName,
bool *ok);
62 QHash<QString, QString> readMetadata(
const QString &key,
const QString &folder,
const QString &collectionName,
bool *ok);
64 void createCollection(
const QString &collectionName,
bool *ok);
66 void deleteCollection(
const QString &collectionName,
bool *ok);
68 void deleteFolder(
const QString &folder,
const QString &collectionName,
bool *ok);
70 QByteArray readEntry(
const QString &key,
const Type type,
const QString &folder,
const QString &collectionName,
bool *ok);
72 void renameEntry(
const QString &display_name,
const QString &oldKey,
const QString &newKey,
const QString &folder,
const QString &collectionName,
bool *ok);
74 void writeEntry(
const QString &itemName,
76 const QByteArray &value,
77 const SecretServiceClient::Type type,
78 const QString &folder,
79 const QString &collectionName,
82 void deleteEntry(
const QString &key,
const QString &folder,
const QString &collectionName,
bool *ok);
86 void serviceChanged();
87 void promptClosed(
bool accepted);
88 void collectionListDirty();
89 void collectionDirty(
const QString &collection);
90 void collectionCreated(
const QString &collection);
91 void collectionDeleted(
const QString &collection);
94 bool attemptConnection();
95 void watchCollection(
const QString &collectionName,
bool *ok);
96 void onServiceOwnerChanged(
const QString &serviceName,
const QString &oldOwner,
const QString &newOwner);
98 QString collectionLabelForPath(
const QDBusObjectPath &path);
99 SecretCollection *retrieveCollection(
const QString &name);
100 SecretItemPtr retrieveItem(
const QString &key,
const SecretServiceClient::Type type,
const QString &folder,
const QString &collectionName,
bool *ok);
103 void handlePrompt(
bool dismissed);
104 void onCollectionCreated(
const QDBusObjectPath &path);
105 void onCollectionDeleted(
const QDBusObjectPath &path);
106 void onSecretItemChanged(
const QDBusObjectPath &path);
109 SecretServicePtr m_service;
110 std::map<QString, SecretCollectionPtr> m_openCollections;
111 QDBusServiceWatcher *m_serviceWatcher;
112 QSet<QString> m_watchedCollections;
113 QSet<QString> m_dirtyCollections;
114 QTimer *m_collectionDirtyTimer;
115 QString m_serviceBusName;
116 bool m_useKSecretBackend =
false;
117 bool m_updateInProgress =
false;
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Apr 25 2025 11:53:00 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.