]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/SetupBrowserDxe/Ui.h
Refine code to follow coding style.
[mirror_edk2.git] / MdeModulePkg / Universal / SetupBrowserDxe / Ui.h
index 53309623cd720e287a65abc6f0ec456aad434c9f..03cb0cd7530945380678c42a3f9c019773887dae 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 Private structure, MACRO and function definitions for User Interface related functionalities.\r
 \r
-Copyright (c) 2004 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
 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
@@ -195,6 +195,7 @@ typedef struct {
 \r
 \r
 extern LIST_ENTRY          gMenuOption;\r
+extern LIST_ENTRY          gMenuList;\r
 extern MENU_REFRESH_ENTRY  *gMenuRefreshHead;\r
 extern UI_MENU_SELECTION   *gCurrentSelection;\r
 extern BOOLEAN             mHiiPackageListUpdated;\r
@@ -250,9 +251,10 @@ UiAddMenuList (
   );\r
 \r
 /**\r
-  Search Menu with given FormId in the parent menu and all its child menus.\r
+  Search Menu with given FormId, FormSetGuid and Handle in all cached menu list.\r
 \r
   @param  Parent                 The parent of menu to search.\r
+  @param  Handle                 Hii handle related to this formset.\r
   @param  FormSetGuid            The Formset GUID of the menu to search.  \r
   @param  FormId                 The Form ID of menu to search.\r
 \r
@@ -262,13 +264,15 @@ UiAddMenuList (
 UI_MENU_LIST *\r
 UiFindChildMenuList (\r
   IN UI_MENU_LIST         *Parent,\r
+  IN EFI_HII_HANDLE       Handle,\r
   IN EFI_GUID             *FormSetGuid, \r
   IN UINT16               FormId\r
   );\r
 \r
 /**\r
-  Search Menu with given FormSetGuid and FormId in all cached menu list.\r
+  Search Menu with given Handle, FormSetGuid and FormId in all cached menu list.\r
 \r
+  @param  Handle                 Hii handle related to this formset.\r
   @param  FormSetGuid            The Formset GUID of the menu to search.\r
   @param  FormId                 The Form ID of menu to search.\r
 \r
@@ -277,10 +281,22 @@ UiFindChildMenuList (
 **/\r
 UI_MENU_LIST *\r
 UiFindMenuList (\r
+  IN EFI_HII_HANDLE       Handle,\r
   IN EFI_GUID             *FormSetGuid,\r
   IN UINT16               FormId\r
   );\r
 \r
+/**\r
+  Free Menu list linked list.\r
+\r
+  @param  MenuListHead    One Menu list point in the menu list.\r
+\r
+**/\r
+VOID\r
+UiFreeMenuList (\r
+  LIST_ENTRY   *MenuListHead\r
+  );\r
+\r
 /**\r
   Free Menu option linked list.\r
 \r
@@ -578,6 +594,26 @@ SetArrayData (
   IN UINT64                   Value\r
   );\r
 \r
+/**\r
+  Check whether this value already in the array, if yes, return the index.\r
+\r
+  @param  Array                  The data array.\r
+  @param  Type                   Type of the data in this array.\r
+  @param  Value                  The value to be find.\r
+  @param  Index                  The index in the array which has same value with Value.\r
+  \r
+  @retval   TRUE Found the value in the array.\r
+  @retval   FALSE Not found the value.\r
+\r
+**/\r
+BOOLEAN \r
+FindArrayData (\r
+  IN VOID                     *Array,\r
+  IN UINT8                    Type,\r
+  IN UINT64                   Value,\r
+  OUT UINTN                   *Index OPTIONAL\r
+  );\r
+\r
 /**\r
   Process a Question's Option (whether selected or un-selected).\r
 \r
@@ -604,14 +640,16 @@ ProcessOptions (
 \r
   @param  StringPtr              The entire help string.\r
   @param  FormattedString        The oupput formatted string.\r
+  @param  EachLineWidth          The string length of each line in the formatted string.\r
   @param  RowCount               TRUE: if Question is selected.\r
 \r
 **/\r
 UINTN\r
 ProcessHelpString (\r
-  IN  CHAR16                      *StringPtr,\r
-  OUT CHAR16                      **FormattedString,\r
-  IN  UINTN                       RowCount\r
+  IN  CHAR16  *StringPtr,\r
+  OUT CHAR16  **FormattedString,\r
+  OUT UINT16  *EachLineWidth,\r
+  IN  UINTN   RowCount\r
   );\r
 \r
 /**\r
@@ -672,10 +710,12 @@ GetStringWidth (
 /**\r
   Will copy LineWidth amount of a string in the OutputString buffer and return the\r
   number of CHAR16 characters that were copied into the OutputString buffer.\r
+  In the code, it deals \r,\n,\r\n same as \n\r, also it not process the \r or \g.\r
 \r
   @param  InputString            String description for this option.\r
   @param  LineWidth              Width of the desired string to extract in CHAR16\r
                                  characters\r
+  @param  GlyphWidth             The glyph width of the beging char in the string.\r
   @param  Index                  Where in InputString to start the copy process\r
   @param  OutputString           Buffer to copy the string into\r
 \r
@@ -686,6 +726,7 @@ UINT16
 GetLineByWidth (\r
   IN      CHAR16                      *InputString,\r
   IN      UINT16                      LineWidth,\r
+  IN OUT  UINT16                      *GlyphWidth,\r
   IN OUT  UINTN                       *Index,\r
   OUT     CHAR16                      **OutputString\r
   );\r