]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Application/UiApp/FrontPage.h
MdeModulePkg:Refine the UiApp
[mirror_edk2.git] / MdeModulePkg / Application / UiApp / FrontPage.h
CommitLineData
143f0b1d 1/** @file\r
ce7690e2 2Head file for front page.\r
143f0b1d 3\r
afc244a5 4Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>\r
143f0b1d
ED
5This 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
143f0b1d 18#include "String.h"\r
ce7690e2 19#include "Ui.h"\r
143f0b1d
ED
20\r
21#include <Protocol/BootLogo.h>\r
22//\r
ce7690e2 23// These is the VFR compiler generated data representing our VFR data.\r
143f0b1d
ED
24//\r
25extern UINT8 FrontPageVfrBin[];\r
26\r
27extern EFI_FORM_BROWSER2_PROTOCOL *gFormBrowser2;\r
28\r
29extern BOOLEAN gConnectAllHappened;\r
30\r
31#define SMBIOS_TYPE4_CPU_SOCKET_POPULATED BIT6\r
32\r
143f0b1d
ED
33//\r
34// This is the VFR compiler generated header file which defines the\r
35// string identifiers.\r
36//\r
37#define PRINTABLE_LANGUAGE_NAME_STRING_ID 0x0001\r
38\r
39//\r
40// These are defined as the same with vfr file\r
41//\r
42#define FRONT_PAGE_FORM_ID 0x1000\r
143f0b1d 43\r
143f0b1d
ED
44#define FRONT_PAGE_KEY_OFFSET 0x4000\r
45#define FRONT_PAGE_KEY_CONTINUE 0x1000\r
46#define FRONT_PAGE_KEY_LANGUAGE 0x1234\r
143f0b1d
ED
47\r
48#define LABEL_SELECT_LANGUAGE 0x1000\r
49#define LABEL_PLATFORM_INFORMATION 0x1001\r
50#define LABEL_END 0xffff\r
51\r
52#define FRONT_PAGE_FORMSET_GUID \\r
53 { \\r
54 0x9e0c30bc, 0x3f06, 0x4ba6, {0x82, 0x88, 0x9, 0x17, 0x9b, 0x85, 0x5d, 0xbe} \\r
55 }\r
56\r
57#define FRONT_PAGE_CALLBACK_DATA_SIGNATURE SIGNATURE_32 ('F', 'P', 'C', 'B')\r
58\r
59typedef struct {\r
60 UINTN Signature;\r
61\r
62 //\r
63 // HII relative handles\r
64 //\r
65 EFI_HII_HANDLE HiiHandle;\r
66 EFI_HANDLE DriverHandle;\r
67 EFI_STRING_ID *LanguageToken;\r
68\r
69 //\r
70 // Produced protocols\r
71 //\r
72 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r
73} FRONT_PAGE_CALLBACK_DATA;\r
74\r
75\r
76#define EFI_FP_CALLBACK_DATA_FROM_THIS(a) \\r
77 CR (a, \\r
78 FRONT_PAGE_CALLBACK_DATA, \\r
79 ConfigAccess, \\r
80 FRONT_PAGE_CALLBACK_DATA_SIGNATURE \\r
81 )\r
82\r
83/**\r
84 This function allows a caller to extract the current configuration for one\r
85 or more named elements from the target driver.\r
86\r
87\r
88 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
89 @param Request - A null-terminated Unicode string in <ConfigRequest> format.\r
90 @param Progress - On return, points to a character in the Request string.\r
91 Points to the string's null terminator if request was successful.\r
92 Points to the most recent '&' before the first failing name/value\r
93 pair (or the beginning of the string if the failure is in the\r
94 first name/value pair) if the request was not successful.\r
95 @param Results - A null-terminated Unicode string in <ConfigAltResp> format which\r
96 has all values filled in for the names in the Request string.\r
97 String to be allocated by the called function.\r
98\r
99 @retval EFI_SUCCESS The Results is filled with the requested values.\r
100 @retval EFI_OUT_OF_RESOURCES Not enough memory to store the results.\r
101 @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.\r
102 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r
103\r
104**/\r
105EFI_STATUS\r
106EFIAPI\r
107FakeExtractConfig (\r
108 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
109 IN CONST EFI_STRING Request,\r
110 OUT EFI_STRING *Progress,\r
111 OUT EFI_STRING *Results\r
112 );\r
113\r
114/**\r
115 This function processes the results of changes in configuration.\r
116\r
117\r
118 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
119 @param Configuration - A null-terminated Unicode string in <ConfigResp> format.\r
120 @param Progress - A pointer to a string filled in with the offset of the most\r
121 recent '&' before the first failing name/value pair (or the\r
122 beginning of the string if the failure is in the first\r
123 name/value pair) or the terminating NULL if all was successful.\r
124\r
125 @retval EFI_SUCCESS The Results is processed successfully.\r
126 @retval EFI_INVALID_PARAMETER Configuration is NULL.\r
127 @retval EFI_NOT_FOUND Routing data doesn't match any storage in this driver.\r
128\r
129**/\r
130EFI_STATUS\r
131EFIAPI\r
132FakeRouteConfig (\r
133 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
134 IN CONST EFI_STRING Configuration,\r
135 OUT EFI_STRING *Progress\r
136 );\r
137\r
138/**\r
139 This function processes the results of changes in configuration.\r
140\r
141\r
142 @param This - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
143 @param Action - Specifies the type of action taken by the browser.\r
144 @param QuestionId - A unique value which is sent to the original exporting driver\r
145 so that it can identify the type of data to expect.\r
146 @param Type - The type of value for the question.\r
147 @param Value - A pointer to the data being sent to the original exporting driver.\r
148 @param ActionRequest - On return, points to the action requested by the callback function.\r
149\r
150 @retval EFI_SUCCESS The callback successfully handled the action.\r
151 @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r
152 @retval EFI_DEVICE_ERROR The variable could not be saved.\r
153 @retval EFI_UNSUPPORTED The specified Action is not supported by the callback.\r
154\r
155**/\r
156EFI_STATUS\r
157EFIAPI\r
158FrontPageCallback (\r
159 IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL *This,\r
160 IN EFI_BROWSER_ACTION Action,\r
161 IN EFI_QUESTION_ID QuestionId,\r
162 IN UINT8 Type,\r
163 IN EFI_IFR_TYPE_VALUE *Value,\r
164 OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest\r
165 );\r
166\r
167/**\r
168 Initialize HII information for the FrontPage\r
169\r
170 @retval EFI_SUCCESS The operation is successful.\r
171 @retval EFI_DEVICE_ERROR If the dynamic opcode creation failed.\r
172\r
173**/\r
174EFI_STATUS\r
175InitializeFrontPage (\r
176 VOID\r
177 );\r
178\r
179/**\r
180 Acquire the string associated with the ProducerGuid and return it.\r
181\r
182\r
183 @param ProducerGuid - The Guid to search the HII database for\r
184 @param Token - The token value of the string to extract\r
185 @param String - The string that is extracted\r
186\r
187 @retval EFI_SUCCESS The function returns EFI_SUCCESS always.\r
188\r
189**/\r
190EFI_STATUS\r
191GetProducerString (\r
192 IN EFI_GUID *ProducerGuid,\r
193 IN EFI_STRING_ID Token,\r
194 OUT CHAR16 **String\r
195 );\r
196\r
197/**\r
198 This function is the main entry of the UI entry.\r
199 The function will present the main menu of the system UI.\r
200\r
201 @param ConnectAllHappened Caller passes the value to UI to avoid unnecessary connect-all.\r
202\r
203**/\r
204VOID\r
205EFIAPI\r
206UiEntry (\r
207 IN BOOLEAN ConnectAllHappened\r
208 );\r
209\r
143f0b1d
ED
210/**\r
211 Extract device path for given HII handle and class guid.\r
212\r
213 @param Handle The HII handle.\r
214\r
215 @retval NULL Fail to get the device path string.\r
216 @return PathString Get the device path string.\r
217\r
218**/\r
219CHAR16 *\r
220ExtractDevicePathFromHiiHandle (\r
221 IN EFI_HII_HANDLE Handle\r
222 );\r
223\r
143f0b1d
ED
224#endif // _FRONT_PAGE_H_\r
225\r