]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
Update NT32/Duet platform to use new display engine and browser.
[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
5Copyright (c) 2013, 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
8The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php. \r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
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
60#define FORMSET_CLASS_MODEL_PAGE 0x0004\r
61\r
62\r
63#define FRONT_PAGE_HEADER_HEIGHT 6\r
64#define NONE_FRONT_PAGE_HEADER_HEIGHT 3\r
65#define FOOTER_HEIGHT 4\r
66#define STATUS_BAR_HEIGHT 1\r
67\r
68//\r
69// Screen definitions\r
70//\r
71#define BANNER_HEIGHT 6\r
72#define BANNER_COLUMNS 3\r
73#define BANNER_LEFT_COLUMN_INDENT 1\r
74\r
75//\r
76// Character definitions\r
77//\r
78#define UPPER_LOWER_CASE_OFFSET 0x20\r
79\r
80//\r
81// This is the Input Error Message\r
82//\r
83#define INPUT_ERROR 1\r
84\r
85//\r
86// This is the NV RAM update required Message\r
87//\r
88#define NV_UPDATE_REQUIRED 2\r
89\r
90typedef struct {\r
91 EFI_STRING_ID Banner[BANNER_HEIGHT][BANNER_COLUMNS];\r
92} BANNER_DATA;\r
93\r
94extern UINT16 gClassOfVfr; // Formset class information\r
95extern BANNER_DATA *gBannerData;\r
96extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;\r
97extern UINTN gFooterHeight;\r
98\r
99//\r
100// Browser Global Strings\r
101//\r
102extern CHAR16 *gEnterString;\r
103extern CHAR16 *gEnterCommitString;\r
104extern CHAR16 *gEnterEscapeString;\r
105extern CHAR16 *gEscapeString;\r
106extern CHAR16 *gMoveHighlight;\r
107extern CHAR16 *gDecNumericInput;\r
108extern CHAR16 *gHexNumericInput;\r
109extern CHAR16 *gToggleCheckBox;\r
110extern CHAR16 *gLibEmptyString;\r
111extern CHAR16 *gAreYouSure;\r
112extern CHAR16 *gYesResponse;\r
113extern CHAR16 *gNoResponse;\r
114extern CHAR16 *gPlusString;\r
115extern CHAR16 *gMinusString;\r
116extern CHAR16 *gAdjustNumber;\r
117extern CHAR16 *gSaveChanges;\r
118extern CHAR16 *gNvUpdateMessage;\r
119extern CHAR16 *gInputErrorMessage;\r
120/**\r
121\r
122 Print banner info for front page.\r
123\r
124 @param[in] FormData Form Data to be shown in Page\r
125 \r
126**/\r
127VOID\r
128PrintBannerInfo ( \r
129 IN FORM_DISPLAY_ENGINE_FORM *FormData\r
130 );\r
131\r
132/**\r
133\r
134 Print framework for a page.\r
135 \r
136**/\r
137VOID\r
138PrintFramework (\r
139 VOID\r
140 );\r
141 \r
142/**\r
143 Print the form title.\r
144\r
145 @param[in] FormData Form Data to be shown in Page\r
146\r
147**/\r
148VOID\r
149PrintFormTitle (\r
150 IN FORM_DISPLAY_ENGINE_FORM *FormData\r
151 );\r
152\r
153/**\r
154 Validate the input screen diemenstion info.\r
155\r
156 @param FormData The input form data info.\r
157\r
158 @return EFI_SUCCESS The input screen info is acceptable.\r
159 @return EFI_INVALID_PARAMETER The input screen info is not acceptable.\r
160\r
161**/\r
162EFI_STATUS \r
163ScreenDiemensionInfoValidate (\r
164 IN FORM_DISPLAY_ENGINE_FORM *FormData\r
165 );\r
166\r
167/**\r
168 Get the string based on the StringId and HII Package List Handle.\r
169\r
170 @param Token The String's ID.\r
171 @param HiiHandle The package list in the HII database to search for\r
172 the specified string.\r
173\r
174 @return The output string.\r
175\r
176**/\r
177CHAR16 *\r
178LibGetToken (\r
179 IN EFI_STRING_ID Token,\r
180 IN EFI_HII_HANDLE HiiHandle\r
181 );\r
182\r
183/**\r
184 Count the storage space of a Unicode string.\r
185\r
186 This function handles the Unicode string with NARROW_CHAR\r
187 and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR\r
188 does not count in the resultant output. If a WIDE_CHAR is\r
189 hit, then 2 Unicode character will consume an output storage\r
190 space with size of CHAR16 till a NARROW_CHAR is hit.\r
191\r
192 If String is NULL, then ASSERT ().\r
193\r
194 @param String The input string to be counted.\r
195\r
196 @return Storage space for the input string.\r
197\r
198**/\r
199UINTN\r
200LibGetStringWidth (\r
201 IN CHAR16 *String\r
202 );\r
203\r
204/**\r
205 Show all registered HotKey help strings on bottom Rows.\r
206\r
207 @param FormData The curent input form data info.\r
208\r
209**/\r
210VOID\r
211PrintHotKeyHelpString (\r
212 IN FORM_DISPLAY_ENGINE_FORM *FormData\r
213 );\r
214 \r
215/**\r
216 Get step info from numeric opcode.\r
217 \r
218 @param[in] OpCode The input numeric op code.\r
219\r
220 @return step info for this opcode.\r
221**/\r
222UINT64\r
223LibGetFieldFromNum (\r
224 IN EFI_IFR_OP_HEADER *OpCode\r
225 );\r
226\r
227/**\r
228 Initialize the HII String Token to the correct values.\r
229\r
230**/\r
231VOID\r
232InitializeLibStrings (\r
233 VOID\r
234 );\r
235\r
236/**\r
237 Free the HII String.\r
238\r
239**/\r
240VOID\r
241FreeLibStrings (\r
242 VOID\r
243 );\r
244\r
245/**\r
246 Wait for a key to be pressed by user.\r
247\r
248 @param Key The key which is pressed by user.\r
249\r
250 @retval EFI_SUCCESS The function always completed successfully.\r
251\r
252**/\r
253EFI_STATUS\r
254WaitForKeyStroke (\r
255 OUT EFI_INPUT_KEY *Key\r
256 );\r
257\r
258/**\r
259 Set Buffer to Value for Size bytes.\r
260\r
261 @param Buffer Memory to set.\r
262 @param Size Number of bytes to set\r
263 @param Value Value of the set operation.\r
264\r
265**/\r
266VOID\r
267LibSetUnicodeMem (\r
268 IN VOID *Buffer,\r
269 IN UINTN Size,\r
270 IN CHAR16 Value\r
271 );\r
272\r
273/**\r
274 Prints a formatted unicode string to the default console, at\r
275 the supplied cursor position.\r
276\r
277 @param Width Width of String to be printed.\r
278 @param Column The cursor position to print the string at.\r
279 @param Row The cursor position to print the string at.\r
280 @param Fmt Format string.\r
281 @param ... Variable argument list for format string.\r
282\r
283 @return Length of string printed to the console\r
284\r
285**/\r
286UINTN\r
287EFIAPI\r
288PrintAt (\r
289 IN UINTN Width,\r
290 IN UINTN Column,\r
291 IN UINTN Row,\r
292 IN CHAR16 *Fmt,\r
293 ...\r
294 );\r
295\r
296/**\r
297 Process some op codes which is out side of current form.\r
298 \r
299 @param FormData Pointer to the form data.\r
300\r
301**/\r
302VOID\r
303ProcessExternedOpcode (\r
304 IN FORM_DISPLAY_ENGINE_FORM *FormData\r
305 );\r
306\r
307#endif\r