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