summaryrefslogtreecommitdiffstats
path: root/src/windows/identity/uilib/intalert.h
blob: 498c8488f859e57cbe3352fcf446d50fff1ffd90 (plain)
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
/*
 * 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_KHALERTS_H_INTERNAL
#define __KHIMAIRA_KHALERTS_H_INTERNAL

#include<khalerts.h>
#include<khaction.h>

/*! \addtogroup khui_alert

@{ */

/*! \internal

    \brief An alert

    Describes an alert message that will be shown to the user in a
    variety of ways depending on the state of the NetIDMgr
    application.
 */
typedef struct tag_khui_alert {
    khm_int32           magic;
                                /*!< Magic number. Always set to
                                  KHUI_ALERT_MAGIC */

    khm_int32           severity;
                                /*!< The severity of the alert.  One
                                  of KHERR_ERROR, KHERR_WARNING or
                                  KHERR_INFO.  The default is
                                  KHERR_INFO.  Do not set directly.
                                  Use khui_alert_set_severity(). */

    khm_int32           alert_commands[KHUI_MAX_ALERT_COMMANDS];
                                /*!< The command buttons associated
                                  with the alert.  Use
                                  khui_alert_add_command() to add a
                                  command.  The buttons will appear in
                                  the order in which they were added.
                                  The first button will be the
                                  default.  Each command should be a
                                  known action identifier. */
    khm_int32           n_alert_commands;
                                /*!< The number of commands in
                                  alert_commands[]. */

    wchar_t *           title;  /*!< The title of the alert.  Subject
                                  to ::KHUI_MAXCCH_TITLE.  Use
                                  khui_alert_set_title() to set.  Do
                                  not modify directly. */

    wchar_t *           message;
                                /*!< The main message of the alert.
                                  Subject to ::KHUI_MAXCCH_MESSAGE.
                                  Use khui_alert_set_message() to set.
                                  Do not modify direcly. */

    wchar_t *           suggestion;
                                /*!< A suggestion.  Appears below the
                                  message text. Use
                                  khui_alert_set_suggestion() to set.
                                  Do not modify directly. */

    khm_int32           flags;  /*!< combination of
                                 ::khui_alert_flags.  Do not modify
                                 directly. */

    kherr_context *     err_context;
                                /*!< If non-NULL at the time the alert
                                  window is shown, this indicates that
                                  the alert window should provide an
                                  error viewer for the given error
                                  context. */

    kherr_event *       err_event;
                                /*!< If non-NULL at the time the alert
                                  window is shown, this indicates that
                                  the alert window should provide an
                                  error viewer for the given error
                                  event.  If an \a err_context is also
                                  given, the error viewer for the
                                  context will be below this error. */

    khui_alert_type     alert_type;
                                /*!< The type of alert. */

    khui_action_context ctx;    /*!< Context to which this alert
                                  applies to. */

    khm_int32           response;
                                /*!< Once the alert is displayed to
                                  the user, when the user clicks one
                                  of the command buttons, the command
                                  ID will be assigned here. */

    int                 refcount;
                                /*!< internal */

    khm_boolean         displayed;
                                /*!< TRUE when then the alert is being
                                  displayed on screen.  Also used
                                  internally to determine when to
                                  terminate the modal loop */

    LDCL(struct tag_khui_alert);
                                /*!< internal */
} khui_alert;

#define KHUI_ALERT_MAGIC 0x48c39ce9

/*@}*/

#endif