]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Include/Protocol/FormBrowserEx.h
Keep consistent about the return value between the caller and callee.
[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
5Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>\r
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
22typedef struct _EFI_FORM_BROWSER_EXTENSION_PROTOCOL EFI_FORM_BROWSER_EXTENSION_PROTOCOL;\r
23\r
24//\r
3531262f 25// Return value of SAVE_REMINDER() that describes whether the changed data is saved or discarded.\r
48a9d5f7
LG
26//\r
27#define BROWSER_NO_CHANGES 0\r
28#define BROWSER_SAVE_CHANGES 1\r
29#define BROWSER_DISCARD_CHANGES 2\r
27bace9b 30#define BROWSER_KEEP_CURRENT 3\r
48a9d5f7
LG
31\r
32//\r
33// Browser actions. They can be cominbed together. \r
34// If more than one actions are specified, the action with low bit will be executed first. \r
35//\r
36#define BROWSER_ACTION_UNREGISTER 0\r
37#define BROWSER_ACTION_DISCARD BIT0\r
38#define BROWSER_ACTION_DEFAULT BIT1\r
39#define BROWSER_ACTION_SUBMIT BIT2\r
40#define BROWSER_ACTION_RESET BIT3\r
41#define BROWSER_ACTION_EXIT BIT4\r
42\r
43//\r
44// Scope for Browser action. It may be Form, FormSet or System level.\r
45//\r
46typedef 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
58 \r
59 @param[in] Scope Scope level to be set. \r
60 \r
61 @retval EFI_SUCCESS Scope is set correctly.\r
62 @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE. \r
63 @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.\r
64\r
65**/\r
66typedef\r
67EFI_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
76 \r
77 @param[in] KeyData A pointer to a buffer that describes the keystroke\r
78 information for the hot key. Its type is EFI_INPUT_KEY to \r
79 be supported by all ConsoleIn devices.\r
80 @param[in] Action Action value that describes what action will be trigged when the hot key is pressed. \r
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
84 \r
85 @retval EFI_SUCCESS Hot key is registered or unregistered.\r
86 @retval EFI_INVALID_PARAMETER KeyData is NULL.\r
87**/\r
88typedef\r
89EFI_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
99 For example, it can continue to boot the first boot option. \r
100\r
101 It will be used only when EXIT action is trigged as system level.\r
102**/\r
103typedef\r
104VOID\r
105(EFIAPI *EXIT_HANDLER) (\r
106 VOID\r
107 );\r
108\r
109/**\r
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
115\r
116**/\r
117typedef\r
118VOID\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
133typedef\r
134UINT32\r
135(EFIAPI *SAVE_REMINDER)(\r
136 VOID\r
137 );\r
138\r
139struct _EFI_FORM_BROWSER_EXTENSION_PROTOCOL {\r
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
146extern EFI_GUID gEfiFormBrowserExProtocolGuid;\r
147\r
148#endif\r
149\r