1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-22 11:46:34 +01:00
falkonOfficial/src/lib/autofill/autofill.h

85 lines
2.3 KiB
C
Raw Normal View History

2011-03-03 18:29:20 +01:00
/* ============================================================
* QupZilla - WebKit based browser
2016-05-11 11:09:50 +02:00
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com>
2011-03-03 18:29:20 +01:00
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */
#ifndef AUTOFILL_H
#define AUTOFILL_H
2011-03-02 16:57:41 +01:00
#include <QObject>
#include "qzcommon.h"
class QUrl;
class QWebEnginePage;
2011-03-02 16:57:41 +01:00
class WebPage;
class BrowserWindow;
class PasswordManager;
struct PageFormData;
struct PasswordEntry;
struct PageFormData {
QString username;
QString password;
QByteArray postData;
bool isValid() const {
return !password.isEmpty();
}
};
class QUPZILLA_EXPORT AutoFill : public QObject
2011-03-02 16:57:41 +01:00
{
Q_OBJECT
2011-03-02 16:57:41 +01:00
public:
explicit AutoFill(QObject* parent = 0);
PasswordManager* passwordManager() const;
void loadSettings();
2011-03-02 16:57:41 +01:00
bool isStored(const QUrl &url);
bool isStoringEnabled(const QUrl &url);
void blockStoringforUrl(const QUrl &url);
2011-03-02 16:57:41 +01:00
QVector<PasswordEntry> getFormData(const QUrl &url);
QVector<PasswordEntry> getAllFormData();
void updateLastUsed(PasswordEntry &data);
void addEntry(const QUrl &url, const QString &name, const QString &pass);
void addEntry(const QUrl &url, const PageFormData &formData);
2011-03-02 16:57:41 +01:00
void updateEntry(const QUrl &url, const QString &name, const QString &pass);
bool updateEntry(const PasswordEntry &entry);
void removeEntry(const PasswordEntry &entry);
void removeAllEntries();
void saveForm(WebPage *page, const QUrl &frameUrl, const PageFormData &formData);
2016-05-11 11:09:50 +02:00
QVector<PasswordEntry> completePage(WebPage *page, const QUrl &frameUrl);
2011-03-02 16:57:41 +01:00
QByteArray exportPasswords();
bool importPasswords(const QByteArray &data);
2011-03-02 16:57:41 +01:00
private:
PasswordManager* m_manager;
2011-03-02 16:57:41 +01:00
bool m_isStoring;
};
#endif // AUTOFILL_H