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