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