KWallet

kwalletsessionstore.h
1/*
2 This file is part of the KDE Wallet Daemon
3 SPDX-FileCopyrightText: 2008 Michael Leupold <lemma@confuego.org>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6*/
7
8#ifndef _KWALLETSESSIONSTORE_H_
9#define _KWALLETSESSIONSTORE_H_
10
11#include <QHash>
12#include <QList>
13#include <QPair>
14#include <QString>
15#include <QStringList>
16
17typedef QPair<QString, int> KWalletAppHandlePair;
18
19class KWalletSessionStore
20{
21public:
22 KWalletSessionStore();
23 ~KWalletSessionStore();
24
25 KWalletSessionStore(const KWalletSessionStore &) = delete;
26 KWalletSessionStore &operator=(const KWalletSessionStore &) = delete;
27
28 // add a new session
29 void addSession(const QString &appid, const QString &service, int handle);
30 // check if the application has a session using that handle
31 bool hasSession(const QString &appid, int handle = -1) const;
32 // find all sessions a service has
33 QList<KWalletAppHandlePair> findSessions(const QString &service) const;
34 // remove a specific session
35 bool removeSession(const QString &appid, const QString &service, int handle);
36 // remove all sessions an application has to a specific handle
37 int removeAllSessions(const QString &appid, int handle);
38 // remove all sessions related to a handle
39 int removeAllSessions(int handle);
40 // get all applications using a handle
41 QStringList getApplications(int handle) const;
42
43private:
44 class Session;
45 QHash<QString, QList<Session *>> m_sessions; // appid => session
46};
47
48#endif // _KWALLETSESSIONSTORE_H_
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:12:12 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.