]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h
Update Browser to provide the customization possibilities.
[mirror_edk2.git] / MdeModulePkg / Library / CustomizedDisplayLib / CustomizedDisplayLibInternal.h
1 /** @file
2
3 This library class defines a set of interfaces to customize Display module
4
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.
10
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.
13
14 **/
15
16 #ifndef __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__
17 #define __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__
18
19
20
21 #include <PiDxe.h>
22
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>
36
37 #include <Guid/MdeModuleHii.h>
38 #include <Guid/HiiPlatformSetupFormset.h>
39 #include <Guid/HiiFormMapMethodGuid.h>
40
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>
53
54 #include "Colors.h"
55
56
57
58 #define FORMSET_CLASS_PLATFORM_SETUP 0x0001
59 #define FORMSET_CLASS_FRONT_PAGE 0x0002
60 #define FORMSET_CLASS_MODEL_PAGE 0x0004
61
62
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
67
68 //
69 // Screen definitions
70 //
71 #define BANNER_HEIGHT 6
72 #define BANNER_COLUMNS 3
73 #define BANNER_LEFT_COLUMN_INDENT 1
74
75 //
76 // Character definitions
77 //
78 #define UPPER_LOWER_CASE_OFFSET 0x20
79
80 //
81 // This is the Input Error Message
82 //
83 #define INPUT_ERROR 1
84
85 //
86 // This is the NV RAM update required Message
87 //
88 #define NV_UPDATE_REQUIRED 2
89
90 typedef struct {
91 EFI_STRING_ID Banner[BANNER_HEIGHT][BANNER_COLUMNS];
92 } BANNER_DATA;
93
94 extern UINT16 gClassOfVfr; // Formset class information
95 extern BANNER_DATA *gBannerData;
96 extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;
97 extern UINTN gFooterHeight;
98
99 //
100 // Browser Global Strings
101 //
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;
120 /**
121
122 Print banner info for front page.
123
124 @param[in] FormData Form Data to be shown in Page
125
126 **/
127 VOID
128 PrintBannerInfo (
129 IN FORM_DISPLAY_ENGINE_FORM *FormData
130 );
131
132 /**
133
134 Print framework for a page.
135
136 **/
137 VOID
138 PrintFramework (
139 VOID
140 );
141
142 /**
143 Print the form title.
144
145 @param[in] FormData Form Data to be shown in Page
146
147 **/
148 VOID
149 PrintFormTitle (
150 IN FORM_DISPLAY_ENGINE_FORM *FormData
151 );
152
153 /**
154 Validate the input screen diemenstion info.
155
156 @param FormData The input form data info.
157
158 @return EFI_SUCCESS The input screen info is acceptable.
159 @return EFI_INVALID_PARAMETER The input screen info is not acceptable.
160
161 **/
162 EFI_STATUS
163 ScreenDiemensionInfoValidate (
164 IN FORM_DISPLAY_ENGINE_FORM *FormData
165 );
166
167 /**
168 Get the string based on the StringId and HII Package List Handle.
169
170 @param Token The String's ID.
171 @param HiiHandle The package list in the HII database to search for
172 the specified string.
173
174 @return The output string.
175
176 **/
177 CHAR16 *
178 LibGetToken (
179 IN EFI_STRING_ID Token,
180 IN EFI_HII_HANDLE HiiHandle
181 );
182
183 /**
184 Count the storage space of a Unicode string.
185
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.
191
192 If String is NULL, then ASSERT ().
193
194 @param String The input string to be counted.
195
196 @return Storage space for the input string.
197
198 **/
199 UINTN
200 LibGetStringWidth (
201 IN CHAR16 *String
202 );
203
204 /**
205 Show all registered HotKey help strings on bottom Rows.
206
207 @param FormData The curent input form data info.
208
209 **/
210 VOID
211 PrintHotKeyHelpString (
212 IN FORM_DISPLAY_ENGINE_FORM *FormData
213 );
214
215 /**
216 Get step info from numeric opcode.
217
218 @param[in] OpCode The input numeric op code.
219
220 @return step info for this opcode.
221 **/
222 UINT64
223 LibGetFieldFromNum (
224 IN EFI_IFR_OP_HEADER *OpCode
225 );
226
227 /**
228 Initialize the HII String Token to the correct values.
229
230 **/
231 VOID
232 InitializeLibStrings (
233 VOID
234 );
235
236 /**
237 Free the HII String.
238
239 **/
240 VOID
241 FreeLibStrings (
242 VOID
243 );
244
245 /**
246 Wait for a key to be pressed by user.
247
248 @param Key The key which is pressed by user.
249
250 @retval EFI_SUCCESS The function always completed successfully.
251
252 **/
253 EFI_STATUS
254 WaitForKeyStroke (
255 OUT EFI_INPUT_KEY *Key
256 );
257
258 /**
259 Set Buffer to Value for Size bytes.
260
261 @param Buffer Memory to set.
262 @param Size Number of bytes to set
263 @param Value Value of the set operation.
264
265 **/
266 VOID
267 LibSetUnicodeMem (
268 IN VOID *Buffer,
269 IN UINTN Size,
270 IN CHAR16 Value
271 );
272
273 /**
274 Prints a formatted unicode string to the default console, at
275 the supplied cursor position.
276
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.
282
283 @return Length of string printed to the console
284
285 **/
286 UINTN
287 EFIAPI
288 PrintAt (
289 IN UINTN Width,
290 IN UINTN Column,
291 IN UINTN Row,
292 IN CHAR16 *Fmt,
293 ...
294 );
295
296 /**
297 Process some op codes which is out side of current form.
298
299 @param FormData Pointer to the form data.
300
301 **/
302 VOID
303 ProcessExternedOpcode (
304 IN FORM_DISPLAY_ENGINE_FORM *FormData
305 );
306
307 #endif