~logan/ubuntu/trusty/pinentry/0.8.3-1ubuntu1

« back to all changes in this revision

Viewing changes to qt4/pinentrydialog.h

  • Committer: Bazaar Package Importer
  • Author(s): Artur Rona
  • Date: 2009-06-24 14:05:14 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140514-sw1bmaalt6bydgmk
Tags: 0.7.6-0ubuntu1
* New upstream release (LP: #390895).
* debian/patches/gmalloc-prototypes.patch: Removed, fixed upstream.
* debian/patches/keyboard-race.patch: updated.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
   pinentrydialog.h - A (not yet) secure Qt 4 dialog for PIN entry.
 
3
 
 
4
   Copyright (C) 2002, 2008 Klar�lvdalens Datakonsult AB (KDAB)
 
5
   Copyright 2007 Ingo Klöcker
 
6
 
 
7
   Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>.
 
8
 
 
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.
 
13
 
 
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.
 
18
 
 
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.
 
22
*/
 
23
 
 
24
#ifndef __PINENTRYDIALOG_H__
 
25
#define __PINENTRYDIALOG_H__
 
26
 
 
27
#include <QProgressBar>
 
28
#include <QDialog>
 
29
 
 
30
#include "secstring.h"
 
31
#include "pinentry.h"
 
32
 
 
33
class QLabel;
 
34
class QPushButton;
 
35
class QSecureLineEdit;
 
36
class QString;
 
37
 
 
38
 
 
39
 
 
40
class PinEntryDialog : public QDialog {
 
41
  Q_OBJECT
 
42
 
 
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 )
 
47
public:
 
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 );
 
50
 
 
51
  void setDescription( const QString& );
 
52
  QString description() const;
 
53
 
 
54
  void setError( const QString& );
 
55
  QString error() const;
 
56
 
 
57
  void setPin( const secqstring & );
 
58
  secqstring pin() const;
 
59
 
 
60
  void setPrompt( const QString& );
 
61
  QString prompt() const;
 
62
 
 
63
  void setOkText( const QString& );
 
64
  void setCancelText( const QString& );
 
65
 
 
66
  void setQualityBar( const QString& );
 
67
  void setQualityBarTT( const QString& );
 
68
 
 
69
  void setPinentryInfo (pinentry_t);
 
70
 
 
71
public slots:
 
72
  void updateQuality(const secqstring&);
 
73
 
 
74
signals:
 
75
  void accepted();
 
76
  void rejected();
 
77
 
 
78
protected:
 
79
  /* reimp */ void keyPressEvent( QKeyEvent *e );
 
80
  /* reimp */ void hideEvent( QHideEvent* );
 
81
  /* reimp */ void paintEvent( QPaintEvent* event );
 
82
 
 
83
private:
 
84
  QLabel*    _icon;
 
85
  QLabel*    _desc;
 
86
  QLabel*    _error;
 
87
  QLabel*    _prompt;
 
88
  QLabel*    _quality_bar_label;
 
89
  QProgressBar* _quality_bar;
 
90
  QSecureLineEdit* _edit;
 
91
  QPushButton* _ok;
 
92
  QPushButton* _cancel;
 
93
  bool       _grabbed;
 
94
  bool       _have_quality_bar;
 
95
  pinentry_t _pinentry_info;
 
96
};
 
97
 
 
98
#endif // __PINENTRYDIALOG_H__