]>
Commit | Line | Data |
---|---|---|
5c08e117 | 1 | /** @file\r |
2 | FrontPage routines to handle the callbacks and browser calls\r | |
3 | \r | |
4 | Copyright (c) 2004 - 2008, Intel Corporation. <BR>\r | |
5 | All rights reserved. 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 | #define ONE_SECOND 10000000\r | |
24 | \r | |
25 | //\r | |
26 | // This is the VFR compiler generated header file which defines the\r | |
27 | // string identifiers.\r | |
28 | //\r | |
29 | #define PRINTABLE_LANGUAGE_NAME_STRING_ID 0x0001\r | |
30 | \r | |
31 | //\r | |
32 | // These are defined as the same with vfr file\r | |
33 | //\r | |
34 | #define FRONT_PAGE_FORM_ID 0x1000\r | |
35 | \r | |
36 | #define FRONT_PAGE_KEY_CONTINUE 0x1000\r | |
37 | #define FRONT_PAGE_KEY_LANGUAGE 0x1234\r | |
38 | #define FRONT_PAGE_KEY_BOOT_MANAGER 0x1064\r | |
39 | #define FRONT_PAGE_KEY_DEVICE_MANAGER 0x8567\r | |
40 | #define FRONT_PAGE_KEY_BOOT_MAINTAIN 0x9876\r | |
41 | \r | |
42 | #define LABEL_SELECT_LANGUAGE 0x1000\r | |
43 | \r | |
44 | #define FRONT_PAGE_FORMSET_GUID \\r | |
45 | { \\r | |
46 | 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe} \\r | |
47 | }\r | |
48 | \r | |
49 | #define FRONT_PAGE_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('F', 'P', 'C', 'B')\r | |
50 | \r | |
51 | typedef struct {\r | |
52 | UINTN Signature;\r | |
53 | \r | |
54 | //\r | |
55 | // HII relative handles\r | |
56 | //\r | |
57 | EFI_HII_HANDLE HiiHandle;\r | |
58 | EFI_HANDLE DriverHandle;\r | |
59 | EFI_STRING_ID *LanguageToken;\r | |
60 | \r | |
61 | //\r | |
62 | // Produced protocols\r | |
63 | //\r | |
64 | EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r | |
65 | } FRONT_PAGE_CALLBACK_DATA;\r | |
66 | \r | |
67 | #define EFI_FP_CALLBACK_DATA_FROM_THIS(a) \\r | |
68 | CR (a, \\r | |
69 | FRONT_PAGE_CALLBACK_DATA, \\r | |
70 | ConfigAccess, \\r | |
71 | FRONT_PAGE_CALLBACK_DATA_SIGNATURE \\r | |
72 | )\r | |
73 | \r | |
74 | //\r | |
75 | // These are the VFR compiler generated data representing our VFR data.\r | |
76 | //\r | |
77 | extern UINT8 FrontPageVfrBin[];\r | |
78 | \r | |
79 | extern EFI_HII_DATABASE_PROTOCOL *gHiiDatabase;\r | |
80 | extern EFI_HII_STRING_PROTOCOL *gHiiString;\r | |
81 | extern EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;\r | |
82 | extern EFI_HII_CONFIG_ROUTING_PROTOCOL *gHiiConfigRouting;\r | |
83 | \r | |
84 | extern UINTN gCallbackKey;\r | |
85 | extern BOOLEAN gConnectAllHappened;\r | |
86 | \r | |
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 | |
109 | EFI_STATUS\r | |
110 | EFIAPI\r | |
111 | FakeExtractConfig (\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 | |
134 | EFI_STATUS\r | |
135 | EFIAPI\r | |
136 | FakeRouteConfig (\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 | |
160 | EFI_STATUS\r | |
161 | EFIAPI\r | |
162 | FrontPageCallback (\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 | |
181 | EFI_STATUS\r | |
182 | InitializeFrontPage (\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 | |
197 | EFI_STATUS\r | |
198 | GetProducerString (\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 | |
215 | BOOLEAN\r | |
216 | TimeCompare (\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 | |
230 | already happended.\r | |
231 | \r | |
232 | **/\r | |
233 | VOID\r | |
234 | PlatformBdsEnterFrontPage (\r | |
235 | IN UINT16 TimeoutDefault,\r | |
236 | IN BOOLEAN ConnectAllHappened\r | |
237 | );\r | |
238 | \r | |
239 | #endif // _FRONT_PAGE_H_\r | |
240 | \r |