TianoCore EDK2 master
Loading...
Searching...
No Matches
FormDisplay.h
Go to the documentation of this file.
1
9#ifndef __FORM_DISPLAY_H__
10#define __FORM_DISPLAY_H__
11
13#include <Library/DebugLib.h>
15#include <Library/BaseLib.h>
16#include <Library/HiiLib.h>
18#include <Library/PrintLib.h>
20
24#include <Protocol/HiiPopup.h>
25
26#include <Guid/MdeModuleHii.h>
27
28//
29// This is the generated header file which includes whatever needs to be exported (strings + IFR)
30//
31extern UINT8 DisplayEngineStrings[];
32extern EFI_SCREEN_DESCRIPTOR gStatementDimensions;
33extern USER_INPUT *gUserInput;
34extern FORM_DISPLAY_ENGINE_FORM *gFormData;
35extern EFI_HII_HANDLE gHiiHandle;
36extern UINT16 gDirection;
37extern LIST_ENTRY gMenuOption;
38extern CHAR16 *gConfirmOptYes;
39extern CHAR16 *gConfirmOptNo;
40extern CHAR16 *gConfirmOptOk;
41extern CHAR16 *gConfirmOptCancel;
42extern CHAR16 *gYesOption;
43extern CHAR16 *gNoOption;
44extern CHAR16 *gOkOption;
45extern CHAR16 *gCancelOption;
46extern CHAR16 *gErrorPopup;
47extern CHAR16 *gWarningPopup;
48extern CHAR16 *gInfoPopup;
49
50//
51// Browser Global Strings
52//
53extern CHAR16 *gSaveFailed;
54extern CHAR16 *gPromptForData;
55extern CHAR16 *gPromptForPassword;
56extern CHAR16 *gPromptForNewPassword;
57extern CHAR16 *gConfirmPassword;
58extern CHAR16 *gConfirmError;
59extern CHAR16 *gPassowordInvalid;
60extern CHAR16 *gPressEnter;
61extern CHAR16 *gEmptyString;
62extern CHAR16 *gMiniString;
63extern CHAR16 *gOptionMismatch;
64extern CHAR16 *gFormSuppress;
65extern CHAR16 *gProtocolNotFound;
66extern CHAR16 *gPasswordUnsupported;
67
68extern CHAR16 gPromptBlockWidth;
69extern CHAR16 gOptionBlockWidth;
70extern CHAR16 gHelpBlockWidth;
71extern CHAR16 *mUnknownString;
72extern BOOLEAN gMisMatch;
73
74//
75// Screen definitions
76//
77
78#define LEFT_SKIPPED_COLUMNS 3
79#define SCROLL_ARROW_HEIGHT 1
80#define POPUP_PAD_SPACE_COUNT 5
81#define POPUP_FRAME_WIDTH 2
82
83#define UPPER_LOWER_CASE_OFFSET 0x20
84
85//
86// Display definitions
87//
88#define LEFT_ONEOF_DELIMITER L'<'
89#define RIGHT_ONEOF_DELIMITER L'>'
90
91#define LEFT_NUMERIC_DELIMITER L'['
92#define RIGHT_NUMERIC_DELIMITER L']'
93
94#define LEFT_CHECKBOX_DELIMITER L'['
95#define RIGHT_CHECKBOX_DELIMITER L']'
96
97#define CHECK_ON L'X'
98#define CHECK_OFF L' '
99
100#define TIME_SEPARATOR L':'
101#define DATE_SEPARATOR L'/'
102
103#define SUBTITLE_INDENT 2
104
105//
106// This is the Input Error Message
107//
108#define INPUT_ERROR 1
109
110//
111// This is the NV RAM update required Message
112//
113#define NV_UPDATE_REQUIRED 2
114//
115// Time definitions
116//
117#define ONE_SECOND 10000000
118
119//
120// It take 23 characters including the NULL to print a 64 bits number with "[" and "]".
121// pow(2, 64) = [18446744073709551616]
122// with extra '-' flat, set the width to 24.
123//
124#define MAX_NUMERIC_INPUT_WIDTH 24
125
126#define EFI_HII_EXPRESSION_INCONSISTENT_IF 0
127#define EFI_HII_EXPRESSION_NO_SUBMIT_IF 1
128#define EFI_HII_EXPRESSION_GRAY_OUT_IF 2
129#define EFI_HII_EXPRESSION_SUPPRESS_IF 3
130#define EFI_HII_EXPRESSION_DISABLE_IF 4
131
132//
133// Character definitions
134//
135#define CHAR_SPACE 0x0020
136
137#define FORM_DISPLAY_DRIVER_SIGNATURE SIGNATURE_32 ('F', 'D', 'D', 'V')
138typedef struct {
139 UINT32 Signature;
140
141 EFI_HANDLE Handle;
142
143 //
144 // Produced protocol
145 //
147 EFI_HII_POPUP_PROTOCOL HiiPopup;
149
150typedef enum {
151 UiNoOperation,
152 UiSelect,
153 UiUp,
154 UiDown,
155 UiLeft,
156 UiRight,
157 UiReset,
158 UiPrevious,
159 UiPageUp,
160 UiPageDown,
161 UiHotKey,
162 UiMaxOperation
163} UI_SCREEN_OPERATION;
164
165typedef enum {
166 CfInitialization,
167 CfCheckSelection,
168 CfRepaint,
169 CfRefreshHighLight,
170 CfUpdateHelpString,
171 CfPrepareToReadKey,
172 CfReadKey,
173 CfScreenOperation,
174 CfUiSelect,
175 CfUiReset,
176 CfUiLeft,
177 CfUiRight,
178 CfUiUp,
179 CfUiPageUp,
180 CfUiPageDown,
181 CfUiDown,
182 CfUiNoOperation,
183 CfExit,
184 CfUiHotKey,
185 CfMaxControlFlag
186} UI_CONTROL_FLAG;
187
188typedef enum {
189 UIEventNone,
190 UIEventKey,
191 UIEventTimeOut,
192 UIEventDriver
193} UI_EVENT_TYPE;
194
195typedef struct {
196 UINT16 ScanCode;
197 UI_SCREEN_OPERATION ScreenOperation;
199
200typedef struct {
201 UI_SCREEN_OPERATION ScreenOperation;
202 UI_CONTROL_FLAG ControlFlag;
204
205typedef struct {
206 EFI_HII_HANDLE HiiHandle;
207 UINT16 FormId;
208
209 //
210 // Info for the highlight question.
211 // HLT means highlight
212 //
213 // If one statement has questionid, save questionid info to find the question.
214 // If one statement not has questionid info, save the opcode info to find the
215 // statement. If more than one statement has same opcode in one form(just like
216 // empty subtitle info may has more than one info one form), also use Index
217 // info to find the statement.
218 //
219 EFI_QUESTION_ID HLTQuestionId;
220 EFI_IFR_OP_HEADER *HLTOpCode;
221 UINTN HLTIndex;
222 UINTN HLTSequence;
223
224 //
225 // Info for the top of screen question.
226 // TOS means Top Of Screen
227 //
228 EFI_QUESTION_ID TOSQuestionId;
229 EFI_IFR_OP_HEADER *TOSOpCode;
230 UINTN TOSIndex;
231
232 UINT16 SkipValue;
234
235typedef struct {
236 EFI_EVENT SyncEvent;
237 UINT8 *TimeOut;
238 CHAR16 *ErrorInfo;
240
241#define UI_MENU_OPTION_SIGNATURE SIGNATURE_32 ('u', 'i', 'm', 'm')
242
243typedef struct {
244 UINTN Signature;
245 LIST_ENTRY Link;
246
247 EFI_HII_HANDLE Handle;
249 UINT16 EntryNumber;
250
251 UINTN Row;
252 UINTN Col;
253 UINTN OptCol;
254 CHAR16 *Description;
255 UINTN Skip; // Number of lines
256
257 //
258 // Display item sequence for date/time
259 // Date: Month/Day/Year
260 // Sequence: 0 1 2
261 //
262 // Time: Hour : Minute : Second
263 // Sequence: 0 1 2
264 //
265 //
266 UINTN Sequence;
267
268 BOOLEAN GrayOut;
269 BOOLEAN ReadOnly;
270
271 //
272 // Whether user could change value of this item
273 //
274 BOOLEAN IsQuestion;
275 BOOLEAN NestInStatement;
277
278#define MENU_OPTION_FROM_LINK(a) CR (a, UI_MENU_OPTION, Link, UI_MENU_OPTION_SIGNATURE)
279
280#define USER_SELECTABLE_OPTION_OK_WIDTH StrLen (gOkOption)
281#define USER_SELECTABLE_OPTION_OK_CAL_WIDTH (StrLen (gOkOption) + StrLen (gCancelOption))
282#define USER_SELECTABLE_OPTION_YES_NO_WIDTH (StrLen (gYesOption) + StrLen (gNoOption))
283#define USER_SELECTABLE_OPTION_YES_NO_CAL_WIDTH (StrLen (gYesOption) + StrLen (gNoOption) + StrLen (gCancelOption))
284
285#define USER_SELECTABLE_OPTION_SKIP_WIDTH 2
286
287//
288// +-------------------------------------------+ // POPUP_BORDER }
289// | ERROR/WARNING/INFO | // POPUP_STYLE_STRING_HEIGHT } POPUP_HEADER_HEIGHT
290// |-------------------------------------------| // POPUP_EMPTY_LINE_HEIGHT }
291// | popup messages |
292// | | // POPUP_EMPTY_LINE_HEIGHT }
293// | user selectable options | // POPUP_USER_SELECTABLE_OPTION_HEIGHT } POPUP_FOOTER_HEIGHT
294// +-------------------------------------------+ // POPUP_BORDER }
295//
296#define POPUP_BORDER 1
297#define POPUP_EMPTY_LINE_HEIGHT 1
298#define POPUP_STYLE_STRING_HEIGHT 1
299#define POPUP_USER_SELECTABLE_OPTION_HEIGHT 1
300
301#define POPUP_HEADER_HEIGHT (POPUP_BORDER + POPUP_STYLE_STRING_HEIGHT + POPUP_EMPTY_LINE_HEIGHT)
302#define POPUP_FOOTER_HEIGHT (POPUP_EMPTY_LINE_HEIGHT + POPUP_USER_SELECTABLE_OPTION_HEIGHT + POPUP_BORDER)
303
304#define USER_SELECTABLE_OPTION_SIGNATURE SIGNATURE_32 ('u', 's', 's', 'o')
305
306typedef struct {
307 UINTN Signature;
308 LIST_ENTRY Link;
309 EFI_HII_POPUP_SELECTION OptionType;
310 CHAR16 *OptionString;
311 //
312 // Display item sequence for user select options
313 // Ok: Ok
314 // Sequence: 0
315 //
316 // Ok/Cancel: Ok : Cancel
317 // Sequence: 0 1
318 //
319 // Yes/No: Yes : No
320 // Sequence: 0 1
321 //
322 // Yes/No/Cancel: Yes : No: Cancel
323 // Sequence: 0 1 2
324 //
325 UINTN Sequence;
326 UINTN OptionRow;
327 UINTN OptionCol;
328 UINTN MaxSequence;
329 UINTN MinSequence;
331
332#define SELECTABLE_OPTION_FROM_LINK(a) CR (a, USER_SELECTABLE_OPTION, Link, USER_SELECTABLE_OPTION_SIGNATURE)
333
348 IN OUT CHAR16 *FormattedNumber,
349 IN UINTN BufferSize
350 );
351
361VOID
363 IN VOID *Array,
364 IN UINT8 Type,
365 IN UINTN Index,
366 IN UINT64 Value
367 );
368
379UINT64
381 IN VOID *Array,
382 IN UINT8 Type,
383 IN UINTN Index
384 );
385
399 IN EFI_HII_VALUE *OptionValue
400 );
401
419 IN EFI_HII_VALUE *Value1,
420 IN EFI_HII_VALUE *Value2,
421 OUT INTN *Result,
422 IN EFI_HII_HANDLE HiiHandle OPTIONAL
423 );
424
434VOID
435EFIAPI
437 IN UINTN RequestedWidth,
438 IN UINTN NumberOfLines,
439 ...
440 );
441
461UINT16
463 IN CHAR16 *InputString,
464 IN UINT16 LineWidth,
465 IN OUT UINT16 *GlyphWidth,
466 IN OUT UINTN *Index,
467 OUT CHAR16 **OutputString
468 );
469
479CHAR16 *
480GetToken (
481 IN EFI_STRING_ID Token,
482 IN EFI_HII_HANDLE HiiHandle
483 );
484
501UINTN
503 IN CHAR16 *String
504 );
505
517 IN UI_MENU_OPTION *MenuOption
518 );
519
533 IN UI_MENU_OPTION *MenuOption,
534 IN CHAR16 *Prompt,
535 IN OUT CHAR16 *StringPtr
536 );
537
547VOID
549 IN UINTN RequestedWidth,
550 IN UINTN NumberOfLines,
551 IN VA_LIST Marker
552 );
553
564 OUT EFI_INPUT_KEY *Key
565 );
566
578 IN UI_MENU_OPTION *MenuOption
579 );
580
591UINTN
593 IN CHAR16 *StringPtr,
594 OUT CHAR16 **FormattedString,
595 OUT UINT16 *EachLineWidth,
596 IN UINTN RowCount
597 );
598
613 IN UI_MENU_OPTION *MenuOption,
614 IN BOOLEAN Selected,
615 OUT CHAR16 **OptionString,
616 IN BOOLEAN SkipErrorValue
617 );
618
627VOID
629 IN VOID *Buffer,
630 IN UINTN Size,
631 IN CHAR16 Value
632 );
633
643EFIAPI
646 OUT USER_INPUT *UserInputData
647 );
648
652VOID
653EFIAPI
655 VOID
656 );
657
662VOID
663EFIAPI
665 VOID
666 );
667
675VOID
676EFIAPI
678 IN EFI_EVENT Event,
679 IN VOID *Context
680 );
681
689VOID
690EFIAPI
692 IN EFI_EVENT Event,
693 IN VOID *Context
694 );
695
704VOID
706 IN LIST_ENTRY *Highlight,
707 IN LIST_ENTRY *TopOfScreen,
708 IN UINTN SkipValue
709 );
710
728EFIAPI
731 IN EFI_HII_POPUP_STYLE PopupStyle,
732 IN EFI_HII_POPUP_TYPE PopupType,
733 IN EFI_HII_HANDLE HiiHandle,
734 IN EFI_STRING_ID Message,
735 OUT EFI_HII_POPUP_SELECTION *UserSelection OPTIONAL
736 );
737
738#endif
UINT64 UINTN
INT64 INTN
UINTN ProcessHelpString(IN CHAR16 *StringPtr, OUT CHAR16 **FormattedString, OUT UINT16 *EachLineWidth, IN UINTN RowCount)
VOID EFIAPI RefreshTimeOutProcess(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS GetNumericInput(IN UI_MENU_OPTION *MenuOption)
Definition: InputHandler.c:487
EFI_STATUS ReadString(IN UI_MENU_OPTION *MenuOption, IN CHAR16 *Prompt, IN OUT CHAR16 *StringPtr)
Definition: InputHandler.c:56
EFI_STATUS CompareHiiValue(IN EFI_HII_VALUE *Value1, IN EFI_HII_VALUE *Value2, OUT INTN *Result, IN EFI_HII_HANDLE HiiHandle OPTIONAL)
VOID EFIAPI CreateMultiStringPopUp(IN UINTN RequestedWidth, IN UINTN NumberOfLines,...)
VOID EFIAPI EmptyEventProcess(IN EFI_EVENT Event, IN VOID *Context)
EFI_STATUS WaitForKeyStroke(OUT EFI_INPUT_KEY *Key)
VOID EFIAPI DriverClearDisplayPage(VOID)
Definition: FormDisplay.c:4193
EFI_STATUS ProcessOptions(IN UI_MENU_OPTION *MenuOption, IN BOOLEAN Selected, OUT CHAR16 **OptionString, IN BOOLEAN SkipErrorValue)
EFI_STATUS PrintFormattedNumber(IN FORM_DISPLAY_ENGINE_STATEMENT *Question, IN OUT CHAR16 *FormattedNumber, IN UINTN BufferSize)
EFI_STATUS GetSelectionInputPopUp(IN UI_MENU_OPTION *MenuOption)
CHAR16 * GetToken(IN EFI_STRING_ID Token, IN EFI_HII_HANDLE HiiHandle)
Definition: FormDisplay.c:191
VOID UpdateHighlightMenuInfo(IN LIST_ENTRY *Highlight, IN LIST_ENTRY *TopOfScreen, IN UINTN SkipValue)
Definition: FormDisplay.c:2023
VOID CreateSharedPopUp(IN UINTN RequestedWidth, IN UINTN NumberOfLines, IN VA_LIST Marker)
EFI_STATUS EFIAPI CreatePopup(IN EFI_HII_POPUP_PROTOCOL *This, IN EFI_HII_POPUP_STYLE PopupStyle, IN EFI_HII_POPUP_TYPE PopupType, IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID Message, OUT EFI_HII_POPUP_SELECTION *UserSelection OPTIONAL)
Definition: Popup.c:688
VOID EFIAPI ExitDisplay(VOID)
UINT64 GetArrayData(IN VOID *Array, IN UINT8 Type, IN UINTN Index)
UINTN GetStringWidth(IN CHAR16 *String)
Definition: FormDisplay.c:830
VOID SetArrayData(IN VOID *Array, IN UINT8 Type, IN UINTN Index, IN UINT64 Value)
DISPLAY_QUESTION_OPTION * ValueToOption(IN FORM_DISPLAY_ENGINE_STATEMENT *Question, IN EFI_HII_VALUE *OptionValue)
UINT16 GetLineByWidth(IN CHAR16 *InputString, IN UINT16 LineWidth, IN OUT UINT16 *GlyphWidth, IN OUT UINTN *Index, OUT CHAR16 **OutputString)
Definition: FormDisplay.c:464
VOID SetUnicodeMem(IN VOID *Buffer, IN UINTN Size, IN CHAR16 Value)
Definition: FormDisplay.c:4210
EFI_STATUS EFIAPI FormDisplay(IN FORM_DISPLAY_ENGINE_FORM *FormData, OUT USER_INPUT *UserInputData)
Definition: FormDisplay.c:4111
CHAR8 * VA_LIST
Definition: Base.h:643
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
UINT8 ScanCode
follows value defined in Scan Code Set1
Definition: Ps2KbdCtrller.c:12
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_EVENT
Definition: UefiBaseType.h:37
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
VOID * EFI_HII_HANDLE