]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.h
Fix the potential issue that using integrate as BOOLEAN value in judgment.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / BdsDxe / FrontPage.h
1 /** @file
2 FrontPage routines to handle the callbacks and browser calls
3
4 Copyright (c) 2004 - 2008, Intel Corporation. <BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _FRONT_PAGE_H_
16 #define _FRONT_PAGE_H_
17
18 #include "DeviceMngr/DeviceManager.h"
19 #include "BootMaint/BootMaint.h"
20 #include "BootMngr/BootManager.h"
21 #include "String.h"
22
23
24 //
25 // These are the VFR compiler generated data representing our VFR data.
26 //
27 extern UINT8 FrontPageVfrBin[];
28
29 extern EFI_HII_DATABASE_PROTOCOL *gHiiDatabase;
30 extern EFI_HII_STRING_PROTOCOL *gHiiString;
31 extern EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;
32 extern EFI_HII_CONFIG_ROUTING_PROTOCOL *gHiiConfigRouting;
33
34 extern UINTN gCallbackKey;
35 extern BOOLEAN gConnectAllHappened;
36
37
38 #define ONE_SECOND 10000000
39
40 ///
41 /// The size of a 3 character ISO639 language code.
42 ///
43 #define ISO_639_2_ENTRY_SIZE 3
44
45 //
46 // This is the VFR compiler generated header file which defines the
47 // string identifiers.
48 //
49 #define PRINTABLE_LANGUAGE_NAME_STRING_ID 0x0001
50
51 //
52 // These are defined as the same with vfr file
53 //
54 #define FRONT_PAGE_FORM_ID 0x1000
55
56 #define FRONT_PAGE_KEY_CONTINUE 0x1000
57 #define FRONT_PAGE_KEY_LANGUAGE 0x1234
58 #define FRONT_PAGE_KEY_BOOT_MANAGER 0x1064
59 #define FRONT_PAGE_KEY_DEVICE_MANAGER 0x8567
60 #define FRONT_PAGE_KEY_BOOT_MAINTAIN 0x9876
61
62 #define LABEL_SELECT_LANGUAGE 0x1000
63 #define LABEL_END 0xffff
64
65 #define FRONT_PAGE_FORMSET_GUID \
66 { \
67 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe} \
68 }
69
70 #define FRONT_PAGE_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('F', 'P', 'C', 'B')
71
72 typedef struct {
73 UINTN Signature;
74
75 //
76 // HII relative handles
77 //
78 EFI_HII_HANDLE HiiHandle;
79 EFI_HANDLE DriverHandle;
80 EFI_STRING_ID *LanguageToken;
81
82 //
83 // Produced protocols
84 //
85 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
86 } FRONT_PAGE_CALLBACK_DATA;
87
88 #define EFI_FP_CALLBACK_DATA_FROM_THIS(a) \
89 CR (a, \
90 FRONT_PAGE_CALLBACK_DATA, \
91 ConfigAccess, \
92 FRONT_PAGE_CALLBACK_DATA_SIGNATURE \
93 )
94
95 /**
96 This function allows a caller to extract the current configuration for one
97 or more named elements from the target driver.
98
99
100 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
101 @param Request - A null-terminated Unicode string in <ConfigRequest> format.
102 @param Progress - On return, points to a character in the Request string.
103 Points to the string's null terminator if request was successful.
104 Points to the most recent '&' before the first failing name/value
105 pair (or the beginning of the string if the failure is in the
106 first name/value pair) if the request was not successful.
107 @param Results - A null-terminated Unicode string in <ConfigAltResp> format which
108 has all values filled in for the names in the Request string.
109 String to be allocated by the called function.
110
111 @retval EFI_SUCCESS The Results is filled with the requested values.
112 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.
113 @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.
114 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
115
116 **/
117 EFI_STATUS
118 EFIAPI
119 FakeExtractConfig (
120 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
121 IN CONST EFI_STRING Request,
122 OUT EFI_STRING *Progress,
123 OUT EFI_STRING *Results
124 );
125
126 /**
127 This function processes the results of changes in configuration.
128
129
130 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
131 @param Configuration - A null-terminated Unicode string in <ConfigResp> format.
132 @param Progress - A pointer to a string filled in with the offset of the most
133 recent '&' before the first failing name/value pair (or the
134 beginning of the string if the failure is in the first
135 name/value pair) or the terminating NULL if all was successful.
136
137 @retval EFI_SUCCESS The Results is processed successfully.
138 @retval EFI_INVALID_PARAMETER Configuration is NULL.
139 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.
140
141 **/
142 EFI_STATUS
143 EFIAPI
144 FakeRouteConfig (
145 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
146 IN CONST EFI_STRING Configuration,
147 OUT EFI_STRING *Progress
148 );
149
150 /**
151 This function processes the results of changes in configuration.
152
153
154 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.
155 @param Action - Specifies the type of action taken by the browser.
156 @param QuestionId - A unique value which is sent to the original exporting driver
157 so that it can identify the type of data to expect.
158 @param Type - The type of value for the question.
159 @param Value - A pointer to the data being sent to the original exporting driver.
160 @param ActionRequest - On return, points to the action requested by the callback function.
161
162 @retval EFI_SUCCESS The callback successfully handled the action.
163 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.
164 @retval EFI_DEVICE_ERROR The variable could not be saved.
165 @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.
166
167 **/
168 EFI_STATUS
169 EFIAPI
170 FrontPageCallback (
171 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,
172 IN EFI_BROWSER_ACTION Action,
173 IN EFI_QUESTION_ID QuestionId,
174 IN UINT8 Type,
175 IN EFI_IFR_TYPE_VALUE *Value,
176 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest
177 );
178
179 /**
180 Initialize HII information for the FrontPage
181
182
183 @param InitializeHiiData TRUE if HII elements need to be initialized.
184
185 @retval EFI_SUCCESS The operation is successful.
186 @retval EFI_DEVICE_ERROR If the dynamic opcode creation failed.
187
188 **/
189 EFI_STATUS
190 InitializeFrontPage (
191 IN BOOLEAN InitializeHiiData
192 );
193
194 /**
195 Acquire the string associated with the ProducerGuid and return it.
196
197
198 @param ProducerGuid - The Guid to search the HII database for
199 @param Token - The token value of the string to extract
200 @param String - The string that is extracted
201
202 @retval EFI_SUCCESS The function returns EFI_SUCCESS always.
203
204 **/
205 EFI_STATUS
206 GetProducerString (
207 IN EFI_GUID *ProducerGuid,
208 IN EFI_STRING_ID Token,
209 OUT CHAR16 **String
210 );
211
212 /**
213 Compare two EFI_TIME data.
214
215
216 @param FirstTime - A pointer to the first EFI_TIME data.
217 @param SecondTime - A pointer to the second EFI_TIME data.
218
219 @retval TRUE The FirstTime is not later than the SecondTime.
220 @retval FALSE The FirstTime is later than the SecondTime.
221
222 **/
223 BOOLEAN
224 TimeCompare (
225 IN EFI_TIME *FirstTime,
226 IN EFI_TIME *SecondTime
227 );
228
229 /**
230 This function is the main entry of the platform setup entry.
231 The function will present the main menu of the system setup,
232 this is the platform reference part and can be customize.
233
234
235 @param TimeoutDefault - The fault time out value before the system
236 continue to boot.
237 @param ConnectAllHappened - The indicater to check if the connect all have
238 already happended.
239
240 **/
241 VOID
242 PlatformBdsEnterFrontPage (
243 IN UINT16 TimeoutDefault,
244 IN BOOLEAN ConnectAllHappened
245 );
246
247 #endif // _FRONT_PAGE_H_
248