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