2 Extension Form Browser Protocol provides the services that can be used to
3 register the different hot keys for the standard Browser actions described in UEFI specification.
5 Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __FORM_BROWSER_EXTENSION_H__
11 #define __FORM_BROWSER_EXTENSION_H__
13 #define FORM_BROWSER_EXTENSION_PROTOCOL_GUID \
14 { 0x1f73b18d, 0x4630, 0x43c1, { 0xa1, 0xde, 0x6f, 0x80, 0x85, 0x5d, 0x7d, 0xa4 } }
16 typedef struct _EDKII_FORM_BROWSER_EXTENSION_PROTOCOL EDKII_FORM_BROWSER_EXTENSION_PROTOCOL
;
19 // To be compatible, keep EFI_FORM_BROWSER_EXTENSION_PROTOCOL definition
21 typedef EDKII_FORM_BROWSER_EXTENSION_PROTOCOL EFI_FORM_BROWSER_EXTENSION_PROTOCOL
;
24 // Return value of SAVE_REMINDER() that describes whether the changed data is saved or discarded.
26 #define BROWSER_NO_CHANGES 0
27 #define BROWSER_SAVE_CHANGES 1
28 #define BROWSER_DISCARD_CHANGES 2
29 #define BROWSER_KEEP_CURRENT 3
32 // Browser actions. They can be cominbed together.
33 // If more than one actions are specified, the action with low bit will be executed first.
35 #define BROWSER_ACTION_UNREGISTER 0
36 #define BROWSER_ACTION_DISCARD BIT0
37 #define BROWSER_ACTION_DEFAULT BIT1
38 #define BROWSER_ACTION_SUBMIT BIT2
39 #define BROWSER_ACTION_RESET BIT3
40 #define BROWSER_ACTION_EXIT BIT4
41 #define BROWSER_ACTION_GOTO BIT5
44 // Scope for Browser action. It may be Form, FormSet or System level.
51 } BROWSER_SETTING_SCOPE
;
54 Configure what scope the hot key will impact.
55 All hot keys have the same scope. The mixed hot keys with the different level are not supported.
56 If no scope is set, the default scope will be FormSet level.
57 After all registered hot keys are removed, previous Scope can reset to another level.
59 @param[in] Scope Scope level to be set.
61 @retval EFI_SUCCESS Scope is set correctly.
62 @retval EFI_INVALID_PARAMETER Scope is not the valid value specified in BROWSER_SETTING_SCOPE.
63 @retval EFI_UNSPPORTED Scope level is different from current one that the registered hot keys have.
69 IN BROWSER_SETTING_SCOPE Scope
73 Register the hot key with its browser action, or unregistered the hot key.
74 If the action value is zero, the hot key will be unregistered if it has been registered.
75 If the same hot key has been registered, the new action and help string will override the previous ones.
77 @param[in] KeyData A pointer to a buffer that describes the keystroke
78 information for the hot key. Its type is EFI_INPUT_KEY to
79 be supported by all ConsoleIn devices.
80 @param[in] Action Action value that describes what action will be trigged when the hot key is pressed.
81 @param[in] DefaultId Specifies the type of defaults to retrieve, which is only for DEFAULT action.
82 @param[in] HelpString Help string that describes the hot key information.
83 Its value may be NULL for the unregistered hot key.
85 @retval EFI_SUCCESS Hot key is registered or unregistered.
86 @retval EFI_INVALID_PARAMETER KeyData is NULL.
90 (EFIAPI
*REGISTER_HOT_KEY
) (
91 IN EFI_INPUT_KEY
*KeyData
,
94 IN EFI_STRING HelpString OPTIONAL
98 This handler is responsbile for the left things on normal boot after all UI forms are closed.
99 For example, it can continue to boot the first boot option.
101 It will be used only when EXIT action is trigged as system level.
105 (EFIAPI
*EXIT_HANDLER
) (
110 Register Exit handler function.
111 When more than one handler function is registered, the latter one will override the previous one.
112 When NULL handler is specified, the previous Exit handler will be unregistered.
114 @param[in] Handler Pointer to handler function.
119 (EFIAPI
*REGISTER_EXIT_HANDLER
) (
120 IN EXIT_HANDLER Handler
124 Create reminder to let user to choose save or discard the changed browser data.
125 Caller can use it to actively check the changed browser data.
127 @retval BROWSER_NO_CHANGES No browser data is changed.
128 @retval BROWSER_SAVE_CHANGES The changed browser data is saved.
129 @retval BROWSER_DISCARD_CHANGES The changed browser data is discard.
130 @retval BROWSER_KEEP_CURRENT Browser keep current changes.
135 (EFIAPI
*SAVE_REMINDER
)(
139 struct _EDKII_FORM_BROWSER_EXTENSION_PROTOCOL
{
141 REGISTER_HOT_KEY RegisterHotKey
;
142 REGISTER_EXIT_HANDLER RegiserExitHandler
;
143 SAVE_REMINDER SaveReminder
;
146 extern EFI_GUID gEfiFormBrowserExProtocolGuid
;
147 extern EFI_GUID gEdkiiFormBrowserExProtocolGuid
;