2
pinentrydialog.h - A (not yet) secure Qt 4 dialog for PIN entry.
4
Copyright (C) 2002, 2008 Klar�lvdalens Datakonsult AB (KDAB)
5
Copyright 2007 Ingo Klöcker
7
Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>.
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License as
11
published by the Free Software Foundation; either version 2 of the
12
License, or (at your option) any later version.
14
This program is distributed in the hope that it will be useful, but
15
WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17
General Public License for more details.
19
You should have received a copy of the GNU General Public License
20
along with this program; if not, write to the Free Software
21
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24
#ifndef __PINENTRYDIALOG_H__
25
#define __PINENTRYDIALOG_H__
27
#include <QProgressBar>
30
#include "secstring.h"
35
class QSecureLineEdit;
40
class PinEntryDialog : public QDialog {
43
Q_PROPERTY( QString description READ description WRITE setDescription )
44
Q_PROPERTY( QString error READ error WRITE setError )
45
Q_PROPERTY( secqstring pin READ pin WRITE setPin )
46
Q_PROPERTY( QString prompt READ prompt WRITE setPrompt )
48
friend class PinEntryController; // TODO: remove when assuan lets me use Qt eventloop.
49
explicit PinEntryDialog( QWidget* parent = 0, const char* name = 0, bool modal = false, bool enable_quality_bar = false );
51
void setDescription( const QString& );
52
QString description() const;
54
void setError( const QString& );
55
QString error() const;
57
void setPin( const secqstring & );
58
secqstring pin() const;
60
void setPrompt( const QString& );
61
QString prompt() const;
63
void setOkText( const QString& );
64
void setCancelText( const QString& );
66
void setQualityBar( const QString& );
67
void setQualityBarTT( const QString& );
69
void setPinentryInfo (pinentry_t);
72
void updateQuality(const secqstring&);
79
/* reimp */ void keyPressEvent( QKeyEvent *e );
80
/* reimp */ void hideEvent( QHideEvent* );
81
/* reimp */ void paintEvent( QPaintEvent* event );
88
QLabel* _quality_bar_label;
89
QProgressBar* _quality_bar;
90
QSecureLineEdit* _edit;
94
bool _have_quality_bar;
95
pinentry_t _pinentry_info;
98
#endif // __PINENTRYDIALOG_H__