File indexing completed on 2024-12-22 04:40:56

0001 /* ============================================================
0002 * Falkon - Qt web browser
0003 * Copyright (C) 2013-2018 David Rosca <nowrep@gmail.com>
0004 *
0005 * This program is free software: you can redistribute it and/or modify
0006 * it under the terms of the GNU General Public License as published by
0007 * the Free Software Foundation, either version 3 of the License, or
0008 * (at your option) any later version.
0009 *
0010 * This program is distributed in the hope that it will be useful,
0011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013 * GNU General Public License for more details.
0014 *
0015 * You should have received a copy of the GNU General Public License
0016 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
0017 * ============================================================ */
0018 #ifndef PASSWORDBACKEND_H
0019 #define PASSWORDBACKEND_H
0020 
0021 #include "passwordmanager.h"
0022 #include "qzcommon.h"
0023 
0024 class QWidget;
0025 
0026 class FALKON_EXPORT PasswordBackend
0027 {
0028 public:
0029     explicit PasswordBackend();
0030     virtual ~PasswordBackend() = default;
0031 
0032     virtual QString name() const = 0;
0033 
0034     virtual QStringList getUsernames(const QUrl &url);
0035     virtual QVector<PasswordEntry> getEntries(const QUrl &url) = 0;
0036     virtual QVector<PasswordEntry> getAllEntries() = 0;
0037 
0038     virtual void addEntry(const PasswordEntry &entry) = 0;
0039     virtual bool updateEntry(const PasswordEntry &entry) = 0;
0040     virtual void updateLastUsed(PasswordEntry &entry) = 0;
0041 
0042     virtual void removeEntry(const PasswordEntry &entry) = 0;
0043     virtual void removeAll() = 0;
0044 
0045     virtual void setActive(bool active);
0046     bool isActive() const;
0047 
0048     virtual bool hasSettings() const;
0049     virtual void showSettings(QWidget* parent);
0050 
0051 private:
0052     bool m_active;
0053 };
0054 
0055 #endif // PASSWORDBACKEND_H