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