blob: 31e1091e8889e9c31fd89be54352f280aa2e69c2 [file] [log] [blame]
Vishal Bhoj82c80712015-12-15 21:13:33 +05301/** @file
2 This library class defines a set of interfaces to customize Display module
3
4Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>
5This program and the accompanying materials are licensed and made available under
6the terms and conditions of the BSD License that accompanies this distribution.
7The full text of the license may be found at
8http://opensource.org/licenses/bsd-license.php.
9
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13**/
14
15#ifndef __CUSTOMIZED_DISPLAY_LIB_H__
16#define __CUSTOMIZED_DISPLAY_LIB_H__
17
18#include <Protocol/DisplayProtocol.h>
19
20/**
21+------------------------------------------------------------------------------+
22| Setup Page |
23+------------------------------------------------------------------------------+
24
25Statement
26Statement
27Statement
28
29
30
31
32
33+------------------------------------------------------------------------------+
34| F9=Reset to Defaults F10=Save |
35| ^"=Move Highlight <Spacebar> Toggles Checkbox Esc=Exit |
36+------------------------------------------------------------------------------+
37 StatusBar
38**/
39
40/**
41 This funtion defines Page Frame and Backgroud.
42
43 Based on the above layout, it will be responsible for HeaderHeight, FooterHeight,
44 StatusBarHeight and Backgroud. And, it will reserve Screen for Statement.
45
46 @param[in] FormData Form Data to be shown in Page.
47 @param[out] ScreenForStatement Screen to be used for Statement. (Prompt, Value and Help)
48
49 @return Status
50**/
51EFI_STATUS
52EFIAPI
53DisplayPageFrame (
54 IN FORM_DISPLAY_ENGINE_FORM *FormData,
55 OUT EFI_SCREEN_DESCRIPTOR *ScreenForStatement
56 );
57
58/**
59 Clear Screen to the initial state.
60**/
61VOID
62EFIAPI
63ClearDisplayPage (
64 VOID
65 );
66
67/**
68 This function updates customized key panel's help information.
69 The library will prepare those Strings for the basic key, ESC, Enter, Up/Down/Left/Right, +/-.
70 and arrange them in Footer panel.
71
72 @param[in] FormData Form Data to be shown in Page. FormData has the highlighted statement.
73 @param[in] Statement The statement current selected.
74 @param[in] Selected Whether or not a tag be selected. TRUE means Enter has hit this question.
75**/
76VOID
77EFIAPI
78RefreshKeyHelp (
79 IN FORM_DISPLAY_ENGINE_FORM *FormData,
80 IN FORM_DISPLAY_ENGINE_STATEMENT *Statement,
81 IN BOOLEAN Selected
82 );
83
84/**
85 Update status bar.
86
87 This function updates the status bar on the bottom of menu screen. It just shows StatusBar.
88 Original logic in this function should be splitted out.
89
90 @param[in] MessageType The type of message to be shown. InputError or Configuration Changed.
91 @param[in] State Show or Clear Message.
92**/
93VOID
94EFIAPI
95UpdateStatusBar (
96 IN UINTN MessageType,
97 IN BOOLEAN State
98 );
99
100/**
101 Create popup window.
102
103 This function draws OEM/Vendor specific pop up windows.
104
105 @param[out] Key User Input Key
106 @param ... String to be shown in Popup. The variable argument list is terminated by a NULL.
107
108**/
109VOID
110EFIAPI
111CreateDialog (
112 OUT EFI_INPUT_KEY *Key, OPTIONAL
113 ...
114 );
115
116/**
117 Confirm how to handle the changed data.
118
119 @return Action BROWSER_ACTION_SUBMIT, BROWSER_ACTION_DISCARD or other values.
120**/
121UINTN
122EFIAPI
123ConfirmDataChange (
124 VOID
125 );
126
127/**
128 OEM specifies whether Setup exits Page by ESC key.
129
130 This function customized the behavior that whether Setup exits Page so that
131 system able to boot when configuration is not changed.
132
133 @retval TRUE Exits FrontPage
134 @retval FALSE Don't exit FrontPage.
135**/
136BOOLEAN
137EFIAPI
138FormExitPolicy (
139 VOID
140 );
141
142/**
143 Set Timeout value for a ceratain Form to get user response.
144
145 This function allows to set timeout value on a ceratain form if necessary.
146 If timeout is not zero, the form will exit if user has no response in timeout.
147
148 @param[in] FormData Form Data to be shown in Page
149
150 @return 0 No timeout for this form.
151 @return > 0 Timeout value in 100 ns units.
152**/
153UINT64
154EFIAPI
155FormExitTimeout (
156 IN FORM_DISPLAY_ENGINE_FORM *FormData
157 );
158
159//
160// Print Functions
161//
162/**
163 Prints a unicode string to the default console, at
164 the supplied cursor position, using L"%s" format.
165
166 @param Column The cursor position to print the string at. When it is -1, use current Position.
167 @param Row The cursor position to print the string at. When it is -1, use current Position.
168 @param String String pointer.
169
170 @return Length of string printed to the console
171
172**/
173UINTN
174EFIAPI
175PrintStringAt (
176 IN UINTN Column,
177 IN UINTN Row,
178 IN CHAR16 *String
179 );
180
181
182/**
183 Prints a unicode string with the specified width to the default console, at
184 the supplied cursor position, using L"%s" format.
185
186 @param Column The cursor position to print the string at. When it is -1, use current Position.
187 @param Row The cursor position to print the string at. When it is -1, use current Position.
188 @param String String pointer.
189 @param Width Width for String to be printed. If the print length of String < Width,
190 Space char (L' ') will be used to append String.
191
192 @return Length of string printed to the console
193
194**/
195UINTN
196EFIAPI
197PrintStringAtWithWidth (
198 IN UINTN Column,
199 IN UINTN Row,
200 IN CHAR16 *String,
201 IN UINTN Width
202 );
203
204/**
205 Prints a chracter to the default console, at
206 the supplied cursor position, using L"%c" format.
207
208 @param Column The cursor position to print the string at. When it is -1, use current Position.
209 @param Row The cursor position to print the string at. When it is -1, use current Position.
210 @param Character Character to print.
211
212 @return Length of string printed to the console.
213
214**/
215UINTN
216EFIAPI
217PrintCharAt (
218 IN UINTN Column,
219 IN UINTN Row,
220 CHAR16 Character
221 );
222
223/**
224 Clear retangle with specified text attribute.
225
226 @param LeftColumn Left column of retangle.
227 @param RightColumn Right column of retangle.
228 @param TopRow Start row of retangle.
229 @param BottomRow End row of retangle.
230 @param TextAttribute The character foreground and background.
231
232**/
233VOID
234EFIAPI
235ClearLines (
236 IN UINTN LeftColumn,
237 IN UINTN RightColumn,
238 IN UINTN TopRow,
239 IN UINTN BottomRow,
240 IN UINTN TextAttribute
241 );
242
243//
244// Color Setting Functions
245//
246/**
247 Get OEM/Vendor specific popup attribute colors.
248
249 @retval Byte code color setting for popup color.
250**/
251UINT8
252EFIAPI
253GetPopupColor (
254 VOID
255 );
256
257/**
258 Get OEM/Vendor specific popup attribute colors.
259
260 @retval Byte code color setting for popup inverse color.
261**/
262UINT8
263EFIAPI
264GetPopupInverseColor (
265 VOID
266 );
267
268/**
269 Get OEM/Vendor specific PickList color attribute.
270
271 @retval Byte code color setting for pick list color.
272**/
273UINT8
274EFIAPI
275GetPickListColor (
276 VOID
277 );
278
279/**
280 Get OEM/Vendor specific arrow color attribute.
281
282 @retval Byte code color setting for arrow color.
283**/
284UINT8
285EFIAPI
286GetArrowColor (
287 VOID
288 );
289
290/**
291 Get OEM/Vendor specific info text color attribute.
292
293 @retval Byte code color setting for info text color.
294**/
295UINT8
296EFIAPI
297GetInfoTextColor (
298 VOID
299 );
300
301/**
302 Get OEM/Vendor specific help text color attribute.
303
304 @retval Byte code color setting for help text color.
305**/
306UINT8
307EFIAPI
308GetHelpTextColor (
309 VOID
310 );
311
312/**
313 Get OEM/Vendor specific grayed out text color attribute.
314
315 @retval Byte code color setting for grayed out text color.
316**/
317UINT8
318EFIAPI
319GetGrayedTextColor (
320 VOID
321 );
322
323/**
324 Get OEM/Vendor specific highlighted text color attribute.
325
326 @retval Byte code color setting for highlight text color.
327**/
328UINT8
329EFIAPI
330GetHighlightTextColor (
331 VOID
332 );
333
334/**
335 Get OEM/Vendor specific field text color attribute.
336
337 @retval Byte code color setting for field text color.
338**/
339UINT8
340EFIAPI
341GetFieldTextColor (
342 VOID
343 );
344
345/**
346 Get OEM/Vendor specific subtitle text color attribute.
347
348 @retval Byte code color setting for subtitle text color.
349**/
350UINT8
351EFIAPI
352GetSubTitleTextColor (
353 VOID
354 );
355
356#endif