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