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