]>
Commit | Line | Data |
---|---|---|
7c6c064c ED |
1 | /** @file\r |
2 | \r | |
3 | This library class defines a set of interfaces to customize Display module\r | |
4 | \r | |
5 | Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r | |
6 | This program and the accompanying materials are licensed and made available under \r | |
7 | the terms and conditions of the BSD License that accompanies this distribution. \r | |
8 | The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php. \r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__\r | |
17 | #define __CUSTOMIZED_DISPLAY_LIB_INTERNAL_H__\r | |
18 | \r | |
19 | \r | |
20 | \r | |
21 | #include <PiDxe.h>\r | |
22 | \r | |
23 | #include <Protocol/SimpleTextOut.h>\r | |
24 | #include <Protocol/SimpleTextIn.h>\r | |
25 | #include <Protocol/FormBrowser2.h>\r | |
26 | #include <Protocol/FormBrowserEx2.h>\r | |
27 | #include <Protocol/DisplayProtocol.h>\r | |
28 | #include <Protocol/DevicePath.h>\r | |
29 | #include <Protocol/UnicodeCollation.h>\r | |
30 | #include <Protocol/HiiConfigAccess.h>\r | |
31 | #include <Protocol/HiiConfigRouting.h>\r | |
32 | #include <Protocol/HiiDatabase.h>\r | |
33 | #include <Protocol/HiiString.h>\r | |
34 | #include <Protocol/UserManager.h>\r | |
35 | #include <Protocol/DevicePathFromText.h>\r | |
36 | \r | |
37 | #include <Guid/MdeModuleHii.h>\r | |
38 | #include <Guid/HiiPlatformSetupFormset.h>\r | |
39 | #include <Guid/HiiFormMapMethodGuid.h>\r | |
40 | \r | |
41 | #include <Library/PrintLib.h>\r | |
42 | #include <Library/DebugLib.h>\r | |
43 | #include <Library/BaseMemoryLib.h>\r | |
44 | #include <Library/UefiRuntimeServicesTableLib.h>\r | |
45 | #include <Library/UefiDriverEntryPoint.h>\r | |
46 | #include <Library/UefiBootServicesTableLib.h>\r | |
47 | #include <Library/BaseLib.h>\r | |
48 | #include <Library/MemoryAllocationLib.h>\r | |
49 | #include <Library/HiiLib.h>\r | |
50 | #include <Library/PcdLib.h>\r | |
51 | #include <Library/DevicePathLib.h>\r | |
52 | #include <Library/CustomizedDisplayLib.h>\r | |
53 | \r | |
54 | #include "Colors.h"\r | |
55 | \r | |
56 | \r | |
57 | \r | |
58 | #define FORMSET_CLASS_PLATFORM_SETUP 0x0001\r | |
59 | #define FORMSET_CLASS_FRONT_PAGE 0x0002\r | |
7c6c064c ED |
60 | \r |
61 | \r | |
62 | #define FRONT_PAGE_HEADER_HEIGHT 6\r | |
63 | #define NONE_FRONT_PAGE_HEADER_HEIGHT 3\r | |
64 | #define FOOTER_HEIGHT 4\r | |
65 | #define STATUS_BAR_HEIGHT 1\r | |
66 | \r | |
67 | //\r | |
68 | // Screen definitions\r | |
69 | //\r | |
70 | #define BANNER_HEIGHT 6\r | |
71 | #define BANNER_COLUMNS 3\r | |
72 | #define BANNER_LEFT_COLUMN_INDENT 1\r | |
73 | \r | |
74 | //\r | |
75 | // Character definitions\r | |
76 | //\r | |
77 | #define UPPER_LOWER_CASE_OFFSET 0x20\r | |
78 | \r | |
79 | //\r | |
80 | // This is the Input Error Message\r | |
81 | //\r | |
82 | #define INPUT_ERROR 1\r | |
83 | \r | |
84 | //\r | |
85 | // This is the NV RAM update required Message\r | |
86 | //\r | |
87 | #define NV_UPDATE_REQUIRED 2\r | |
88 | \r | |
89 | typedef struct {\r | |
90 | EFI_STRING_ID Banner[BANNER_HEIGHT][BANNER_COLUMNS];\r | |
91 | } BANNER_DATA;\r | |
92 | \r | |
93 | extern UINT16 gClassOfVfr; // Formset class information\r | |
94 | extern BANNER_DATA *gBannerData;\r | |
95 | extern EFI_SCREEN_DESCRIPTOR gScreenDimensions;\r | |
96 | extern UINTN gFooterHeight;\r | |
97 | \r | |
98 | //\r | |
99 | // Browser Global Strings\r | |
100 | //\r | |
101 | extern CHAR16 *gEnterString;\r | |
102 | extern CHAR16 *gEnterCommitString;\r | |
103 | extern CHAR16 *gEnterEscapeString;\r | |
104 | extern CHAR16 *gEscapeString;\r | |
105 | extern CHAR16 *gMoveHighlight;\r | |
106 | extern CHAR16 *gDecNumericInput;\r | |
107 | extern CHAR16 *gHexNumericInput;\r | |
108 | extern CHAR16 *gToggleCheckBox;\r | |
109 | extern CHAR16 *gLibEmptyString;\r | |
110 | extern CHAR16 *gAreYouSure;\r | |
111 | extern CHAR16 *gYesResponse;\r | |
112 | extern CHAR16 *gNoResponse;\r | |
113 | extern CHAR16 *gPlusString;\r | |
114 | extern CHAR16 *gMinusString;\r | |
115 | extern CHAR16 *gAdjustNumber;\r | |
116 | extern CHAR16 *gSaveChanges;\r | |
117 | extern CHAR16 *gNvUpdateMessage;\r | |
118 | extern CHAR16 *gInputErrorMessage;\r | |
119 | /**\r | |
120 | \r | |
121 | Print banner info for front page.\r | |
122 | \r | |
123 | @param[in] FormData Form Data to be shown in Page\r | |
124 | \r | |
125 | **/\r | |
126 | VOID\r | |
127 | PrintBannerInfo ( \r | |
128 | IN FORM_DISPLAY_ENGINE_FORM *FormData\r | |
129 | );\r | |
130 | \r | |
131 | /**\r | |
5a9f73bf | 132 | Print framework and form title for a page.\r |
7c6c064c ED |
133 | \r |
134 | @param[in] FormData Form Data to be shown in Page\r | |
7c6c064c ED |
135 | **/\r |
136 | VOID\r | |
5a9f73bf | 137 | PrintFramework (\r |
7c6c064c ED |
138 | IN FORM_DISPLAY_ENGINE_FORM *FormData\r |
139 | );\r | |
140 | \r | |
141 | /**\r | |
142 | Validate the input screen diemenstion info.\r | |
143 | \r | |
144 | @param FormData The input form data info.\r | |
145 | \r | |
146 | @return EFI_SUCCESS The input screen info is acceptable.\r | |
147 | @return EFI_INVALID_PARAMETER The input screen info is not acceptable.\r | |
148 | \r | |
149 | **/\r | |
150 | EFI_STATUS \r | |
151 | ScreenDiemensionInfoValidate (\r | |
152 | IN FORM_DISPLAY_ENGINE_FORM *FormData\r | |
153 | );\r | |
154 | \r | |
155 | /**\r | |
156 | Get the string based on the StringId and HII Package List Handle.\r | |
157 | \r | |
158 | @param Token The String's ID.\r | |
159 | @param HiiHandle The package list in the HII database to search for\r | |
160 | the specified string.\r | |
161 | \r | |
162 | @return The output string.\r | |
163 | \r | |
164 | **/\r | |
165 | CHAR16 *\r | |
166 | LibGetToken (\r | |
167 | IN EFI_STRING_ID Token,\r | |
168 | IN EFI_HII_HANDLE HiiHandle\r | |
169 | );\r | |
170 | \r | |
171 | /**\r | |
172 | Count the storage space of a Unicode string.\r | |
173 | \r | |
174 | This function handles the Unicode string with NARROW_CHAR\r | |
175 | and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR\r | |
176 | does not count in the resultant output. If a WIDE_CHAR is\r | |
177 | hit, then 2 Unicode character will consume an output storage\r | |
178 | space with size of CHAR16 till a NARROW_CHAR is hit.\r | |
179 | \r | |
180 | If String is NULL, then ASSERT ().\r | |
181 | \r | |
182 | @param String The input string to be counted.\r | |
183 | \r | |
184 | @return Storage space for the input string.\r | |
185 | \r | |
186 | **/\r | |
187 | UINTN\r | |
188 | LibGetStringWidth (\r | |
189 | IN CHAR16 *String\r | |
190 | );\r | |
191 | \r | |
192 | /**\r | |
193 | Show all registered HotKey help strings on bottom Rows.\r | |
194 | \r | |
195 | @param FormData The curent input form data info.\r | |
af047db7 | 196 | @param SetState Set HotKey or Clear HotKey\r |
7c6c064c ED |
197 | \r |
198 | **/\r | |
199 | VOID\r | |
200 | PrintHotKeyHelpString (\r | |
af047db7 ED |
201 | IN FORM_DISPLAY_ENGINE_FORM *FormData,\r |
202 | IN BOOLEAN SetState\r | |
7c6c064c ED |
203 | );\r |
204 | \r | |
205 | /**\r | |
206 | Get step info from numeric opcode.\r | |
207 | \r | |
208 | @param[in] OpCode The input numeric op code.\r | |
209 | \r | |
210 | @return step info for this opcode.\r | |
211 | **/\r | |
212 | UINT64\r | |
213 | LibGetFieldFromNum (\r | |
214 | IN EFI_IFR_OP_HEADER *OpCode\r | |
215 | );\r | |
216 | \r | |
217 | /**\r | |
218 | Initialize the HII String Token to the correct values.\r | |
219 | \r | |
220 | **/\r | |
221 | VOID\r | |
222 | InitializeLibStrings (\r | |
223 | VOID\r | |
224 | );\r | |
225 | \r | |
226 | /**\r | |
227 | Free the HII String.\r | |
228 | \r | |
229 | **/\r | |
230 | VOID\r | |
231 | FreeLibStrings (\r | |
232 | VOID\r | |
233 | );\r | |
234 | \r | |
235 | /**\r | |
236 | Wait for a key to be pressed by user.\r | |
237 | \r | |
238 | @param Key The key which is pressed by user.\r | |
239 | \r | |
240 | @retval EFI_SUCCESS The function always completed successfully.\r | |
241 | \r | |
242 | **/\r | |
243 | EFI_STATUS\r | |
244 | WaitForKeyStroke (\r | |
245 | OUT EFI_INPUT_KEY *Key\r | |
246 | );\r | |
247 | \r | |
248 | /**\r | |
249 | Set Buffer to Value for Size bytes.\r | |
250 | \r | |
251 | @param Buffer Memory to set.\r | |
252 | @param Size Number of bytes to set\r | |
253 | @param Value Value of the set operation.\r | |
254 | \r | |
255 | **/\r | |
256 | VOID\r | |
257 | LibSetUnicodeMem (\r | |
258 | IN VOID *Buffer,\r | |
259 | IN UINTN Size,\r | |
260 | IN CHAR16 Value\r | |
261 | );\r | |
262 | \r | |
263 | /**\r | |
264 | Prints a formatted unicode string to the default console, at\r | |
265 | the supplied cursor position.\r | |
266 | \r | |
267 | @param Width Width of String to be printed.\r | |
268 | @param Column The cursor position to print the string at.\r | |
269 | @param Row The cursor position to print the string at.\r | |
270 | @param Fmt Format string.\r | |
271 | @param ... Variable argument list for format string.\r | |
272 | \r | |
273 | @return Length of string printed to the console\r | |
274 | \r | |
275 | **/\r | |
276 | UINTN\r | |
277 | EFIAPI\r | |
278 | PrintAt (\r | |
279 | IN UINTN Width,\r | |
280 | IN UINTN Column,\r | |
281 | IN UINTN Row,\r | |
282 | IN CHAR16 *Fmt,\r | |
283 | ...\r | |
284 | );\r | |
285 | \r | |
286 | /**\r | |
287 | Process some op codes which is out side of current form.\r | |
288 | \r | |
289 | @param FormData Pointer to the form data.\r | |
290 | \r | |
291 | **/\r | |
292 | VOID\r | |
293 | ProcessExternedOpcode (\r | |
294 | IN FORM_DISPLAY_ENGINE_FORM *FormData\r | |
295 | );\r | |
296 | \r | |
297 | #endif\r |