3 This library class defines a set of interfaces to customize Display module
5 Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__
17 #define __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__
23 #include <Protocol/SimpleTextOut.h>
24 #include <Protocol/SimpleTextIn.h>
25 #include <Protocol/FormBrowser2.h>
26 #include <Protocol/FormBrowserEx2.h>
27 #include <Protocol/DisplayProtocol.h>
28 #include <Protocol/DevicePath.h>
29 #include <Protocol/UnicodeCollation.h>
30 #include <Protocol/HiiConfigAccess.h>
31 #include <Protocol/HiiConfigRouting.h>
32 #include <Protocol/HiiDatabase.h>
33 #include <Protocol/HiiString.h>
34 #include <Protocol/UserManager.h>
35 #include <Protocol/DevicePathFromText.h>
37 #include <Guid/MdeModuleHii.h>
38 #include <Guid/HiiPlatformSetupFormset.h>
39 #include <Guid/HiiFormMapMethodGuid.h>
41 #include <Library/PrintLib.h>
42 #include <Library/DebugLib.h>
43 #include <Library/BaseMemoryLib.h>
44 #include <Library/UefiRuntimeServicesTableLib.h>
45 #include <Library/UefiDriverEntryPoint.h>
46 #include <Library/UefiBootServicesTableLib.h>
47 #include <Library/BaseLib.h>
48 #include <Library/MemoryAllocationLib.h>
49 #include <Library/HiiLib.h>
50 #include <Library/PcdLib.h>
51 #include <Library/DevicePathLib.h>
52 #include <Library/CustomizedDisplayLib.h>
58 #define FORMSET_CLASS_PLATFORM_SETUP 0x0001
59 #define FORMSET_CLASS_FRONT_PAGE 0x0002
62 #define FRONT_PAGE_HEADER_HEIGHT 6
63 #define NONE_FRONT_PAGE_HEADER_HEIGHT 3
64 #define FOOTER_HEIGHT 4
65 #define STATUS_BAR_HEIGHT 1
70 #define BANNER_HEIGHT 6
71 #define BANNER_COLUMNS 3
72 #define BANNER_LEFT_COLUMN_INDENT 1
75 // Character definitions
77 #define UPPER_LOWER_CASE_OFFSET 0x20
80 // This is the Input Error Message
85 // This is the NV RAM update required Message
87 #define NV_UPDATE_REQUIRED 2
90 EFI_STRING_ID Banner
[BANNER_HEIGHT
][BANNER_COLUMNS
];
93 extern UINT16 gClassOfVfr
; // Formset class information
94 extern BANNER_DATA
*gBannerData
;
95 extern EFI_SCREEN_DESCRIPTOR gScreenDimensions
;
96 extern UINTN gFooterHeight
;
99 // Browser Global Strings
101 extern CHAR16
*gEnterString
;
102 extern CHAR16
*gEnterCommitString
;
103 extern CHAR16
*gEnterEscapeString
;
104 extern CHAR16
*gEscapeString
;
105 extern CHAR16
*gMoveHighlight
;
106 extern CHAR16
*gDecNumericInput
;
107 extern CHAR16
*gHexNumericInput
;
108 extern CHAR16
*gToggleCheckBox
;
109 extern CHAR16
*gLibEmptyString
;
110 extern CHAR16
*gAreYouSure
;
111 extern CHAR16
*gYesResponse
;
112 extern CHAR16
*gNoResponse
;
113 extern CHAR16
*gPlusString
;
114 extern CHAR16
*gMinusString
;
115 extern CHAR16
*gAdjustNumber
;
116 extern CHAR16
*gSaveChanges
;
117 extern CHAR16
*gNvUpdateMessage
;
118 extern CHAR16
*gInputErrorMessage
;
121 Print banner info for front page.
123 @param[in] FormData Form Data to be shown in Page
128 IN FORM_DISPLAY_ENGINE_FORM
*FormData
132 Print framework and form title for a page.
134 @param[in] FormData Form Data to be shown in Page
138 IN FORM_DISPLAY_ENGINE_FORM
*FormData
142 Validate the input screen diemenstion info.
144 @param FormData The input form data info.
146 @return EFI_SUCCESS The input screen info is acceptable.
147 @return EFI_INVALID_PARAMETER The input screen info is not acceptable.
151 ScreenDiemensionInfoValidate (
152 IN FORM_DISPLAY_ENGINE_FORM
*FormData
156 Get the string based on the StringId and HII Package List Handle.
158 @param Token The String's ID.
159 @param HiiHandle The package list in the HII database to search for
160 the specified string.
162 @return The output string.
167 IN EFI_STRING_ID Token
,
168 IN EFI_HII_HANDLE HiiHandle
172 Count the storage space of a Unicode string.
174 This function handles the Unicode string with NARROW_CHAR
175 and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR
176 does not count in the resultant output. If a WIDE_CHAR is
177 hit, then 2 Unicode character will consume an output storage
178 space with size of CHAR16 till a NARROW_CHAR is hit.
180 If String is NULL, then ASSERT ().
182 @param String The input string to be counted.
184 @return Storage space for the input string.
193 Show all registered HotKey help strings on bottom Rows.
195 @param FormData The curent input form data info.
196 @param SetState Set HotKey or Clear HotKey
200 PrintHotKeyHelpString (
201 IN FORM_DISPLAY_ENGINE_FORM
*FormData
,
206 Get step info from numeric opcode.
208 @param[in] OpCode The input numeric op code.
210 @return step info for this opcode.
214 IN EFI_IFR_OP_HEADER
*OpCode
218 Initialize the HII String Token to the correct values.
222 InitializeLibStrings (
236 Wait for a key to be pressed by user.
238 @param Key The key which is pressed by user.
240 @retval EFI_SUCCESS The function always completed successfully.
245 OUT EFI_INPUT_KEY
*Key
249 Set Buffer to Value for Size bytes.
251 @param Buffer Memory to set.
252 @param Size Number of bytes to set
253 @param Value Value of the set operation.
264 Prints a formatted unicode string to the default console, at
265 the supplied cursor position.
267 @param Width Width of String to be printed.
268 @param Column The cursor position to print the string at.
269 @param Row The cursor position to print the string at.
270 @param Fmt Format string.
271 @param ... Variable argument list for format string.
273 @return Length of string printed to the console
287 Process some op codes which is out side of current form.
289 @param FormData Pointer to the form data.
293 ProcessExternedOpcode (
294 IN FORM_DISPLAY_ENGINE_FORM
*FormData