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