]> git.proxmox.com Git - mirror_edk2.git/blob - EdkModulePkg/Universal/UserInterface/SetupBrowser/Dxe/Setup.h
1. Fix EDKT413: EnumerationData.java should use defined final static string
[mirror_edk2.git] / EdkModulePkg / Universal / UserInterface / SetupBrowser / Dxe / Setup.h
1 /*++
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 Setup.h
15
16 Abstract:
17
18
19 Revision History
20
21 --*/
22
23 #ifndef _SETUP_H
24 #define _SETUP_H
25
26 //
27 // This is the generated header file which includes whatever needs to be exported (strings + IFR)
28 //
29 #include "SetupBrowserStrDefs.h"
30 extern UINT8 SetupBrowserStrings[];
31
32 //
33 // Screen definitions
34 //
35 #define BANNER_HEIGHT 4
36 #define BANNER_COLUMNS 3
37
38 #define FRONT_PAGE_HEADER_HEIGHT 4
39 #define NONE_FRONT_PAGE_HEADER_HEIGHT 3
40 #define LEFT_SKIPPED_COLUMNS 4
41 #define FOOTER_HEIGHT 4
42 #define STATUS_BAR_HEIGHT 1
43 #define SCROLL_ARROW_HEIGHT 1
44 #define POPUP_PAD_SPACE_COUNT 5
45 #define POPUP_FRAME_WIDTH 2
46
47
48 #define EFI_SETUP_APPLICATION_SUBCLASS 0x00
49 #define EFI_GENERAL_APPLICATION_SUBCLASS 0x01
50 #define EFI_FRONT_PAGE_SUBCLASS 0x02
51 #define EFI_SINGLE_USE_SUBCLASS 0x03 // Used to display a single entity and then exit
52 //
53 // Definition for function key setting
54 //
55 #define NONE_FUNCTION_KEY_SETTING 0
56 #define DEFAULT_FUNCTION_KEY_SETTING (FUNCTION_ONE | FUNCTION_TWO | FUNCTION_NINE | FUNCTION_TEN)
57
58 #define FUNCTION_ONE (1 << 0)
59 #define FUNCTION_TWO (1 << 1)
60 #define FUNCTION_NINE (1 << 2)
61 #define FUNCTION_TEN (1 << 3)
62
63 typedef struct {
64 EFI_GUID FormSetGuid;
65 UINTN KeySetting;
66 } FUNCTIION_KEY_SETTING;
67
68 //
69 // Character definitions
70 //
71 #define CHAR_SPACE 0x0020
72 #define UPPER_LOWER_CASE_OFFSET 0x20
73
74 //
75 // Time definitions
76 //
77 #define ONE_SECOND 10000000
78
79 //
80 // Display definitions
81 //
82 #define LEFT_HYPER_DELIMITER L'<'
83 #define RIGHT_HYPER_DELIMITER L'>'
84
85 #define LEFT_ONEOF_DELIMITER L'<'
86 #define RIGHT_ONEOF_DELIMITER L'>'
87
88 #define LEFT_NUMERIC_DELIMITER L'['
89 #define RIGHT_NUMERIC_DELIMITER L']'
90
91 #define LEFT_CHECKBOX_DELIMITER L"["
92 #define RIGHT_CHECKBOX_DELIMITER L"]"
93
94 #define CHECK_ON L"X"
95 #define CHECK_OFF L" "
96
97 #define TIME_SEPARATOR L':'
98 #define DATE_SEPARATOR L'/'
99
100 #define YES_ANSWER L'Y'
101 #define NO_ANSWER L'N'
102
103 //
104 // Up to how many lines does the ordered list display
105 //
106 #define ORDERED_LIST_SIZE 4
107
108 //
109 // This is the Input Error Message
110 //
111 #define INPUT_ERROR 1
112
113 //
114 // This is the NV RAM update required Message
115 //
116 #define NV_UPDATE_REQUIRED 2
117
118 //
119 // Refresh the Status Bar with flags
120 //
121 #define REFRESH_STATUS_BAR 0xff
122
123 //
124 // This width is basically the sum of the prompt and option widths
125 //
126 #define QUESTION_BLOCK_WIDTH 50
127
128 //
129 // Width of the Language Description (Using ISO-639-2 3 ASCII letter standard)
130 //
131 #define LANG_DESC_WIDTH 3
132
133 //
134 // Maximum Number of Binaries we can see
135 //
136 #define MAX_BINARIES 255
137
138 //
139 // Invalid Handle
140 //
141 #define EFI_HII_INVALID_HANDLE 0xFFFF
142
143 //
144 // Invalid Offset Value
145 //
146 #define INVALID_OFFSET_VALUE 0xFFFF
147
148 struct StringPart {
149 struct StringPart *Next;
150 CHAR8 String[QUESTION_BLOCK_WIDTH + 2];
151 };
152
153 //
154 // The tag definition defines the data associated with a tag (an operation
155 // in the IFR lingo). The tag is thus a modified union of all the data
156 // required for tags. The user should be careful to only rely upon information
157 // relevant to that tag as the contents of other fields is undefined.
158 //
159 // The intent here is for this to be all of the data associated with a particular tag.
160 // Some of this data is extracted from the IFR and left alone. Other data will be derived
161 // when the page is selected (since that's the first time we really know what language the
162 // page is to be displayed in) and still other data will vary based on the selection.
163 // If you'd like to consider alternatives, let me know. This structure has grown somewhat organically.
164 // It gets a new item stuffed in it when a new item is needed. When I finally decided I needed the
165 // StringPart structure, items got added here, for example.
166 //
167 typedef struct {
168 UINT8 Operand; // The operand (first byte) of the variable length tag.
169 EFI_GUID GuidValue; // Primarily for FormSet data
170 EFI_PHYSICAL_ADDRESS CallbackHandle;
171 UINT16 Class;
172 UINT16 SubClass;
173 UINT16 NumberOfLines; // The number of lines the tag takes up on the page. Adjusted when we display the page as it can change from language to language.
174 UINT16 PageLine;
175 UINT16 PageColumn;
176 UINT16 OptionWidth; // The option can be wider than the column usually associated with options. This is the width on the last option line
177 STRING_REF Text; // Used for title, subtitle, prompt, etc. This is the string token associated with the string. This token is language independent.
178 STRING_REF TextTwo; // Used for title, subtitle, prompt, etc. This is the string token associated with the string. This token is language independent.
179 STRING_REF Help; // Null means no help Same as above but for languages.
180 UINT16 Consistency; // Do we need to check this opcode against consistency? If > 0, yes.
181 UINT16 Id;
182 UINT16 Id2; // The questions (mainly) have identifiers associated with them. These are filled in from the IFR tags and used by e.g. the RPN calculations. (com1 is set to, versus com2 is set to)
183 //
184 // These are the three values that are created to determine where in the variable the data is stored. This should, in general,
185 // be allocated by the build tool. The one major issue is, once storage is allocated for something, it can't be reallocated or we will get a mess.
186 //
187 UINT16 StorageStart;
188 //
189 // These are the three values that are created to determine where in the variable the data is stored. This should, in general,
190 // be allocated by the build tool. The one major issue is, once storage is allocated for something, it can't be reallocated or we will get a mess.
191 //
192 UINT8 StorageWidth;
193 //
194 // These are the three values that are created to determine where in the variable the data is stored. This should, in general,
195 // be allocated by the build tool. The one major issue is, once storage is allocated for something, it can't be reallocated or we will get a mess.
196 //
197 UINT16 Value;
198 //
199 // (Default or current)
200 //
201 UINT8 Flags;
202 UINT16 Key;
203 //
204 // Used to preserve a value during late consistency checking
205 //
206 UINT16 OldValue;
207 UINT16 Minimum;
208 UINT16 Maximum;
209 UINT16 Step;
210 UINT16 Default;
211 UINT16 NvDataSize;
212 UINT16 ConsistencyId;
213 BOOLEAN GrayOut;
214 BOOLEAN Suppress;
215 UINT16 Encoding; // Data from the tags. The first three are used by the numeric input. Encoding is used by the password stuff (a placeholder today - may go away).
216 UINT16 *IntList; // List of the values possible for a list question
217 //
218 // The string is obtained from the string list and formatted into lines and the lines are held in this linked list.
219 // If we have more than a screen's worth of items, we will end up with cases where we have to display the last couple
220 // lines of a tag's string above the currently selected one, or, display a few lines of a tag at the bottom of a screen.
221 //
222 struct StringPart *StringList;
223 BOOLEAN ResetRequired; // Primarily used to determine if a reset is required by changing this op-code.
224 UINT16 VariableNumber; // Used to define which variable the StorageStart will be pertinent for (0-based) For single variable VFR this will always be 0.
225 //
226 // Used to define which variable the StorageStart will be pertinent for (0-based) This is used for boolean check of ID versus ID
227 // so that a user can compare the value of one variable.field content versus another variable.field content.
228 //
229 UINT16 VariableNumber2;
230 } EFI_TAG;
231
232 #define EFI_FORM_DATA_SIGNATURE EFI_SIGNATURE_32 ('F', 'o', 'r', 'm')
233
234 typedef struct {
235 UINTN Signature;
236
237 EFI_HII_PROTOCOL *Hii;
238 EFI_FORM_BROWSER_PROTOCOL FormConfig;
239 } EFI_FORM_CONFIGURATION_DATA;
240
241 #define EFI_FORM_DATA_FROM_THIS(a) CR (a, EFI_FORM_CONFIGURATION_DATA, FormConfig, EFI_FORM_DATA_SIGNATURE)
242
243 typedef struct _EFI_VARIABLE_DEFINITION {
244 CHAR8 *NvRamMap;
245 CHAR8 *FakeNvRamMap; // This is where the storage for NULL devices go (e.g. RTC)
246 EFI_GUID Guid;
247 UINT16 VariableId;
248 UINT16 VariableSize;
249 UINT16 VariableFakeSize; // For dynamically created and NULL device options, this is the latest size
250 CHAR16 *VariableName;
251 struct _EFI_VARIABLE_DEFINITION *Next;
252 struct _EFI_VARIABLE_DEFINITION *Previous;
253 } EFI_VARIABLE_DEFINITION;
254
255 typedef struct {
256 UINT32 Length; // Length in bytes between beginning of struc and end of Strings
257 CHAR8 LanguageCode[4]; // ISO-639-2 language code with a null-terminator
258 RELOFST PrintableLanguageName; // Translated name of the Language, "English"/"Espanol" etc
259 UINT32 Attributes; // If on, the language is intended to be printed right to left. The default (off) is to print left to right.
260 RELOFST StringsPointers[1]; // Pointing to string offset from beginning of String Binary
261 EFI_STRING Strings[1]; // Array of String Entries. Note the number of entries for Strings and StringsPointers will be the same
262 } EFI_LANGUAGE_SET;
263
264 //
265 // This encapsulates all the pointers associated with found IFR binaries
266 //
267 typedef struct _EFI_IFR_BINARY {
268 struct _EFI_IFR_BINARY *Next;
269 VOID *IfrPackage; // Handy for use in freeing the data later since this is the header of the buffer
270 VOID *FormBinary;
271 EFI_HII_HANDLE Handle;
272 STRING_REF TitleToken;
273 BOOLEAN UnRegisterOnExit;
274 } EFI_IFR_BINARY;
275
276 //
277 // This encapsulates all the questions (tags) for a particular Form Set
278 //
279 typedef struct _EFI_FORM_TAGS {
280 struct _EFI_FORM_TAGS *Next;
281 EFI_TAG *Tags;
282 } EFI_FORM_TAGS;
283
284 //
285 // This is the database of all inconsistency data. Each op-code associated
286 // with inconsistency will be tracked here. This optimizes the search requirement
287 // since we will back mark the main tag structure with the op-codes that have reference
288 // to inconsistency data. This way when parsing the main tag structure and encountering
289 // the inconsistency mark - we can search this database to know what the inconsistency
290 // parameters are for that entry.
291 //
292 typedef struct _EFI_INCONSISTENCY_DATA {
293 struct _EFI_INCONSISTENCY_DATA *Next;
294 struct _EFI_INCONSISTENCY_DATA *Previous;
295 UINT8 Operand;
296 STRING_REF Popup;
297 UINT16 QuestionId1;
298 UINT16 QuestionId2;
299 UINT16 Value;
300 UINT16 ListLength;
301 UINT16 ConsistencyId;
302 UINT16 *ValueList;
303 UINT16 VariableNumber;
304 UINT16 VariableNumber2;
305 UINT8 Width;
306 } EFI_INCONSISTENCY_DATA;
307
308 //
309 // Encapsulating all found Tag information from all sources
310 // Each encapsulation also contains the NvRamMap buffer and the Size of the NV store
311 //
312 typedef struct _EFI_FILE_FORM_TAGS {
313 struct _EFI_FILE_FORM_TAGS *NextFile;
314 EFI_INCONSISTENCY_DATA *InconsistentTags;
315 EFI_VARIABLE_DEFINITION *VariableDefinitions;
316 EFI_FORM_TAGS FormTags;
317 } EFI_FILE_FORM_TAGS;
318
319 typedef struct {
320 STRING_REF Banner[BANNER_HEIGHT][BANNER_COLUMNS];
321 } BANNER_DATA;
322
323 //
324 // Head of the Binary structures
325 //
326 EFI_IFR_BINARY *gBinaryDataHead;
327
328 //
329 // The IFR binary that the user chose to run
330 //
331 UINTN gActiveIfr;
332
333 EFI_HII_PROTOCOL *Hii;
334
335 VOID *CachedNVEntry;
336 BANNER_DATA *BannerData;
337 EFI_HII_HANDLE FrontPageHandle;
338 STRING_REF FrontPageTimeOutTitle;
339 INT16 FrontPageTimeOutValue;
340 UINTN gClassOfVfr;
341 UINTN gFunctionKeySetting;
342 BOOLEAN gResetRequired;
343 BOOLEAN gExitRequired;
344 BOOLEAN gSaveRequired;
345 BOOLEAN gNvUpdateRequired;
346 UINT16 gConsistencyId;
347 UINTN gPriorMenuEntry;
348 EFI_HII_HANDLE gHiiHandle;
349 BOOLEAN gFirstIn;
350 VOID *gPreviousValue;
351 UINT16 gDirection;
352 EFI_SCREEN_DESCRIPTOR gScreenDimensions;
353 BOOLEAN gUpArrow;
354 BOOLEAN gDownArrow;
355 BOOLEAN gTimeOnScreen;
356 BOOLEAN gDateOnScreen;
357
358 //
359 // Browser Global Strings
360 //
361 CHAR16 *gFunctionOneString;
362 CHAR16 *gFunctionTwoString;
363 CHAR16 *gFunctionNineString;
364 CHAR16 *gFunctionTenString;
365 CHAR16 *gEnterString;
366 CHAR16 *gEnterCommitString;
367 CHAR16 *gEscapeString;
368 CHAR16 *gMoveHighlight;
369 CHAR16 *gMakeSelection;
370 CHAR16 *gNumericInput;
371 CHAR16 *gToggleCheckBox;
372 CHAR16 *gPromptForPassword;
373 CHAR16 *gPromptForNewPassword;
374 CHAR16 *gConfirmPassword;
375 CHAR16 *gConfirmError;
376 CHAR16 *gPressEnter;
377 CHAR16 *gEmptyString;
378 CHAR16 *gAreYouSure;
379 CHAR16 *gYesResponse;
380 CHAR16 *gNoResponse;
381 CHAR16 *gMiniString;
382 CHAR16 *gPlusString;
383 CHAR16 *gMinusString;
384 CHAR16 *gAdjustNumber;
385
386 CHAR16 gPromptBlockWidth;
387 CHAR16 gOptionBlockWidth;
388 CHAR16 gHelpBlockWidth;
389
390 //
391 // Global Procedure Defines
392 //
393 VOID
394 InitializeBrowserStrings (
395 VOID
396 )
397 ;
398
399 UINTN
400 Print (
401 IN CHAR16 *fmt,
402 ...
403 )
404 ;
405
406 UINTN
407 PrintString (
408 CHAR16 *String
409 )
410 ;
411
412 UINTN
413 PrintChar (
414 CHAR16 Character
415 )
416 ;
417
418 UINTN
419 PrintAt (
420 IN UINTN Column,
421 IN UINTN Row,
422 IN CHAR16 *fmt,
423 ...
424 )
425 ;
426
427 UINTN
428 PrintStringAt (
429 IN UINTN Column,
430 IN UINTN Row,
431 CHAR16 *String
432 )
433 ;
434
435 UINTN
436 PrintCharAt (
437 IN UINTN Column,
438 IN UINTN Row,
439 CHAR16 Character
440 )
441 ;
442
443 VOID
444 DisplayPageFrame (
445 VOID
446 )
447 ;
448
449 CHAR16 *
450 GetToken (
451 IN STRING_REF IfrBinaryTitle,
452 IN EFI_HII_HANDLE HiiHandle
453 )
454 ;
455
456 VOID
457 GetTagCount (
458 IN UINT8 *RawFormSet,
459 IN OUT UINT16 *NumberOfTags
460 )
461 ;
462
463 VOID
464 GetNumericHeader (
465 IN EFI_TAG *Tag,
466 IN UINT8 *RawFormSet,
467 IN UINT16 Index,
468 IN UINT16 NumberOfLines,
469 IN EFI_FILE_FORM_TAGS *FileFormTags,
470 IN UINT16 CurrentVariable
471 )
472 ;
473
474 VOID
475 GetQuestionHeader (
476 IN EFI_TAG *Tag,
477 IN UINT8 *RawFormSet,
478 IN UINT16 Index,
479 IN EFI_FILE_FORM_TAGS *FileFormTags,
480 IN UINT16 CurrentVariable
481 )
482 ;
483
484 VOID
485 CreateSharedPopUp (
486 IN UINTN RequestedWidth,
487 IN UINTN NumberOfLines,
488 IN CHAR16 **ArrayOfStrings
489 )
490 ;
491
492 EFI_STATUS
493 CreateDialog (
494 IN UINTN NumberOfLines,
495 IN BOOLEAN HotKey,
496 IN UINTN MaximumStringSize,
497 OUT CHAR16 *StringBuffer,
498 OUT EFI_INPUT_KEY *KeyValue,
499 IN CHAR16 *String,
500 ...
501 )
502 ;
503
504 #endif