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