]>
Commit | Line | Data |
---|---|---|
48a9d5f7 | 1 | /** @file\r |
d1102dba | 2 | Extension Form Browser Protocol provides the services that can be used to\r |
48a9d5f7 LG |
3 | register the different hot keys for the standard Browser actions described in UEFI specification.\r |
4 | \r | |
d1102dba | 5 | Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r |
9d510e61 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
48a9d5f7 LG |
7 | \r |
8 | **/\r | |
9 | \r | |
10 | #ifndef __FORM_BROWSER_EXTENSION_H__\r | |
11 | #define __FORM_BROWSER_EXTENSION_H__\r | |
12 | \r | |
13 | #define FORM_BROWSER_EXTENSION_PROTOCOL_GUID \\r | |
14 | { 0x1f73b18d, 0x4630, 0x43c1, { 0xa1, 0xde, 0x6f, 0x80, 0x85, 0x5d, 0x7d, 0xa4 } }\r | |
15 | \r | |
2fa0e11d LG |
16 | typedef struct _EDKII_FORM_BROWSER_EXTENSION_PROTOCOL EDKII_FORM_BROWSER_EXTENSION_PROTOCOL;\r |
17 | \r | |
18 | //\r | |
19 | // To be compatible, keep EFI_FORM_BROWSER_EXTENSION_PROTOCOL definition\r | |
20 | //\r | |
21 | typedef EDKII_FORM_BROWSER_EXTENSION_PROTOCOL EFI_FORM_BROWSER_EXTENSION_PROTOCOL;\r | |
48a9d5f7 LG |
22 | \r |
23 | //\r | |
3531262f | 24 | // Return value of SAVE_REMINDER() that describes whether the changed data is saved or discarded.\r |
48a9d5f7 LG |
25 | //\r |
26 | #define BROWSER_NO_CHANGES 0\r | |
27 | #define BROWSER_SAVE_CHANGES 1\r | |
28 | #define BROWSER_DISCARD_CHANGES 2\r | |
27bace9b | 29 | #define BROWSER_KEEP_CURRENT 3\r |
48a9d5f7 LG |
30 | \r |
31 | //\r | |
d1102dba LG |
32 | // Browser actions. They can be cominbed together.\r |
33 | // If more than one actions are specified, the action with low bit will be executed first.\r | |
48a9d5f7 LG |
34 | //\r |
35 | #define BROWSER_ACTION_UNREGISTER 0\r | |
36 | #define BROWSER_ACTION_DISCARD BIT0\r | |
37 | #define BROWSER_ACTION_DEFAULT BIT1\r | |
38 | #define BROWSER_ACTION_SUBMIT BIT2\r | |
39 | #define BROWSER_ACTION_RESET BIT3\r | |
40 | #define BROWSER_ACTION_EXIT BIT4\r | |
4d4deaac | 41 | #define BROWSER_ACTION_GOTO BIT5\r |
48a9d5f7 LG |
42 | \r |
43 | //\r | |
44 | // Scope for Browser action. It may be Form, FormSet or System level.\r | |
45 | //\r | |
46 | typedef enum {\r | |
47 | FormLevel,\r | |
48 | FormSetLevel,\r | |
49 | SystemLevel,\r | |
50 | MaxLevel\r | |
51 | } BROWSER_SETTING_SCOPE;\r | |
52 | \r | |
53 | /**\r | |
54 | Configure what scope the hot key will impact.\r | |
55 | All hot keys have the same scope. The mixed hot keys with the different level are not supported.\r | |
56 | If no scope is set, the default scope will be FormSet level.\r | |
57 | After all registered hot keys are removed, previous Scope can reset to another level.\r | |
d1102dba LG |
58 | \r |
59 | @param[in] Scope Scope level to be set.\r | |
60 | \r | |
48a9d5f7 | 61 | @retval EFI_SUCCESS Scope is set correctly.\r |
d1102dba | 62 | @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE.\r |
48a9d5f7 LG |
63 | @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.\r |
64 | \r | |
65 | **/\r | |
66 | typedef\r | |
67 | EFI_STATUS\r | |
68 | (EFIAPI *SET_SCOPE) (\r | |
69 | IN BROWSER_SETTING_SCOPE Scope\r | |
70 | );\r | |
71 | \r | |
72 | /**\r | |
73 | Register the hot key with its browser action, or unregistered the hot key.\r | |
74 | If the action value is zero, the hot key will be unregistered if it has been registered.\r | |
75 | If the same hot key has been registered, the new action and help string will override the previous ones.\r | |
d1102dba | 76 | \r |
48a9d5f7 | 77 | @param[in] KeyData A pointer to a buffer that describes the keystroke\r |
d1102dba | 78 | information for the hot key. Its type is EFI_INPUT_KEY to\r |
48a9d5f7 | 79 | be supported by all ConsoleIn devices.\r |
d1102dba | 80 | @param[in] Action Action value that describes what action will be trigged when the hot key is pressed.\r |
48a9d5f7 LG |
81 | @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.\r |
82 | @param[in] HelpString Help string that describes the hot key information.\r | |
83 | Its value may be NULL for the unregistered hot key.\r | |
d1102dba | 84 | \r |
48a9d5f7 LG |
85 | @retval EFI_SUCCESS Hot key is registered or unregistered.\r |
86 | @retval EFI_INVALID_PARAMETER KeyData is NULL.\r | |
87 | **/\r | |
88 | typedef\r | |
89 | EFI_STATUS\r | |
90 | (EFIAPI *REGISTER_HOT_KEY) (\r | |
91 | IN EFI_INPUT_KEY *KeyData,\r | |
92 | IN UINT32 Action,\r | |
93 | IN UINT16 DefaultId,\r | |
94 | IN EFI_STRING HelpString OPTIONAL\r | |
95 | );\r | |
96 | \r | |
97 | /**\r | |
98 | This handler is responsbile for the left things on normal boot after all UI forms are closed.\r | |
d1102dba | 99 | For example, it can continue to boot the first boot option.\r |
48a9d5f7 LG |
100 | \r |
101 | It will be used only when EXIT action is trigged as system level.\r | |
102 | **/\r | |
103 | typedef\r | |
104 | VOID\r | |
105 | (EFIAPI *EXIT_HANDLER) (\r | |
106 | VOID\r | |
107 | );\r | |
108 | \r | |
109 | /**\r | |
d1102dba LG |
110 | Register Exit handler function.\r |
111 | When more than one handler function is registered, the latter one will override the previous one.\r | |
112 | When NULL handler is specified, the previous Exit handler will be unregistered.\r | |
113 | \r | |
114 | @param[in] Handler Pointer to handler function.\r | |
48a9d5f7 LG |
115 | \r |
116 | **/\r | |
117 | typedef\r | |
118 | VOID\r | |
119 | (EFIAPI *REGISTER_EXIT_HANDLER) (\r | |
120 | IN EXIT_HANDLER Handler\r | |
121 | );\r | |
122 | \r | |
123 | /**\r | |
124 | Create reminder to let user to choose save or discard the changed browser data.\r | |
125 | Caller can use it to actively check the changed browser data.\r | |
126 | \r | |
127 | @retval BROWSER_NO_CHANGES No browser data is changed.\r | |
128 | @retval BROWSER_SAVE_CHANGES The changed browser data is saved.\r | |
129 | @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.\r | |
27bace9b | 130 | @retval BROWSER_KEEP_CURRENT Browser keep current changes.\r |
48a9d5f7 LG |
131 | \r |
132 | **/\r | |
133 | typedef\r | |
134 | UINT32\r | |
135 | (EFIAPI *SAVE_REMINDER)(\r | |
136 | VOID\r | |
137 | );\r | |
138 | \r | |
2fa0e11d | 139 | struct _EDKII_FORM_BROWSER_EXTENSION_PROTOCOL {\r |
48a9d5f7 LG |
140 | SET_SCOPE SetScope;\r |
141 | REGISTER_HOT_KEY RegisterHotKey;\r | |
142 | REGISTER_EXIT_HANDLER RegiserExitHandler;\r | |
143 | SAVE_REMINDER SaveReminder;\r | |
144 | };\r | |
145 | \r | |
146 | extern EFI_GUID gEfiFormBrowserExProtocolGuid;\r | |
2fa0e11d | 147 | extern EFI_GUID gEdkiiFormBrowserExProtocolGuid;\r |
48a9d5f7 LG |
148 | \r |
149 | #endif\r | |
150 | \r |