File indexing completed on 2023-10-03 07:58:48

0001 /*************************************************************************************
0002  *  Copyright (C) 2013 by Alejandro Fiestas Olivares <afiestas@kde.org>              *
0003  *                                                                                   *
0004  *  This program is free software; you can redistribute it and/or                    *
0005  *  modify it under the terms of the GNU General Public License                      *
0006  *  as published by the Free Software Foundation; either version 2                   *
0007  *  of the License, or (at your option) any later version.                           *
0008  *                                                                                   *
0009  *  This program is distributed in the hope that it will be useful,                  *
0010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of                   *
0011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                    *
0012  *  GNU General Public License for more details.                                     *
0013  *                                                                                   *
0014  *  You should have received a copy of the GNU General Public License                *
0015  *  along with this program; if not, write to the Free Software                      *
0016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA   *
0017  *************************************************************************************/
0018 
0019 #ifndef KEYRING_SECRETS_STORAGE_H
0020 #define KEYRING_SECRETS_STORAGE_H
0021 
0022 #include <SignOn/AbstractSecretsStorage>
0023 
0024 #include <QByteArray>
0025 #include <QObject>
0026 
0027 namespace KWallet {
0028     class Wallet;
0029 }
0030 class SecretsStorage: public SignOn::AbstractSecretsStorage
0031 {
0032     Q_OBJECT
0033 
0034 public:
0035     explicit SecretsStorage(QObject *parent = nullptr);
0036     ~SecretsStorage() override;
0037 
0038     bool initialize(const QVariantMap& configuration) override;
0039     bool close() override;
0040     bool clear() override;
0041 
0042     bool updateCredentials(const quint32 id, const QString& username, const QString& password) override;
0043     bool removeCredentials(const quint32 id) override;
0044     bool loadCredentials(const quint32 id, QString& username, QString& password) override;
0045 
0046     QVariantMap loadData(quint32 id, quint32 method) override;
0047     bool storeData(quint32 id, quint32 method, const QVariantMap& data) override;
0048     bool removeData(quint32 id, quint32 method) override;
0049 
0050 
0051     QByteArray m_keyringName;
0052     KWallet::Wallet* m_wallet;
0053 };
0054 
0055 #endif // KEYRING_SECRETS_STORAGE_H