~x2go/x2go/pinentry-x2go_master

« back to all changes in this revision

Viewing changes to qt/pinentrydialog.h

  • Committer: Mike Gabriel
  • Date: 2012-06-13 12:55:37 UTC
  • Revision ID: git-v1:d2060291d5cc7beb92f78168e48ececfe765d552
Strip code project down to its essentials, remove a lot of unneeded cruft. / Make code tree fully build with autotools, see README file for further info.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* pinentrydialog.h - A secure KDE dialog for PIN entry.
2
 
   Copyright (C) 2002 Klar�lvdalens Datakonsult AB
3
 
   Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>.
4
 
   
5
 
   This program is free software; you can redistribute it and/or
6
 
   modify it under the terms of the GNU General Public License as
7
 
   published by the Free Software Foundation; either version 2 of the
8
 
   License, or (at your option) any later version.
9
 
 
10
 
   This program is distributed in the hope that it will be useful, but
11
 
   WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
 
   General Public License for more details.
14
 
 
15
 
   You should have received a copy of the GNU General Public License
16
 
   along with this program; if not, write to the Free Software
17
 
   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
18
 
   02111-1307, USA  */
19
 
 
20
 
#ifndef __PINENTRYDIALOG_H__
21
 
#define __PINENTRYDIALOG_H__
22
 
 
23
 
#include <qdialog.h>
24
 
#include "pinentry.h"
25
 
 
26
 
class QLabel;
27
 
class QPushButton;
28
 
class QProgressBar;
29
 
class SecQLineEdit;
30
 
class SecQString;
31
 
 
32
 
class PinEntryDialog : public QDialog {
33
 
  Q_OBJECT
34
 
 
35
 
  Q_PROPERTY( QString description READ description WRITE setDescription )
36
 
  Q_PROPERTY( QString error READ error WRITE setError )
37
 
    //  Q_PROPERTY( SecQString text READ text WRITE setText )
38
 
  Q_PROPERTY( QString prompt READ prompt WRITE setPrompt )
39
 
public:
40
 
  friend class PinEntryController; // TODO: remove when assuan lets me use Qt eventloop.
41
 
  PinEntryDialog( QWidget* parent = 0, const char* name = 0, 
42
 
                  bool modal = false, bool enable_quality_bar = false );
43
 
 
44
 
  void setDescription( const QString& );
45
 
  QString description() const;
46
 
 
47
 
  void setError( const QString& );
48
 
  QString error() const;
49
 
 
50
 
  void setText( const SecQString& );
51
 
  SecQString text() const;
52
 
 
53
 
  void setPrompt( const QString& );
54
 
  QString prompt() const;
55
 
  
56
 
  void setOkText( const QString& );
57
 
  void setCancelText( const QString& );
58
 
 
59
 
  void setQualityBar( const QString& );
60
 
  void setQualityBarTT( const QString& );
61
 
 
62
 
  void setPinentryInfo (pinentry_t);
63
 
 
64
 
public slots:
65
 
  void updateQuality(const SecQString &);
66
 
 
67
 
signals:
68
 
  void accepted();
69
 
  void rejected();
70
 
 
71
 
protected:
72
 
  virtual void keyPressEvent( QKeyEvent *e );
73
 
  virtual void hideEvent( QHideEvent* );
74
 
  virtual void paintEvent( QPaintEvent* );
75
 
 
76
 
private:
77
 
  QLabel*    _icon;
78
 
  QLabel*    _desc;
79
 
  QLabel*    _error;
80
 
  QLabel*    _prompt;
81
 
  QLabel*    _quality_bar_label;
82
 
  QProgressBar* _quality_bar;
83
 
  SecQLineEdit* _edit;
84
 
  QPushButton* _ok;
85
 
  QPushButton* _cancel;  
86
 
  bool       _grabbed;
87
 
  bool       _have_quality_bar;
88
 
  pinentry_t _pinentry_info;
89
 
};
90
 
 
91
 
 
92
 
#endif // __PINENTRYDIALOG_H__