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__
15 #include <Protocol/SimpleTextOut.h>
16 #include <Protocol/SimpleTextIn.h>
17 #include <Protocol/FormBrowser2.h>
18 #include <Protocol/FormBrowserEx2.h>
19 #include <Protocol/DisplayProtocol.h>
20 #include <Protocol/DevicePath.h>
21 #include <Protocol/UnicodeCollation.h>
22 #include <Protocol/HiiConfigAccess.h>
23 #include <Protocol/HiiConfigRouting.h>
24 #include <Protocol/HiiDatabase.h>
25 #include <Protocol/HiiString.h>
26 #include <Protocol/UserManager.h>
27 #include <Protocol/DevicePathFromText.h>
29 #include <Guid/MdeModuleHii.h>
30 #include <Guid/HiiPlatformSetupFormset.h>
31 #include <Guid/HiiFormMapMethodGuid.h>
33 #include <Library/PrintLib.h>
34 #include <Library/DebugLib.h>
35 #include <Library/BaseMemoryLib.h>
36 #include <Library/UefiRuntimeServicesTableLib.h>
37 #include <Library/UefiDriverEntryPoint.h>
38 #include <Library/UefiBootServicesTableLib.h>
39 #include <Library/BaseLib.h>
40 #include <Library/MemoryAllocationLib.h>
41 #include <Library/HiiLib.h>
42 #include <Library/PcdLib.h>
43 #include <Library/DevicePathLib.h>
44 #include <Library/CustomizedDisplayLib.h>
48 #define FORMSET_CLASS_PLATFORM_SETUP 0x0001
49 #define FORMSET_CLASS_FRONT_PAGE 0x0002
51 #define FRONT_PAGE_HEADER_HEIGHT 6
52 #define NONE_FRONT_PAGE_HEADER_HEIGHT 3
53 #define FOOTER_HEIGHT 4
54 #define STATUS_BAR_HEIGHT 1
59 #define BANNER_HEIGHT 6
60 #define BANNER_COLUMNS 3
61 #define BANNER_LEFT_COLUMN_INDENT 1
64 // Character definitions
66 #define UPPER_LOWER_CASE_OFFSET 0x20
69 // This is the Input Error Message
74 // This is the NV RAM update required Message
76 #define NV_UPDATE_REQUIRED 2
79 EFI_STRING_ID Banner
[BANNER_HEIGHT
][BANNER_COLUMNS
];
82 extern UINT16 gClassOfVfr
; // Formset class information
83 extern BANNER_DATA
*gBannerData
;
84 extern EFI_SCREEN_DESCRIPTOR gScreenDimensions
;
85 extern UINTN gFooterHeight
;
88 // Browser Global Strings
90 extern CHAR16
*gEnterString
;
91 extern CHAR16
*gEnterCommitString
;
92 extern CHAR16
*gEnterEscapeString
;
93 extern CHAR16
*gEscapeString
;
94 extern CHAR16
*gMoveHighlight
;
95 extern CHAR16
*gDecNumericInput
;
96 extern CHAR16
*gHexNumericInput
;
97 extern CHAR16
*gToggleCheckBox
;
98 extern CHAR16
*gLibEmptyString
;
99 extern CHAR16
*gAreYouSure
;
100 extern CHAR16
*gYesResponse
;
101 extern CHAR16
*gNoResponse
;
102 extern CHAR16
*gPlusString
;
103 extern CHAR16
*gMinusString
;
104 extern CHAR16
*gAdjustNumber
;
105 extern CHAR16
*gSaveChanges
;
106 extern CHAR16
*gNvUpdateMessage
;
107 extern CHAR16
*gInputErrorMessage
;
111 Print banner info for front page.
113 @param[in] FormData Form Data to be shown in Page
118 IN FORM_DISPLAY_ENGINE_FORM
*FormData
122 Print framework and form title for a page.
124 @param[in] FormData Form Data to be shown in Page
128 IN FORM_DISPLAY_ENGINE_FORM
*FormData
132 Validate the input screen diemenstion info.
134 @param FormData The input form data info.
136 @return EFI_SUCCESS The input screen info is acceptable.
137 @return EFI_INVALID_PARAMETER The input screen info is not acceptable.
141 ScreenDiemensionInfoValidate (
142 IN FORM_DISPLAY_ENGINE_FORM
*FormData
146 Get the string based on the StringId and HII Package List Handle.
148 @param Token The String's ID.
149 @param HiiHandle The package list in the HII database to search for
150 the specified string.
152 @return The output string.
157 IN EFI_STRING_ID Token
,
158 IN EFI_HII_HANDLE HiiHandle
162 Count the storage space of a Unicode string.
164 This function handles the Unicode string with NARROW_CHAR
165 and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR
166 does not count in the resultant output. If a WIDE_CHAR is
167 hit, then 2 Unicode character will consume an output storage
168 space with size of CHAR16 till a NARROW_CHAR is hit.
170 If String is NULL, then ASSERT ().
172 @param String The input string to be counted.
174 @return Storage space for the input string.
183 Show all registered HotKey help strings on bottom Rows.
185 @param FormData The curent input form data info.
186 @param SetState Set HotKey or Clear HotKey
190 PrintHotKeyHelpString (
191 IN FORM_DISPLAY_ENGINE_FORM
*FormData
,
196 Get step info from numeric opcode.
198 @param[in] OpCode The input numeric op code.
200 @return step info for this opcode.
204 IN EFI_IFR_OP_HEADER
*OpCode
208 Initialize the HII String Token to the correct values.
212 InitializeLibStrings (
226 Wait for a key to be pressed by user.
228 @param Key The key which is pressed by user.
230 @retval EFI_SUCCESS The function always completed successfully.
235 OUT EFI_INPUT_KEY
*Key
239 Set Buffer to Value for Size bytes.
241 @param Buffer Memory to set.
242 @param Size Number of bytes to set
243 @param Value Value of the set operation.
254 Prints a formatted unicode string to the default console, at
255 the supplied cursor position.
257 @param Width Width of String to be printed.
258 @param Column The cursor position to print the string at.
259 @param Row The cursor position to print the string at.
260 @param Fmt Format string.
261 @param ... Variable argument list for format string.
263 @return Length of string printed to the console
277 Process some op codes which is out side of current form.
279 @param FormData Pointer to the form data.
283 ProcessExternedOpcode (
284 IN FORM_DISPLAY_ENGINE_FORM
*FormData