7#ifndef _KWALLETFREEDESKTOPCOLLECTION_H_
8#define _KWALLETFREEDESKTOPCOLLECTION_H_
9#include "kwalletfreedesktopattributes.h"
10#include "kwalletfreedesktopservice.h"
12#define FDO_SECRETS_COLLECTION_PATH FDO_SECRETS_SERVICE_OBJECT "/collection/"
13#define FDO_SECRETS_DEFAULT_DIR "Secret Service"
14#define FDO_KEY_MODIFIED QStringLiteral("$fdo_modified")
15#define FDO_KEY_CREATED QStringLiteral("$fdo_created")
16#define FDO_KEY_MIME QStringLiteral("$fdo_mime_type")
17#define FDO_KEY_XDG_SCHEMA QStringLiteral("xdg:schema")
19class KWalletFreedesktopItem;
26 qulonglong created()
const;
29 qulonglong modified()
const;
36 void setLabel(
const QString &value);
44 KWalletFreedesktopCollection(KWalletFreedesktopService *service,
int handle,
const QString &walletName,
QDBusObjectPath objectPath);
46 KWalletFreedesktopCollection(
const KWalletFreedesktopCollection &) =
delete;
47 KWalletFreedesktopCollection &operator=(
const KWalletFreedesktopCollection &) =
delete;
49 KWalletFreedesktopCollection(KWalletFreedesktopCollection &&) =
delete;
50 KWalletFreedesktopCollection &&operator=(KWalletFreedesktopCollection &&) =
delete;
52 EntryLocation makeUniqueEntryLocation(
const QString &label);
53 FdoUniqueLabel makeUniqueItemLabel(
const QString &label);
57 KWalletFreedesktopService *fdoService()
const;
58 KWalletD *backend()
const;
60 const FdoUniqueLabel &uniqueLabel()
const;
62 int walletHandle()
const;
64 KWalletFreedesktopItem *getItemByObjectPath(
const QString &objectPath)
const;
65 KWalletFreedesktopItem *findItemByEntryLocation(
const EntryLocation &entryLocation)
const;
66 KWalletFreedesktopItem &pushNewItem(FdoUniqueLabel label,
const QDBusObjectPath &path);
67 KWalletFreedesktopAttributes &itemAttributes();
68 const KWalletFreedesktopAttributes &itemAttributes()
const;
71 void onWalletChangeState(
int handle);
75 void onPropertiesChanged(
const QVariantMap &properties);
81 KWalletFreedesktopService *m_service;
83 FdoUniqueLabel m_uniqueLabel;
85 KWalletFreedesktopAttributes m_itemAttribs;
86 std::map<QString, std::unique_ptr<KWalletFreedesktopItem>> m_items;
87 uint64_t m_itemCounter = 0;