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