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 /* Custom controls and identity specifiers */
97 HWND hwnd_banner; /* static control for banner */
98 HWND hwnd_name; /* static control for name */
100 HWND hwnd_last_idspec; /* last identity specifier control */
102 /* Notification windows */
104 nc_notification_type notif_type; /* Type of notification */
105 HWND hwnd_notif_label; /* Label for notifications */
106 HWND hwnd_notif_aux; /* Other control for notifications */
108 /* Areas of the main panel */
110 RECT r_idspec; /* Area used by identity specifiers
111 (relative to client) */
112 RECT r_custprompt; /* Area used by custom controls (relative
114 RECT r_notif; /* Area used for notifications. */
116 /* Metrics for custom prompts and identity specifiers */
118 RECT r_row; /* Metrics for a control row (left=0,
119 top=0, right=width, bottom=height) */
120 RECT r_area; /* Area available for controls (relative
122 RECT r_n_label; /* coords of the static control (relative
124 RECT r_n_input; /* coords of the edit control (relative to
126 RECT r_e_label; /* coords of the extended edit control
128 RECT r_e_input; /* coords of the extended edit control
130 RECT r_credtext; /* Area for credtext window (relative to
134 void khm_register_newcredwnd_class(void);
135 void khm_unregister_newcredwnd_class(void);
136 HWND khm_create_newcredwnd(HWND parent, khui_new_creds * c);
137 void khm_prep_newcredwnd(HWND hwnd);
138 void khm_show_newcredwnd(HWND hwnd);
140 /* Width of the button bar in dialog units */
141 #define NCDLG_BBAR_WIDTH 66
142 /* Height of the button bar in dialog units */
143 #define NCDLG_BBAR_HEIGHT 190
145 /* Control identifier for the tab control in the new credentials
146 dialog. We declare this here since we will be creating the control
148 #define IDC_NC_TABS 8001
150 /* This is the first control ID that is created in the custom tabstrip
151 control buttons. Subsequent buttons get consecutive IDs starting
153 #define NC_TS_CTRL_ID_MIN 8002
155 /* Maximum number of controls */
156 #define NC_TS_MAX_CTRLS 8
158 /* Maximum control ID */
159 #define NC_TS_CTRL_ID_MAX (NC_TS_CTRL_ID_MIN + NC_TS_MAX_CTRLS - 1)
161 #define NC_BN_SET_DEF_ID 8012
163 /* the first control ID that may be used by an identity provider */
164 #define NC_IS_CTRL_ID_MIN 8016
166 /* the maximum number of controls that may be created by an identity
168 #define NC_IS_CTRL_MAX_CTRLS 8
170 /* the maximum control ID that may be used by an identity provider */
171 #define NC_IS_CTRL_ID_MAX (NC_IS_CTRL_ID_MIN + NC_IS_MAX_CTRLS - 1)
173 #define NC_WINDOW_EX_STYLES (WS_EX_DLGMODALFRAME | WS_EX_CONTEXTHELP | WS_EX_APPWINDOW)
174 #define NC_WINDOW_STYLES (WS_DLGFRAME | WS_POPUPWINDOW | WS_CLIPCHILDREN)
176 #define NC_SZ_STEPS_MIN 3
177 #define NC_SZ_STEPS_DEF 10
178 #define NC_SZ_STEPS_MAX 100
180 #define NC_SZ_TIMEOUT_MIN 5
181 #define NC_SZ_TIMEOUT_DEF 10
182 #define NC_SZ_TIMEOUT_MAX 500
184 #define NC_TIMER_SIZER 1001
185 #define NC_TIMER_ENABLEANIMATE 1002
187 #define ENABLEANIMATE_TIMEOUT 400