KWallet

kwalletfreedesktopattributes.h
1/*
2 This file is part of the KDE libraries
3 SPDX-FileCopyrightText: 2021 Slava Aseev <nullptrnine@basealt.ru>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7#ifndef _KWALLETFREEDESKTOPATTRIBUTES_H_
8#define _KWALLETFREEDESKTOPATTRIBUTES_H_
9
10#include "kwalletfreedesktopservice.h"
11#include <QJsonObject>
12
13class KWalletFreedesktopAttributes : public QObject
14{
15public:
16 KWalletFreedesktopAttributes(const QString &walletName);
17
18 void read();
19 void write();
20 void remove(const EntryLocation &entryLocation);
21 void remove(const FdoUniqueLabel &itemUniqLabel);
22 void renameLabel(const EntryLocation &oldLocation, const EntryLocation &newLocation);
23 void deleteFile();
24 void renameWallet(const QString &newName);
25 void newItem(const EntryLocation &entryLocation);
26
27 QList<EntryLocation> matchAttributes(const StrStrMap &attributes) const;
28 void setAttributes(const EntryLocation &entryLocation, const StrStrMap &attributes);
29 StrStrMap getAttributes(const EntryLocation &entryLocation) const;
30
31 void setAttributes(const FdoUniqueLabel &itemUniqLabel, const StrStrMap &attributes);
32 StrStrMap getAttributes(const FdoUniqueLabel &itemUniqLabel) const;
33
34 QString getStringParam(const EntryLocation &entryLocation, const QString &paramName, const QString &defaultParam) const;
35 qulonglong getULongLongParam(const EntryLocation &entryLocation, const QString &paramName, qulonglong defaultParam) const;
36
37 QString getStringParam(const FdoUniqueLabel &itemUniqLabel, const QString &paramName, const QString &defaultParam) const;
38 qulonglong getULongLongParam(const FdoUniqueLabel &itemUniqLabel, const QString &paramName, qulonglong defaultParam) const;
39
40 void setParam(const EntryLocation &entryLocation, const QString &paramName, const QString &param);
41 void setParam(const EntryLocation &entryLocation, const QString &paramName, qulonglong param);
42
43 void setParam(const FdoUniqueLabel &itemUniqLabel, const QString &paramName, const QString &param);
44 void setParam(const FdoUniqueLabel &itemUniqLabel, const QString &paramName, qulonglong param);
45
46 qulonglong lastModified() const;
47 qulonglong birthTime() const;
48 void updateLastModified();
49
50 QList<EntryLocation> listItems() const;
51
52private:
53 QString _path;
54 QJsonObject _params;
55};
56
57#endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:16:05 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.