summaryrefslogtreecommitdiffstats
path: root/debian/pinentry-tqt/pinentry-tqt-1.1.0/tqt/pinentrydialog.h
blob: 8e901db243dfb741651a47c38fe68e34a00fbfd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* pinentrydialog.h - A secure KDE dialog for PIN entry.
 * Copyright (C) 2002 Klarälvdalens Datakonsult AB
 * Written by Steffen Hansen <steffen@klaralvdalens-datakonsult.se>.
 *
 * 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 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 <https://www.gnu.org/licenses/>.
 * SPDX-License-Identifier: GPL-2.0+
 */

#ifndef __PINENTRYDIALOG_H__
#define __PINENTRYDIALOG_H__

#include <ntqdialog.h>
#include "pinentry.h"

class TQLabel;
class TQPushButton;
class TQProgressBar;
class SecTQLineEdit;
class SecTQString;

class PinEntryDialog : public TQDialog {
  TQ_OBJECT

  TQ_PROPERTY( TQString description READ description WRITE setDescription )
  TQ_PROPERTY( TQString error READ error WRITE setError )
    //  TQ_PROPERTY( SecTQString text READ text WRITE setText )
  TQ_PROPERTY( TQString prompt READ prompt WRITE setPrompt )
public:
  friend class PinEntryController; // TODO: remove when assuan lets me use TQt eventloop.
  PinEntryDialog( TQWidget* parent = 0, const char* name = 0,
                  bool modal = false, bool enable_quality_bar = false );

  void setDescription( const TQString& );
  TQString description() const;

  void setError( const TQString& );
  TQString error() const;

  void setText( const SecTQString& );
  SecTQString text() const;

  void setPrompt( const TQString& );
  TQString prompt() const;

  void setOkText( const TQString& );
  void setCancelText( const TQString& );

  void setQualityBar( const TQString& );
  void setQualityBarTT( const TQString& );

  void setPinentryInfo (pinentry_t);

public slots:
  void updateQuality(const SecTQString &);

signals:
  void accepted();
  void rejected();

protected:
  virtual void keyPressEvent( TQKeyEvent *e );
  virtual void hideEvent( TQHideEvent* );
  virtual void paintEvent( TQPaintEvent* );

private:
  TQLabel*    _icon;
  TQLabel*    _desc;
  TQLabel*    _error;
  TQLabel*    _prompt;
  TQLabel*    _quality_bar_label;
  TQProgressBar* _quality_bar;
  SecTQLineEdit* _edit;
  TQPushButton* _ok;
  TQPushButton* _cancel;
  bool       _grabbed;
  bool       _have_quality_bar;
  pinentry_t _pinentry_info;
};


#endif // __PINENTRYDIALOG_H__