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