]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Ui.h
Change the FormBrowser behavior of "Pressing ESC":
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Ui.h
index 2c144486ddbe2c257cdd06817eedde3aff741caa..f7d4ad1d7fdecf31424f84430055a72031dc2717 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Private structure, MACRO and function definitions for User Interface related functionalities.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation\r
+Copyright (c) 2004 - 2009, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -58,7 +58,6 @@ typedef enum {
   CfPrepareToReadKey,\r
   CfReadKey,\r
   CfScreenOperation,\r
-  CfUiPrevious,\r
   CfUiSelect,\r
   CfUiReset,\r
   CfUiLeft,\r
@@ -145,13 +144,21 @@ typedef struct {
 \r
 #define MENU_OPTION_FROM_LINK(a)  CR (a, UI_MENU_OPTION, Link, UI_MENU_OPTION_SIGNATURE)\r
 \r
-typedef struct {\r
+typedef struct _UI_MENU_LIST UI_MENU_LIST;\r
+\r
+struct _UI_MENU_LIST {\r
   UINTN           Signature;\r
-  LIST_ENTRY      MenuLink;\r
+  LIST_ENTRY      Link;\r
 \r
+  EFI_GUID        FormSetGuid;\r
   UINT16          FormId;\r
   UINT16          QuestionId;\r
-} UI_MENU_LIST;\r
+\r
+  UI_MENU_LIST    *Parent;\r
+  LIST_ENTRY      ChildListHead;\r
+};\r
+\r
+#define UI_MENU_LIST_FROM_LINK(a)  CR (a, UI_MENU_LIST, Link, UI_MENU_LIST_SIGNATURE)\r
 \r
 typedef struct _MENU_REFRESH_ENTRY {\r
   struct _MENU_REFRESH_ENTRY  *Next;\r
@@ -173,7 +180,6 @@ typedef struct {
 } SCREEN_OPERATION_T0_CONTROL_FLAG;\r
 \r
 \r
-extern LIST_ENTRY          gMenuList;\r
 extern MENU_REFRESH_ENTRY  *gMenuRefreshHead;\r
 extern UI_MENU_SELECTION   *gCurrentSelection;\r
 extern BOOLEAN             mHiiPackageListUpdated;\r
@@ -200,34 +206,60 @@ UiInitMenuList (
   );\r
 \r
 /**\r
-  Remove a Menu in list, and return FormId/QuestionId for previous Menu.\r
-\r
-  @param  Selection              Menu selection.\r
+  Free Menu option linked list.\r
 \r
 **/\r
 VOID\r
-UiRemoveMenuListEntry (\r
-  OUT UI_MENU_SELECTION  *Selection\r
+UiFreeMenu (\r
+  VOID\r
   );\r
 \r
 /**\r
-  Free Menu option linked list.\r
+  Create a menu with specified formset GUID and form ID, and add it as a child\r
+  of the given parent menu.\r
+\r
+  @param  Parent                 The parent of menu to be added.\r
+  @param  FormSetGuid            The Formset Guid of menu to be added.\r
+  @param  FormId                 The Form ID of menu to be added.\r
+\r
+  @return A pointer to the newly added menu or NULL if memory is insufficient.\r
 \r
 **/\r
-VOID\r
-UiFreeMenuList (\r
-  VOID\r
+UI_MENU_LIST *\r
+UiAddMenuList (\r
+  IN OUT UI_MENU_LIST     *Parent,\r
+  IN EFI_GUID             *FormSetGuid,\r
+  IN UINT16               FormId\r
   );\r
 \r
 /**\r
-  Add one menu entry to the linked lst\r
+  Search Menu with given FormId in the parent menu and all its child menus.\r
 \r
-  @param  Selection              Menu selection.\r
+  @param  Parent                 The parent of menu to search.\r
+  @param  FormId                 The Form ID of menu to search.\r
+\r
+  @return A pointer to menu found or NULL if not found.\r
 \r
 **/\r
-VOID\r
-UiAddMenuListEntry (\r
-  IN UI_MENU_SELECTION            *Selection\r
+UI_MENU_LIST *\r
+UiFindChildMenuList (\r
+  IN UI_MENU_LIST         *Parent,\r
+  IN UINT16               FormId\r
+  );\r
+\r
+/**\r
+  Search Menu with given FormSetGuid and FormId in all cached menu list.\r
+\r
+  @param  FormSetGuid            The Formset GUID of the menu to search.\r
+  @param  FormId                 The Form ID of menu to search.\r
+\r
+  @return A pointer to menu found or NULL if not found.\r
+\r
+**/\r
+UI_MENU_LIST *\r
+UiFindMenuList (\r
+  IN EFI_GUID             *FormSetGuid,\r
+  IN UINT16               FormId\r
   );\r
 \r
 /**\r
@@ -235,7 +267,7 @@ UiAddMenuListEntry (
 \r
 **/\r
 VOID\r
-UiFreeMenu (\r
+UiFreeRefreshList (\r
   VOID\r
   );\r
 \r
@@ -557,7 +589,7 @@ ClearLines (
 \r
   This function handles the Unicode string with NARROW_CHAR\r
   and WIDE_CHAR control characters. NARROW_HCAR and WIDE_CHAR\r
-  does not count in the resultant output. If a WIDE_CHAR is \r
+  does not count in the resultant output. If a WIDE_CHAR is\r
   hit, then 2 Unicode character will consume an output storage\r
   space with size of CHAR16 till a NARROW_CHAR is hit.\r
 \r