File indexing completed on 2024-04-21 04:55:26

0001 /*
0002     This file is part of Choqok, the KDE micro-blogging client
0003 
0004     SPDX-FileCopyrightText: 2008-2012 Mehrdad Momeny <mehrdad.momeny@gmail.com>
0005 
0006     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0007 */
0008 
0009 #ifndef PASSWORDMANAGER_H
0010 #define PASSWORDMANAGER_H
0011 
0012 #include <QObject>
0013 
0014 #include "choqok_export.h"
0015 
0016 namespace Choqok
0017 {
0018 /**
0019 @brief Singleton class to manage passwords
0020 Read: @ref readPassword()
0021 Write: @ref writePassword()
0022 Remove: @ref removePassword()
0023 
0024 @author Mehrdad Momeny \<mehrdad.momeny@gmail.com\>
0025 */
0026 class CHOQOK_EXPORT PasswordManager : public QObject
0027 {
0028     Q_OBJECT
0029 public:
0030     ~PasswordManager();
0031     static PasswordManager *self();
0032     QString readPassword(const QString &alias);
0033     bool writePassword(const QString &alias, const QString &password);
0034     bool removePassword(const QString &alias);
0035 
0036 private:
0037     PasswordManager();
0038     class Private;
0039     Private *const d;
0040     static PasswordManager *mSelf;
0041 };
0042 }
0043 
0044 #endif