NIM - Fix taskbar button visibility on Vista
[krb5.git] / src / windows / identity / ui / newcredwnd.h
1 /*
2  * Copyright (c) 2005 Massachusetts Institute of Technology
3  *
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:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
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
22  * SOFTWARE.
23  */
24
25 /* $Id$ */
26
27 #ifndef __KHIMAIRA_NEWCREDWND_H
28 #define __KHIMAIRA_NEWCREDWND_H
29
30 #include<khuidefs.h>
31
32 #define KHUI_NEWCREDWND_CLASS L"KhmNewCredWnd"
33
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;
40
41 typedef struct khui_nc_wnd_data_t {
42     khui_new_creds * nc;
43
44     /* The tab control */
45
46     HWND tab_wnd;               /* tab control */
47     int current_panel;          /* ordinal of the current panel being
48                                    displayed. */
49
50     /* The main panel */
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
59                                    in the mini mode. */
60     RECT r_required;            /* required size of the main window */
61
62     /* The button bar */
63
64     HWND dlg_bb;                /* button bar */
65
66     /* Sizing the new credentials window */
67
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
72                                    says so. */
73     BOOL size_changing;         /* flag indicating that the size of
74                                    the main window is being
75                                    adjusted. */
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
88                                    and top=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
92                                    change operation. */
93     int  sz_ch_timeout;         /* Milliseconds between each increment */
94
95     /* Custom controls and identity specifiers */
96
97     HWND hwnd_banner;           /* static control for banner */
98     HWND hwnd_name;             /* static control for name */
99
100     HWND hwnd_last_idspec;      /* last identity specifier control */
101
102     /* Notification windows */
103
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 */
107
108     /* Areas of the main panel */
109
110     RECT r_idspec;          /* Area used by identity specifiers
111                                (relative to client) */
112     RECT r_custprompt;      /* Area used by custom controls (relative
113                                to client) */
114     RECT r_notif;           /* Area used for notifications. */
115
116     /* Metrics for custom prompts and identity specifiers */
117
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
121                                to client) */
122     RECT r_n_label;         /* coords of the static control (relative
123                                to row) */
124     RECT r_n_input;         /* coords of the edit control (relative to
125                                row) */
126     RECT r_e_label;         /* coords of the extended edit control
127                                (relative to row) */
128     RECT r_e_input;         /* coords of the extended edit control
129                                (relative to row) */
130     RECT r_credtext;        /* Area for credtext window (relative to
131                                row) */
132 } khui_nc_wnd_data;
133
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);
139
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
144
145 /* Control identifier for the tab control in the new credentials
146    dialog. We declare this here since we will be creating the control
147    manually. */
148 #define IDC_NC_TABS 8001
149
150 /* This is the first control ID that is created in the custom tabstrip
151    control buttons.  Subsequent buttons get consecutive IDs starting
152    from this one.  */
153 #define NC_TS_CTRL_ID_MIN 8002
154
155 /* Maximum number of controls */
156 #define NC_TS_MAX_CTRLS 8
157
158 /* Maximum control ID */
159 #define NC_TS_CTRL_ID_MAX (NC_TS_CTRL_ID_MIN + NC_TS_MAX_CTRLS - 1)
160
161 #define NC_BN_SET_DEF_ID 8012
162
163 /* the first control ID that may be used by an identity provider */
164 #define NC_IS_CTRL_ID_MIN 8016
165
166 /* the maximum number of controls that may be created by an identity
167    provider*/
168 #define NC_IS_CTRL_MAX_CTRLS 8
169
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)
172
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)
175
176 #define NC_SZ_STEPS_MIN 3
177 #define NC_SZ_STEPS_DEF 10
178 #define NC_SZ_STEPS_MAX 100
179
180 #define NC_SZ_TIMEOUT_MIN 5
181 #define NC_SZ_TIMEOUT_DEF 10
182 #define NC_SZ_TIMEOUT_MAX 500
183
184 #define NC_TIMER_SIZER         1001
185 #define NC_TIMER_ENABLEANIMATE 1002
186
187 #define ENABLEANIMATE_TIMEOUT  400
188
189 #endif