keepassxc/src/gui/DatabaseOpenWidget.h

76 lines
1.9 KiB
C++
Raw Normal View History

2011-11-13 14:55:20 +01:00
/*
* Copyright (C) 2011 Felix Geyer <debfx@fobos.de>
*
* 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 2 or (at your option)
* version 3 of the License.
*
* 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 KEEPASSX_DATABASEOPENWIDGET_H
#define KEEPASSX_DATABASEOPENWIDGET_H
2011-11-13 14:55:20 +01:00
#include <QScopedPointer>
#include "gui/DialogyWidget.h"
2012-10-12 12:12:00 +02:00
#include "keys/CompositeKey.h"
2011-11-13 14:55:20 +01:00
class Database;
class QFile;
2011-11-13 14:55:20 +01:00
namespace Ui {
class DatabaseOpenWidget;
2011-11-13 14:55:20 +01:00
}
class DatabaseOpenWidget : public DialogyWidget
2011-11-13 14:55:20 +01:00
{
Q_OBJECT
public:
2015-07-24 18:28:12 +02:00
explicit DatabaseOpenWidget(QWidget* parent = nullptr);
~DatabaseOpenWidget();
2012-07-06 18:50:52 +02:00
void load(const QString& filename);
void enterKey(const QString& pw, const QString& keyFile);
Database* database();
public slots:
void pollYubikey();
signals:
void editFinished(bool accepted);
2011-11-13 14:55:20 +01:00
2012-10-12 12:12:00 +02:00
protected:
void showEvent(QShowEvent* event) override;
2012-10-12 12:12:00 +02:00
CompositeKey databaseKey();
protected slots:
virtual void openDatabase();
void reject();
private slots:
void activatePassword();
void activateKeyFile();
void activateChallengeResponse();
void browseKeyFile();
void yubikeyDetected(int slot, bool blocking);
void noYubikeyFound();
2011-11-13 14:55:20 +01:00
protected:
const QScopedPointer<Ui::DatabaseOpenWidget> m_ui;
Database* m_db;
QString m_filename;
2011-11-13 14:55:20 +01:00
private:
Q_DISABLE_COPY(DatabaseOpenWidget)
2011-11-13 14:55:20 +01:00
};
#endif // KEEPASSX_DATABASEOPENWIDGET_H