3 This library class defines a set of interfaces to customize Display module
5 Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
10 #ifndef __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__
11 #define __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__
17 #include <Protocol/SimpleTextOut.h>
18 #include <Protocol/SimpleTextIn.h>
19 #include <Protocol/FormBrowser2.h>
20 #include <Protocol/FormBrowserEx2.h>
21 #include <Protocol/DisplayProtocol.h>
22 #include <Protocol/DevicePath.h>
23 #include <Protocol/UnicodeCollation.h>
24 #include <Protocol/HiiConfigAccess.h>
25 #include <Protocol/HiiConfigRouting.h>
26 #include <Protocol/HiiDatabase.h>
27 #include <Protocol/HiiString.h>
28 #include <Protocol/UserManager.h>
29 #include <Protocol/DevicePathFromText.h>
31 #include <Guid/MdeModuleHii.h>
32 #include <Guid/HiiPlatformSetupFormset.h>
33 #include <Guid/HiiFormMapMethodGuid.h>
35 #include <Library/PrintLib.h>
36 #include <Library/DebugLib.h>
37 #include <Library/BaseMemoryLib.h>
38 #include <Library/UefiRuntimeServicesTableLib.h>
39 #include <Library/UefiDriverEntryPoint.h>
40 #include <Library/UefiBootServicesTableLib.h>
41 #include <Library/BaseLib.h>
42 #include <Library/MemoryAllocationLib.h>
43 #include <Library/HiiLib.h>
44 #include <Library/PcdLib.h>
45 #include <Library/DevicePathLib.h>
46 #include <Library/CustomizedDisplayLib.h>
52 #define FORMSET_CLASS_PLATFORM_SETUP 0x0001
53 #define FORMSET_CLASS_FRONT_PAGE 0x0002
56 #define FRONT_PAGE_HEADER_HEIGHT 6
57 #define NONE_FRONT_PAGE_HEADER_HEIGHT 3
58 #define FOOTER_HEIGHT 4
59 #define STATUS_BAR_HEIGHT 1
64 #define BANNER_HEIGHT 6
65 #define BANNER_COLUMNS 3
66 #define BANNER_LEFT_COLUMN_INDENT 1
69 // Character definitions
71 #define UPPER_LOWER_CASE_OFFSET 0x20
74 // This is the Input Error Message
79 // This is the NV RAM update required Message
81 #define NV_UPDATE_REQUIRED 2
84 EFI_STRING_ID Banner
[BANNER_HEIGHT
][BANNER_COLUMNS
];
87 extern UINT16 gClassOfVfr
; // Formset class information
88 extern BANNER_DATA
*gBannerData
;
89 extern EFI_SCREEN_DESCRIPTOR gScreenDimensions
;
90 extern UINTN gFooterHeight
;
93 // Browser Global Strings
95 extern CHAR16
*gEnterString
;
96 extern CHAR16
*gEnterCommitString
;
97 extern CHAR16
*gEnterEscapeString
;
98 extern CHAR16
*gEscapeString
;
99 extern CHAR16
*gMoveHighlight
;
100 extern CHAR16
*gDecNumericInput
;
101 extern CHAR16
*gHexNumericInput
;
102 extern CHAR16
*gToggleCheckBox
;
103 extern CHAR16
*gLibEmptyString
;
104 extern CHAR16
*gAreYouSure
;
105 extern CHAR16
*gYesResponse
;
106 extern CHAR16
*gNoResponse
;
107 extern CHAR16
*gPlusString
;
108 extern CHAR16
*gMinusString
;
109 extern CHAR16
*gAdjustNumber
;
110 extern CHAR16
*gSaveChanges
;
111 extern CHAR16
*gNvUpdateMessage
;
112 extern CHAR16
*gInputErrorMessage
;
115 Print banner info for front page.
117 @param[in] FormData Form Data to be shown in Page
122 IN FORM_DISPLAY_ENGINE_FORM
*FormData
126 Print framework and form title for a page.
128 @param[in] FormData Form Data to be shown in Page
132 IN FORM_DISPLAY_ENGINE_FORM
*FormData
136 Validate the input screen diemenstion info.
138 @param FormData The input form data info.
140 @return EFI_SUCCESS The input screen info is acceptable.
141 @return EFI_INVALID_PARAMETER The input screen info is not acceptable.
145 ScreenDiemensionInfoValidate (
146 IN FORM_DISPLAY_ENGINE_FORM
*FormData
150 Get the string based on the StringId and HII Package List Handle.
152 @param Token The String's ID.
153 @param HiiHandle The package list in the HII database to search for
154 the specified string.
156 @return The output string.
161 IN EFI_STRING_ID Token
,
162 IN EFI_HII_HANDLE HiiHandle
166 Count the storage space of a Unicode string.
168 This function handles the Unicode string with NARROW_CHAR
169 and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR
170 does not count in the resultant output. If a WIDE_CHAR is
171 hit, then 2 Unicode character will consume an output storage
172 space with size of CHAR16 till a NARROW_CHAR is hit.
174 If String is NULL, then ASSERT ().
176 @param String The input string to be counted.
178 @return Storage space for the input string.
187 Show all registered HotKey help strings on bottom Rows.
189 @param FormData The curent input form data info.
190 @param SetState Set HotKey or Clear HotKey
194 PrintHotKeyHelpString (
195 IN FORM_DISPLAY_ENGINE_FORM
*FormData
,
200 Get step info from numeric opcode.
202 @param[in] OpCode The input numeric op code.
204 @return step info for this opcode.
208 IN EFI_IFR_OP_HEADER
*OpCode
212 Initialize the HII String Token to the correct values.
216 InitializeLibStrings (
230 Wait for a key to be pressed by user.
232 @param Key The key which is pressed by user.
234 @retval EFI_SUCCESS The function always completed successfully.
239 OUT EFI_INPUT_KEY
*Key
243 Set Buffer to Value for Size bytes.
245 @param Buffer Memory to set.
246 @param Size Number of bytes to set
247 @param Value Value of the set operation.
258 Prints a formatted unicode string to the default console, at
259 the supplied cursor position.
261 @param Width Width of String to be printed.
262 @param Column The cursor position to print the string at.
263 @param Row The cursor position to print the string at.
264 @param Fmt Format string.
265 @param ... Variable argument list for format string.
267 @return Length of string printed to the console
281 Process some op codes which is out side of current form.
283 @param FormData Pointer to the form data.
287 ProcessExternedOpcode (
288 IN FORM_DISPLAY_ENGINE_FORM
*FormData