]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabase.h
Clean up the private GUID definition in module Level.
[mirror_edk2.git] / MdeModulePkg / Universal / HiiDatabaseDxe / HiiDatabase.h
index 5d10d46a8c2cb34130c794e7ee2c78dfa6f9ee8a..783fc7ecc132e3b9d31172be9960628c12142798 100644 (file)
@@ -1,8 +1,8 @@
 /** @file\r
 Private structures definitions in HiiDatabase.\r
 \r
-Copyright (c) 2007 - 2009, Intel Corporation\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2007 - 2011, 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
 http://opensource.org/licenses/bsd-license.php\r
@@ -42,12 +42,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/UefiRuntimeServicesTableLib.h>\r
 #include <Library/PrintLib.h>\r
 \r
-\r
-#define HII_DATABASE_NOTIFY_GUID \\r
-  { \\r
-    0xc1c76, 0xd79e, 0x42fe, {0x86, 0xb, 0x8b, 0xe8, 0x7b, 0x3e, 0x7a, 0x78} \\r
-  }\r
-\r
 #define MAX_STRING_LENGTH                  1024\r
 #define MAX_FONT_NAME_LEN                  256\r
 #define NARROW_BASELINE                    15\r
@@ -88,7 +82,7 @@ typedef struct {
 \r
 typedef struct {\r
   LIST_ENTRY          Entry;\r
-  EFI_STRING_ID       DefaultName;\r
+  UINT8               OpCode;\r
   UINT16              DefaultId;\r
   UINT64              Value;\r
 } IFR_DEFAULT_DATA;\r
@@ -126,6 +120,7 @@ typedef struct _HII_STRING_PACKAGE_INSTANCE {
   LIST_ENTRY                            StringEntry;\r
   LIST_ENTRY                            FontInfoList;  // local font info list\r
   UINT8                                 FontId;\r
+  EFI_STRING_ID                         MaxStringId;   // record StringId\r
 } HII_STRING_PACKAGE_INSTANCE;\r
 \r
 //\r
@@ -156,6 +151,8 @@ typedef struct _HII_SIMPLE_FONT_PACKAGE_INSTANCE {
 typedef struct _HII_FONT_PACKAGE_INSTANCE {\r
   UINTN                                 Signature;\r
   EFI_HII_FONT_PACKAGE_HDR              *FontPkgHdr;\r
+  UINT16                                Height;\r
+  UINT16                                BaseLine;\r
   UINT8                                 *GlyphBlock;\r
   LIST_ENTRY                            FontEntry;\r
   LIST_ENTRY                            GlyphInfoList;\r
@@ -421,8 +418,9 @@ GetSystemFont (
 /**\r
   Parse all string blocks to find a String block specified by StringId.\r
   If StringId = (EFI_STRING_ID) (-1), find out all EFI_HII_SIBT_FONT blocks\r
-  within this string package and backup its information.\r
-  If StringId = 0, output the string id of last string block (EFI_HII_SIBT_END).\r
+  within this string package and backup its information. If LastStringId is \r
+  specified, the string id of last string block will also be output.\r
+  If StringId = 0, output the string id of last string block (EFI_HII_SIBT_STRING).\r
 \r
   @param  Private                 Hii database private structure.\r
   @param  StringPackage           Hii string package instance.\r
@@ -432,7 +430,8 @@ GetSystemFont (
   @param  StringBlockAddr         Output the block address of found string block.\r
   @param  StringTextOffset        Offset, relative to the found block address, of\r
                                   the  string text information.\r
-  @param  LastStringId            Output the last string id when StringId = 0.\r
+  @param  LastStringId            Output the last string id when StringId = 0 or StringId = -1.\r
+  @param  StartStringId           The first id in the skip block which StringId in the block.\r
 \r
   @retval EFI_SUCCESS             The string text and font is retrieved\r
                                   successfully.\r
@@ -450,7 +449,8 @@ FindStringBlock (
   OUT UINT8                           *BlockType, OPTIONAL\r
   OUT UINT8                           **StringBlockAddr, OPTIONAL\r
   OUT UINTN                           *StringTextOffset, OPTIONAL\r
-  OUT EFI_STRING_ID                   *LastStringId OPTIONAL\r
+  OUT EFI_STRING_ID                   *LastStringId, OPTIONAL\r
+  OUT EFI_STRING_ID                   *StartStringId OPTIONAL\r
   );\r
 \r
 \r
@@ -484,6 +484,34 @@ FindGlyphBlock (
   OUT UINTN                          *GlyphBufferLen OPTIONAL\r
   );\r
 \r
+/**\r
+  This function exports Form packages to a buffer.\r
+  This is a internal function.\r
+\r
+  @param  Private                Hii database private structure.\r
+  @param  Handle                 Identification of a package list.\r
+  @param  PackageList            Pointer to a package list which will be exported.\r
+  @param  UsedSize               The length of buffer be used.\r
+  @param  BufferSize             Length of the Buffer.\r
+  @param  Buffer                 Allocated space for storing exported data.\r
+  @param  ResultSize             The size of the already exported content of  this\r
+                                 package list.\r
+\r
+  @retval EFI_SUCCESS            Form Packages are exported successfully.\r
+  @retval EFI_INVALID_PARAMETER  Any input parameter is invalid.\r
+\r
+**/\r
+EFI_STATUS\r
+ExportFormPackages (\r
+  IN HII_DATABASE_PRIVATE_DATA          *Private,\r
+  IN EFI_HII_HANDLE                     Handle,\r
+  IN HII_DATABASE_PACKAGE_LIST_INSTANCE *PackageList,\r
+  IN UINTN                              UsedSize,\r
+  IN UINTN                              BufferSize,\r
+  IN OUT VOID                           *Buffer,\r
+  IN OUT UINTN                          *ResultSize\r
+  );\r
+\r
 //\r
 // EFI_HII_FONT_PROTOCOL protocol interfaces\r
 //\r
@@ -1026,7 +1054,8 @@ HiiSetString (
   @param  This                    A pointer to the EFI_HII_STRING_PROTOCOL\r
                                   instance.\r
   @param  PackageList             The package list to examine.\r
-  @param  Languages               Points to the buffer to hold the returned string.\r
+  @param  Languages               Points to the buffer to hold the returned\r
+                                  null-terminated ASCII string.\r
   @param  LanguagesSize           On entry, points to the size of the buffer\r
                                   pointed to by  Languages, in bytes. On  return,\r
                                   points to the length of Languages, in bytes.\r
@@ -1058,25 +1087,28 @@ HiiGetLanguages (
   @param  This                    A pointer to the EFI_HII_STRING_PROTOCOL\r
                                   instance.\r
   @param  PackageList             The package list to examine.\r
-  @param  FirstLanguage           Points to the primary language.\r
-  @param  SecondaryLanguages      Points to the buffer to hold the returned list of\r
-                                   secondary languages for the specified\r
-                                  FirstLanguage. If there are no secondary\r
-                                  languages, the function  returns successfully,\r
+  @param  PrimaryLanguage         Points to the null-terminated ASCII string that specifies\r
+                                  the primary language. Languages are specified in the\r
+                                  format specified in Appendix M of the UEFI 2.0 specification.\r
+  @param  SecondaryLanguages      Points to the buffer to hold the returned null-terminated\r
+                                  ASCII string that describes the list of\r
+                                  secondary languages for the specified\r
+                                  PrimaryLanguage. If there are no secondary\r
+                                  languages, the function returns successfully,\r
                                   but this is set to NULL.\r
   @param  SecondaryLanguagesSize  On entry, points to the size of the buffer\r
-                                  pointed to  by SecondLanguages, in bytes. On\r
-                                  return, points to the length of SecondLanguages\r
+                                  pointed to by SecondaryLanguages, in bytes. On\r
+                                  return, points to the length of SecondaryLanguages\r
                                   in bytes.\r
 \r
   @retval EFI_SUCCESS             Secondary languages were correctly returned.\r
-  @retval EFI_INVALID_PARAMETER   FirstLanguage or SecondLanguages or\r
-                                  SecondLanguagesSize was NULL.\r
-  @retval EFI_BUFFER_TOO_SMALL    The buffer specified by SecondLanguagesSize is\r
+  @retval EFI_INVALID_PARAMETER   PrimaryLanguage or SecondaryLanguages or\r
+                                  SecondaryLanguagesSize was NULL.\r
+  @retval EFI_BUFFER_TOO_SMALL    The buffer specified by SecondaryLanguagesSize is\r
                                   too small to hold the returned information.\r
-                                  SecondLanguageSize is updated to hold the size of\r
+                                  SecondaryLanguageSize is updated to hold the size of\r
                                   the buffer required.\r
-  @retval EFI_INVALID_LANGUAGE           The language specified by FirstLanguage is not\r
+  @retval EFI_INVALID_LANGUAGE    The language specified by PrimaryLanguage is not\r
                                   present in the specified package list.\r
   @retval EFI_NOT_FOUND          The specified PackageList is not in the Database.                                \r
 \r
@@ -1086,7 +1118,7 @@ EFIAPI
 HiiGetSecondaryLanguages (\r
   IN CONST EFI_HII_STRING_PROTOCOL   *This,\r
   IN EFI_HII_HANDLE                  PackageList,\r
-  IN CONST CHAR8                     *FirstLanguage,\r
+  IN CONST CHAR8                     *PrimaryLanguage,\r
   IN OUT CHAR8                       *SecondaryLanguages,\r
   IN OUT UINTN                       *SecondaryLanguagesSize\r
   );\r
@@ -1106,6 +1138,8 @@ HiiGetSecondaryLanguages (
   @param  PackageList             A pointer to an EFI_HII_PACKAGE_LIST_HEADER\r
                                   structure.\r
   @param  DriverHandle            Associate the package list with this EFI handle.\r
+                                  If a NULL is specified, this data will not be associate\r
+                                  with any drivers and cannot have a callback induced.\r
   @param  Handle                  A pointer to the EFI_HII_HANDLE instance.\r
 \r
   @retval EFI_SUCCESS             The package list associated with the Handle was\r
@@ -1120,7 +1154,7 @@ EFIAPI
 HiiNewPackageList (\r
   IN CONST EFI_HII_DATABASE_PROTOCOL    *This,\r
   IN CONST EFI_HII_PACKAGE_LIST_HEADER  *PackageList,\r
-  IN CONST EFI_HANDLE                   DriverHandle,\r
+  IN CONST EFI_HANDLE                   DriverHandle, OPTIONAL\r
   OUT EFI_HII_HANDLE                    *Handle\r
   );\r
 \r
@@ -1716,6 +1750,24 @@ HiiGetAltCfg (
   OUT EFI_STRING                               *AltCfgResp\r
   );\r
 \r
+\r
+/**\r
+  Compare whether two names of languages are identical.\r
+\r
+  @param  Language1              Name of language 1 from StringPackage\r
+  @param  Language2              Name of language 2 to be compared with language 1.\r
+\r
+  @retval TRUE                   same\r
+  @retval FALSE                  not same\r
+\r
+**/\r
+BOOLEAN\r
+HiiCompareLanguage (\r
+  IN  CHAR8  *Language1,\r
+  IN  CHAR8  *Language2\r
+  )\r
+;\r
+\r
 //\r
 // Global variables\r
 //\r