VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLibInternal.h@ 80922

Last change on this file since 80922 was 80721, checked in by vboxsync, 5 years ago

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette