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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
|
/*
* Copyright (c) 2005 Massachusetts Institute of Technology
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without
* restriction, including without limitation the rights to use, copy,
* modify, merge, publish, distribute, sublicense, and/or sell copies
* of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/* $Id$ */
#ifndef __KHIMAIRA_NEWCREDWND_H
#define __KHIMAIRA_NEWCREDWND_H
#include<khuidefs.h>
#define KHUI_NEWCREDWND_CLASS L"KhmNewCredWnd"
typedef enum tag_nc_notification_types {
NC_NOTIFY_NONE = 0, /* no notification */
NC_NOTIFY_MARQUEE, /* marquee type notification */
NC_NOTIFY_PROGRESS, /* progress notification */
NC_NOTIFY_MESSAGE, /* a message */
} nc_notification_type;
typedef struct khui_nc_wnd_data_t {
khui_new_creds * nc;
/* The tab control */
HWND tab_wnd; /* tab control */
int current_panel; /* ordinal of the current panel being
displayed. */
/* The main panel */
HWND dlg_main; /* main dialog */
RECT r_main; /* the extent of the main panel that
we have used so far. The rect
includes the size of the area used
by the identity selector controls,
the custom controls added by
credentials providers and the
buttons that may be required when
in the mini mode. */
RECT r_required; /* required size of the main window */
/* The button bar */
HWND dlg_bb; /* button bar */
/* Sizing the new credentials window */
BOOL animation_enabled; /* Flag indicating whether animation
is enabled for the dialg. If this
flag is off, we don't animate size
changes even if the configuration
says so. */
BOOL size_changing; /* flag indicating that the size of
the main window is being
adjusted. */
RECT sz_ch_source; /* Source size, from which we are
going towards target size in
sz_ch_max steps. The RECT is self
relative (i.e. left=0 and top=0)*/
RECT sz_ch_target; /* If we are doing an incremental size
change, this holds the target size
that we were going for. Note that
the target size might change while
we are adjusting the size. So this
helps keep track of whether we need
to start the size change again. The
RECT is self relative (i.e. left=0
and top=0). */
int sz_ch_increment; /* Current step of the incremental
size change operation. */
int sz_ch_max; /* Max number of steps in the size
change operation. */
int sz_ch_timeout; /* Milliseconds between each increment */
/* Custom controls and identity specifiers */
HWND hwnd_banner; /* static control for banner */
HWND hwnd_name; /* static control for name */
HWND hwnd_last_idspec; /* last identity specifier control */
/* Notification windows */
nc_notification_type notif_type; /* Type of notification */
HWND hwnd_notif_label; /* Label for notifications */
HWND hwnd_notif_aux; /* Other control for notifications */
/* Areas of the main panel */
RECT r_idspec; /* Area used by identity specifiers
(relative to client) */
RECT r_custprompt; /* Area used by custom controls (relative
to client) */
RECT r_notif; /* Area used for notifications. */
/* Metrics for custom prompts and identity specifiers */
RECT r_row; /* Metrics for a control row (left=0,
top=0, right=width, bottom=height) */
RECT r_area; /* Area available for controls (relative
to client) */
RECT r_n_label; /* coords of the static control (relative
to row) */
RECT r_n_input; /* coords of the edit control (relative to
row) */
RECT r_e_label; /* coords of the extended edit control
(relative to row) */
RECT r_e_input; /* coords of the extended edit control
(relative to row) */
RECT r_credtext; /* Area for credtext window (relative to
row) */
} khui_nc_wnd_data;
void khm_register_newcredwnd_class(void);
void khm_unregister_newcredwnd_class(void);
HWND khm_create_newcredwnd(HWND parent, khui_new_creds * c);
void khm_prep_newcredwnd(HWND hwnd);
void khm_show_newcredwnd(HWND hwnd);
/* Width of the button bar in dialog units */
#define NCDLG_BBAR_WIDTH 66
/* Height of the button bar in dialog units */
#define NCDLG_BBAR_HEIGHT 190
/* Control identifier for the tab control in the new credentials
dialog. We declare this here since we will be creating the control
manually. */
#define IDC_NC_TABS 8001
/* This is the first control ID that is created in the custom tabstrip
control buttons. Subsequent buttons get consecutive IDs starting
from this one. */
#define NC_TS_CTRL_ID_MIN 8002
/* Maximum number of controls */
#define NC_TS_MAX_CTRLS 8
/* Maximum control ID */
#define NC_TS_CTRL_ID_MAX (NC_TS_CTRL_ID_MIN + NC_TS_MAX_CTRLS - 1)
#define NC_BN_SET_DEF_ID 8012
/* the first control ID that may be used by an identity provider */
#define NC_IS_CTRL_ID_MIN 8016
/* the maximum number of controls that may be created by an identity
provider*/
#define NC_IS_CTRL_MAX_CTRLS 8
/* the maximum control ID that may be used by an identity provider */
#define NC_IS_CTRL_ID_MAX (NC_IS_CTRL_ID_MIN + NC_IS_MAX_CTRLS - 1)
#define NC_WINDOW_EX_STYLES (WS_EX_DLGMODALFRAME | WS_EX_CONTEXTHELP | WS_EX_APPWINDOW)
#define NC_WINDOW_STYLES (WS_DLGFRAME | WS_POPUPWINDOW | WS_CLIPCHILDREN)
#define NC_SZ_STEPS_MIN 3
#define NC_SZ_STEPS_DEF 10
#define NC_SZ_STEPS_MAX 100
#define NC_SZ_TIMEOUT_MIN 5
#define NC_SZ_TIMEOUT_DEF 10
#define NC_SZ_TIMEOUT_MAX 500
#define NC_TIMER_SIZER 1001
#define NC_TIMER_ENABLEANIMATE 1002
#define ENABLEANIMATE_TIMEOUT 400
#endif
|