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