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
60 #define FORMSET_CLASS_MODEL_PAGE 0x0004
63 #define FRONT_PAGE_HEADER_HEIGHT 6
64 #define NONE_FRONT_PAGE_HEADER_HEIGHT 3
65 #define FOOTER_HEIGHT 4
66 #define STATUS_BAR_HEIGHT 1
71 #define BANNER_HEIGHT 6
72 #define BANNER_COLUMNS 3
73 #define BANNER_LEFT_COLUMN_INDENT 1
76 // Character definitions
78 #define UPPER_LOWER_CASE_OFFSET 0x20
81 // This is the Input Error Message
86 // This is the NV RAM update required Message
88 #define NV_UPDATE_REQUIRED 2
91 EFI_STRING_ID Banner
[BANNER_HEIGHT
][BANNER_COLUMNS
];
94 extern UINT16 gClassOfVfr
; // Formset class information
95 extern BANNER_DATA
*gBannerData
;
96 extern EFI_SCREEN_DESCRIPTOR gScreenDimensions
;
97 extern UINTN gFooterHeight
;
100 // Browser Global Strings
102 extern CHAR16
*gEnterString
;
103 extern CHAR16
*gEnterCommitString
;
104 extern CHAR16
*gEnterEscapeString
;
105 extern CHAR16
*gEscapeString
;
106 extern CHAR16
*gMoveHighlight
;
107 extern CHAR16
*gDecNumericInput
;
108 extern CHAR16
*gHexNumericInput
;
109 extern CHAR16
*gToggleCheckBox
;
110 extern CHAR16
*gLibEmptyString
;
111 extern CHAR16
*gAreYouSure
;
112 extern CHAR16
*gYesResponse
;
113 extern CHAR16
*gNoResponse
;
114 extern CHAR16
*gPlusString
;
115 extern CHAR16
*gMinusString
;
116 extern CHAR16
*gAdjustNumber
;
117 extern CHAR16
*gSaveChanges
;
118 extern CHAR16
*gNvUpdateMessage
;
119 extern CHAR16
*gInputErrorMessage
;
122 Print banner info for front page.
124 @param[in] FormData Form Data to be shown in Page
129 IN FORM_DISPLAY_ENGINE_FORM
*FormData
134 Print framework for a page.
143 Print the form title.
145 @param[in] FormData Form Data to be shown in Page
150 IN FORM_DISPLAY_ENGINE_FORM
*FormData
154 Validate the input screen diemenstion info.
156 @param FormData The input form data info.
158 @return EFI_SUCCESS The input screen info is acceptable.
159 @return EFI_INVALID_PARAMETER The input screen info is not acceptable.
163 ScreenDiemensionInfoValidate (
164 IN FORM_DISPLAY_ENGINE_FORM
*FormData
168 Get the string based on the StringId and HII Package List Handle.
170 @param Token The String's ID.
171 @param HiiHandle The package list in the HII database to search for
172 the specified string.
174 @return The output string.
179 IN EFI_STRING_ID Token
,
180 IN EFI_HII_HANDLE HiiHandle
184 Count the storage space of a Unicode string.
186 This function handles the Unicode string with NARROW_CHAR
187 and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR
188 does not count in the resultant output. If a WIDE_CHAR is
189 hit, then 2 Unicode character will consume an output storage
190 space with size of CHAR16 till a NARROW_CHAR is hit.
192 If String is NULL, then ASSERT ().
194 @param String The input string to be counted.
196 @return Storage space for the input string.
205 Show all registered HotKey help strings on bottom Rows.
207 @param FormData The curent input form data info.
211 PrintHotKeyHelpString (
212 IN FORM_DISPLAY_ENGINE_FORM
*FormData
216 Get step info from numeric opcode.
218 @param[in] OpCode The input numeric op code.
220 @return step info for this opcode.
224 IN EFI_IFR_OP_HEADER
*OpCode
228 Initialize the HII String Token to the correct values.
232 InitializeLibStrings (
246 Wait for a key to be pressed by user.
248 @param Key The key which is pressed by user.
250 @retval EFI_SUCCESS The function always completed successfully.
255 OUT EFI_INPUT_KEY
*Key
259 Set Buffer to Value for Size bytes.
261 @param Buffer Memory to set.
262 @param Size Number of bytes to set
263 @param Value Value of the set operation.
274 Prints a formatted unicode string to the default console, at
275 the supplied cursor position.
277 @param Width Width of String to be printed.
278 @param Column The cursor position to print the string at.
279 @param Row The cursor position to print the string at.
280 @param Fmt Format string.
281 @param ... Variable argument list for format string.
283 @return Length of string printed to the console
297 Process some op codes which is out side of current form.
299 @param FormData Pointer to the form data.
303 ProcessExternedOpcode (
304 IN FORM_DISPLAY_ENGINE_FORM
*FormData