[r5093]: branches / yubico2_2 / src / ui / wxWidgets / safecombinationchange.h Maximize Restore History

Download this file

safecombinationchange.h    140 lines (106 with data), 4.3 kB

  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
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
/*
* Copyright (c) 2003-2012 Rony Shapiro <ronys@users.sourceforge.net>.
* All rights reserved. Use of the code is allowed under the
* Artistic License 2.0 terms, as specified in the LICENSE file
* distributed with this code, or available from
* http://www.opensource.org/licenses/artistic-license-2.0.php
*/
/** \file safecombinationchange.h
*
*/
#ifndef _SAFECOMBINATIONCHANGE_H_
#define _SAFECOMBINATIONCHANGE_H_
/*!
* Includes
*/
////@begin includes
////@end includes
#include "core/PWScore.h"
#include "YubiMixin.h"
/*!
* Forward declarations
*/
////@begin forward declarations
class CSafeCombinationCtrl;
////@end forward declarations
class wxTimer;
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_CSAFECOMBINATIONCHANGE 10074
#define ID_OLDPASSWD 10075
#define ID_YUBIBTN 10229
#define ID_NEWPASSWD 10076
#define ID_YUBIBTN2 10000
#define ID_CONFIRM 10077
#define ID_YUBISTATUS 10230
#define SYMBOL_CSAFECOMBINATIONCHANGE_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxDIALOG_MODAL|wxTAB_TRAVERSAL
#define SYMBOL_CSAFECOMBINATIONCHANGE_TITLE _("Change Safe Combination")
#define SYMBOL_CSAFECOMBINATIONCHANGE_IDNAME ID_CSAFECOMBINATIONCHANGE
#define SYMBOL_CSAFECOMBINATIONCHANGE_SIZE wxSize(400, 300)
#define SYMBOL_CSAFECOMBINATIONCHANGE_POSITION wxDefaultPosition
////@end control identifiers
/*!
* CSafeCombinationChange class declaration
*/
class CSafeCombinationChange: public wxDialog
{
DECLARE_CLASS( CSafeCombinationChange )
DECLARE_EVENT_TABLE()
public:
/// Constructors
CSafeCombinationChange(wxWindow* parent, PWScore &core,
wxWindowID id = SYMBOL_CSAFECOMBINATIONCHANGE_IDNAME, const wxString& caption = SYMBOL_CSAFECOMBINATIONCHANGE_TITLE, const wxPoint& pos = SYMBOL_CSAFECOMBINATIONCHANGE_POSITION, const wxSize& size = SYMBOL_CSAFECOMBINATIONCHANGE_SIZE, long style = SYMBOL_CSAFECOMBINATIONCHANGE_STYLE );
/// Creation
bool Create(wxWindow* parent, wxWindowID id = SYMBOL_CSAFECOMBINATIONCHANGE_IDNAME, const wxString& caption = SYMBOL_CSAFECOMBINATIONCHANGE_TITLE, const wxPoint& pos = SYMBOL_CSAFECOMBINATIONCHANGE_POSITION, const wxSize& size = SYMBOL_CSAFECOMBINATIONCHANGE_SIZE, long style = SYMBOL_CSAFECOMBINATIONCHANGE_STYLE );
/// Destructor
~CSafeCombinationChange();
/// Initialises member variables
void Init();
/// Creates the controls and sizers
void CreateControls();
////@begin CSafeCombinationChange event handler declarations
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_YUBIBTN
void OnYubibtnClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_YUBIBTN2
void OnYubibtn2Click( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event );
////@end CSafeCombinationChange event handler declarations
void OnPollingTimer(wxTimerEvent& timerEvent);
////@begin CSafeCombinationChange member function declarations
StringX GetConfirm() const { return m_confirm ; }
void SetConfirm(StringX value) { m_confirm = value ; }
StringX GetNewpasswd() const { return m_newpasswd ; }
void SetNewpasswd(StringX value) { m_newpasswd = value ; }
StringX GetOldpasswd() const { return m_oldpasswd ; }
void SetOldpasswd(StringX value) { m_oldpasswd = value ; }
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end CSafeCombinationChange member function declarations
/// Should we show tooltips?
static bool ShowToolTips();
////@begin CSafeCombinationChange member variables
CSafeCombinationCtrl* m_oldPasswdEntry;
wxBitmapButton* m_YubiBtn;
CSafeCombinationCtrl* m_newPasswdEntry;
wxBitmapButton* m_YubiBtn2;
CSafeCombinationCtrl* m_confirmEntry;
wxStaticText* m_yubiStatusCtrl;
private:
StringX m_confirm;
StringX m_newpasswd;
StringX m_oldpasswd;
////@end CSafeCombinationChange member variables
PWScore &m_core;
// try having 2 mixin objects to handle things:
CYubiMixin m_yubiMixin1, m_yubiMixin2;
wxTimer* m_pollingTimer; // for Yubi
};
#endif
// _SAFECOMBINATIONCHANGE_H_