]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / MdeModulePkg / Library / CustomizedDisplayLib / CustomizedDisplayLibInternal.h
CommitLineData
7c6c064c
ED
1/** @file\r
2\r
3 This library class defines a set of interfaces to customize Display module\r
4\r
d1102dba 5Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>\r
9d510e61 6SPDX-License-Identifier: BSD-2-Clause-Patent\r
7c6c064c
ED
7\r
8**/\r
9\r
10#ifndef __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__\r
11#define __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__\r
12\r
7c6c064c
ED
13#include <PiDxe.h>\r
14\r
15#include <Protocol/SimpleTextOut.h>\r
16#include <Protocol/SimpleTextIn.h>\r
17#include <Protocol/FormBrowser2.h>\r
18#include <Protocol/FormBrowserEx2.h>\r
19#include <Protocol/DisplayProtocol.h>\r
20#include <Protocol/DevicePath.h>\r
21#include <Protocol/UnicodeCollation.h>\r
22#include <Protocol/HiiConfigAccess.h>\r
23#include <Protocol/HiiConfigRouting.h>\r
24#include <Protocol/HiiDatabase.h>\r
25#include <Protocol/HiiString.h>\r
26#include <Protocol/UserManager.h>\r
27#include <Protocol/DevicePathFromText.h>\r
28\r
29#include <Guid/MdeModuleHii.h>\r
30#include <Guid/HiiPlatformSetupFormset.h>\r
31#include <Guid/HiiFormMapMethodGuid.h>\r
32\r
33#include <Library/PrintLib.h>\r
34#include <Library/DebugLib.h>\r
35#include <Library/BaseMemoryLib.h>\r
36#include <Library/UefiRuntimeServicesTableLib.h>\r
37#include <Library/UefiDriverEntryPoint.h>\r
38#include <Library/UefiBootServicesTableLib.h>\r
39#include <Library/BaseLib.h>\r
40#include <Library/MemoryAllocationLib.h>\r
41#include <Library/HiiLib.h>\r
42#include <Library/PcdLib.h>\r
43#include <Library/DevicePathLib.h>\r
44#include <Library/CustomizedDisplayLib.h>\r
45\r
46#include "Colors.h"\r
47\r
1436aea4
MK
48#define FORMSET_CLASS_PLATFORM_SETUP 0x0001\r
49#define FORMSET_CLASS_FRONT_PAGE 0x0002\r
7c6c064c 50\r
1436aea4
MK
51#define FRONT_PAGE_HEADER_HEIGHT 6\r
52#define NONE_FRONT_PAGE_HEADER_HEIGHT 3\r
53#define FOOTER_HEIGHT 4\r
54#define STATUS_BAR_HEIGHT 1\r
7c6c064c
ED
55\r
56//\r
57// Screen definitions\r
58//\r
1436aea4
MK
59#define BANNER_HEIGHT 6\r
60#define BANNER_COLUMNS 3\r
61#define BANNER_LEFT_COLUMN_INDENT 1\r
7c6c064c
ED
62\r
63//\r
64// Character definitions\r
65//\r
1436aea4 66#define UPPER_LOWER_CASE_OFFSET 0x20\r
7c6c064c
ED
67\r
68//\r
69// This is the Input Error Message\r
70//\r
1436aea4 71#define INPUT_ERROR 1\r
7c6c064c
ED
72\r
73//\r
74// This is the NV RAM update required Message\r
75//\r
76#define NV_UPDATE_REQUIRED 2\r
77\r
78typedef struct {\r
1436aea4 79 EFI_STRING_ID Banner[BANNER_HEIGHT][BANNER_COLUMNS];\r
7c6c064c
ED
80} BANNER_DATA;\r
81\r
1436aea4
MK
82extern UINT16 gClassOfVfr; // Formset class information\r
83extern BANNER_DATA *gBannerData;\r
84extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;\r
85extern UINTN gFooterHeight;\r
7c6c064c
ED
86\r
87//\r
88// Browser Global Strings\r
89//\r
1436aea4
MK
90extern CHAR16 *gEnterString;\r
91extern CHAR16 *gEnterCommitString;\r
92extern CHAR16 *gEnterEscapeString;\r
93extern CHAR16 *gEscapeString;\r
94extern CHAR16 *gMoveHighlight;\r
95extern CHAR16 *gDecNumericInput;\r
96extern CHAR16 *gHexNumericInput;\r
97extern CHAR16 *gToggleCheckBox;\r
98extern CHAR16 *gLibEmptyString;\r
99extern CHAR16 *gAreYouSure;\r
100extern CHAR16 *gYesResponse;\r
101extern CHAR16 *gNoResponse;\r
102extern CHAR16 *gPlusString;\r
103extern CHAR16 *gMinusString;\r
104extern CHAR16 *gAdjustNumber;\r
105extern CHAR16 *gSaveChanges;\r
106extern CHAR16 *gNvUpdateMessage;\r
107extern CHAR16 *gInputErrorMessage;\r
108\r
7c6c064c
ED
109/**\r
110\r
111 Print banner info for front page.\r
112\r
113 @param[in] FormData Form Data to be shown in Page\r
d1102dba 114\r
7c6c064c
ED
115**/\r
116VOID\r
d1102dba 117PrintBannerInfo (\r
1436aea4 118 IN FORM_DISPLAY_ENGINE_FORM *FormData\r
7c6c064c
ED
119 );\r
120\r
121/**\r
5a9f73bf 122 Print framework and form title for a page.\r
7c6c064c
ED
123\r
124 @param[in] FormData Form Data to be shown in Page\r
7c6c064c
ED
125**/\r
126VOID\r
5a9f73bf 127PrintFramework (\r
1436aea4 128 IN FORM_DISPLAY_ENGINE_FORM *FormData\r
7c6c064c
ED
129 );\r
130\r
131/**\r
132 Validate the input screen diemenstion info.\r
133\r
134 @param FormData The input form data info.\r
135\r
136 @return EFI_SUCCESS The input screen info is acceptable.\r
137 @return EFI_INVALID_PARAMETER The input screen info is not acceptable.\r
138\r
139**/\r
d1102dba 140EFI_STATUS\r
7c6c064c 141ScreenDiemensionInfoValidate (\r
1436aea4 142 IN FORM_DISPLAY_ENGINE_FORM *FormData\r
7c6c064c
ED
143 );\r
144\r
145/**\r
146 Get the string based on the StringId and HII Package List Handle.\r
147\r
148 @param Token The String's ID.\r
149 @param HiiHandle The package list in the HII database to search for\r
150 the specified string.\r
151\r
152 @return The output string.\r
153\r
154**/\r
155CHAR16 *\r
156LibGetToken (\r
1436aea4
MK
157 IN EFI_STRING_ID Token,\r
158 IN EFI_HII_HANDLE HiiHandle\r
7c6c064c
ED
159 );\r
160\r
161/**\r
162 Count the storage space of a Unicode string.\r
163\r
164 This function handles the Unicode string with NARROW_CHAR\r
165 and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR\r
166 does not count in the resultant output. If a WIDE_CHAR is\r
167 hit, then 2 Unicode character will consume an output storage\r
168 space with size of CHAR16 till a NARROW_CHAR is hit.\r
169\r
170 If String is NULL, then ASSERT ().\r
171\r
172 @param String The input string to be counted.\r
173\r
174 @return Storage space for the input string.\r
175\r
176**/\r
177UINTN\r
178LibGetStringWidth (\r
1436aea4 179 IN CHAR16 *String\r
7c6c064c
ED
180 );\r
181\r
182/**\r
183 Show all registered HotKey help strings on bottom Rows.\r
184\r
185 @param FormData The curent input form data info.\r
af047db7 186 @param SetState Set HotKey or Clear HotKey\r
7c6c064c
ED
187\r
188**/\r
189VOID\r
190PrintHotKeyHelpString (\r
1436aea4
MK
191 IN FORM_DISPLAY_ENGINE_FORM *FormData,\r
192 IN BOOLEAN SetState\r
7c6c064c 193 );\r
d1102dba 194\r
7c6c064c
ED
195/**\r
196 Get step info from numeric opcode.\r
d1102dba 197\r
7c6c064c
ED
198 @param[in] OpCode The input numeric op code.\r
199\r
200 @return step info for this opcode.\r
201**/\r
202UINT64\r
203LibGetFieldFromNum (\r
1436aea4 204 IN EFI_IFR_OP_HEADER *OpCode\r
7c6c064c
ED
205 );\r
206\r
207/**\r
208 Initialize the HII String Token to the correct values.\r
209\r
210**/\r
211VOID\r
212InitializeLibStrings (\r
213 VOID\r
214 );\r
215\r
216/**\r
217 Free the HII String.\r
218\r
219**/\r
220VOID\r
221FreeLibStrings (\r
222 VOID\r
223 );\r
224\r
225/**\r
226 Wait for a key to be pressed by user.\r
227\r
228 @param Key The key which is pressed by user.\r
229\r
230 @retval EFI_SUCCESS The function always completed successfully.\r
231\r
232**/\r
233EFI_STATUS\r
234WaitForKeyStroke (\r
1436aea4 235 OUT EFI_INPUT_KEY *Key\r
7c6c064c
ED
236 );\r
237\r
238/**\r
239 Set Buffer to Value for Size bytes.\r
240\r
241 @param Buffer Memory to set.\r
242 @param Size Number of bytes to set\r
243 @param Value Value of the set operation.\r
244\r
245**/\r
246VOID\r
247LibSetUnicodeMem (\r
1436aea4
MK
248 IN VOID *Buffer,\r
249 IN UINTN Size,\r
250 IN CHAR16 Value\r
7c6c064c
ED
251 );\r
252\r
253/**\r
254 Prints a formatted unicode string to the default console, at\r
255 the supplied cursor position.\r
256\r
257 @param Width Width of String to be printed.\r
258 @param Column The cursor position to print the string at.\r
259 @param Row The cursor position to print the string at.\r
260 @param Fmt Format string.\r
261 @param ... Variable argument list for format string.\r
262\r
263 @return Length of string printed to the console\r
264\r
265**/\r
266UINTN\r
267EFIAPI\r
268PrintAt (\r
1436aea4
MK
269 IN UINTN Width,\r
270 IN UINTN Column,\r
271 IN UINTN Row,\r
272 IN CHAR16 *Fmt,\r
7c6c064c
ED
273 ...\r
274 );\r
275\r
276/**\r
277 Process some op codes which is out side of current form.\r
d1102dba 278\r
7c6c064c
ED
279 @param FormData Pointer to the form data.\r
280\r
281**/\r
282VOID\r
283ProcessExternedOpcode (\r
1436aea4 284 IN FORM_DISPLAY_ENGINE_FORM *FormData\r
7c6c064c
ED
285 );\r
286\r
287#endif\r