2
* Copyright (c) 2005 Massachusetts Institute of Technology
4
* Permission is hereby granted, free of charge, to any person
5
* obtaining a copy of this software and associated documentation
6
* files (the "Software"), to deal in the Software without
7
* restriction, including without limitation the rights to use, copy,
8
* modify, merge, publish, distribute, sublicense, and/or sell copies
9
* of the Software, and to permit persons to whom the Software is
10
* furnished to do so, subject to the following conditions:
12
* The above copyright notice and this permission notice shall be
13
* included in all copies or substantial portions of the Software.
15
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
27
#ifndef __KHIMAIRA_NEWCREDWND_H
28
#define __KHIMAIRA_NEWCREDWND_H
32
#define KHUI_NEWCREDWND_CLASS L"KhmNewCredWnd"
34
typedef enum tag_nc_notification_types {
35
NC_NOTIFY_NONE = 0, /* no notification */
36
NC_NOTIFY_MARQUEE, /* marquee type notification */
37
NC_NOTIFY_PROGRESS, /* progress notification */
38
NC_NOTIFY_MESSAGE, /* a message */
39
} nc_notification_type;
41
typedef struct khui_nc_wnd_data_t {
46
HWND tab_wnd; /* tab control */
47
int current_panel; /* ordinal of the current panel being
51
HWND dlg_main; /* main dialog */
52
RECT r_main; /* the extent of the main panel that
53
we have used so far. The rect
54
includes the size of the area used
55
by the identity selector controls,
56
the custom controls added by
57
credentials providers and the
58
buttons that may be required when
60
RECT r_required; /* required size of the main window */
64
HWND dlg_bb; /* button bar */
66
/* Sizing the new credentials window */
68
BOOL animation_enabled; /* Flag indicating whether animation
69
is enabled for the dialg. If this
70
flag is off, we don't animate size
71
changes even if the configuration
73
BOOL size_changing; /* flag indicating that the size of
74
the main window is being
76
RECT sz_ch_source; /* Source size, from which we are
77
going towards target size in
78
sz_ch_max steps. The RECT is self
79
relative (i.e. left=0 and top=0)*/
80
RECT sz_ch_target; /* If we are doing an incremental size
81
change, this holds the target size
82
that we were going for. Note that
83
the target size might change while
84
we are adjusting the size. So this
85
helps keep track of whether we need
86
to start the size change again. The
87
RECT is self relative (i.e. left=0
89
int sz_ch_increment; /* Current step of the incremental
90
size change operation. */
91
int sz_ch_max; /* Max number of steps in the size
93
int sz_ch_timeout; /* Milliseconds between each increment */
95
BOOL flashing_enabled; /* The window maybe still flashing
99
/* Custom controls and identity specifiers */
101
HWND hwnd_banner; /* static control for banner */
102
HWND hwnd_name; /* static control for name */
104
HWND hwnd_last_idspec; /* last identity specifier control */
106
/* Notification windows */
108
nc_notification_type notif_type; /* Type of notification */
109
HWND hwnd_notif_label; /* Label for notifications */
110
HWND hwnd_notif_aux; /* Other control for notifications */
112
/* Areas of the main panel */
114
RECT r_idspec; /* Area used by identity specifiers
115
(relative to client) */
116
RECT r_custprompt; /* Area used by custom controls (relative
118
RECT r_notif; /* Area used for notifications. */
120
/* Metrics for custom prompts and identity specifiers */
122
RECT r_row; /* Metrics for a control row (left=0,
123
top=0, right=width, bottom=height) */
124
RECT r_area; /* Area available for controls (relative
126
RECT r_n_label; /* coords of the static control (relative
128
RECT r_n_input; /* coords of the edit control (relative to
130
RECT r_e_label; /* coords of the extended edit control
132
RECT r_e_input; /* coords of the extended edit control
134
RECT r_credtext; /* Area for credtext window (relative to
138
void khm_register_newcredwnd_class(void);
139
void khm_unregister_newcredwnd_class(void);
140
HWND khm_create_newcredwnd(HWND parent, khui_new_creds * c);
141
void khm_prep_newcredwnd(HWND hwnd);
142
void khm_show_newcredwnd(HWND hwnd);
144
/* Width of the button bar in dialog units */
145
#define NCDLG_BBAR_WIDTH 66
146
/* Height of the button bar in dialog units */
147
#define NCDLG_BBAR_HEIGHT 190
149
/* Control identifier for the tab control in the new credentials
150
dialog. We declare this here since we will be creating the control
152
#define IDC_NC_TABS 8001
154
/* This is the first control ID that is created in the custom tabstrip
155
control buttons. Subsequent buttons get consecutive IDs starting
157
#define NC_TS_CTRL_ID_MIN 8002
159
/* Maximum number of controls */
160
#define NC_TS_MAX_CTRLS 8
162
/* Maximum control ID */
163
#define NC_TS_CTRL_ID_MAX (NC_TS_CTRL_ID_MIN + NC_TS_MAX_CTRLS - 1)
165
#define NC_BN_SET_DEF_ID 8012
167
/* the first control ID that may be used by an identity provider */
168
#define NC_IS_CTRL_ID_MIN 8016
170
/* the maximum number of controls that may be created by an identity
172
#define NC_IS_CTRL_MAX_CTRLS 8
174
/* the maximum control ID that may be used by an identity provider */
175
#define NC_IS_CTRL_ID_MAX (NC_IS_CTRL_ID_MIN + NC_IS_MAX_CTRLS - 1)
177
#define NC_WINDOW_EX_STYLES (WS_EX_DLGMODALFRAME | WS_EX_CONTEXTHELP | WS_EX_APPWINDOW)
178
#define NC_WINDOW_STYLES (WS_DLGFRAME | WS_POPUPWINDOW | WS_CLIPCHILDREN)
180
#define NC_SZ_STEPS_MIN 3
181
#define NC_SZ_STEPS_DEF 10
182
#define NC_SZ_STEPS_MAX 100
184
#define NC_SZ_TIMEOUT_MIN 5
185
#define NC_SZ_TIMEOUT_DEF 10
186
#define NC_SZ_TIMEOUT_MAX 500
188
#define NC_TIMER_SIZER 1001
189
#define NC_TIMER_ENABLEANIMATE 1002
191
#define ENABLEANIMATE_TIMEOUT 400