1 /** @file
2   String support
3 
4 Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution.  The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9 
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12 
13 **/
14 
15 #include "Ui.h"
16 #include "Language.h"
17 #include "FrontPage.h"
18 
19 EFI_HII_HANDLE gStringPackHandle;
20 
21 EFI_GUID mUiStringPackGuid = {
22   0x136a3048, 0x752a, 0x4bf6, { 0xa7, 0x57, 0x9, 0x36, 0x11, 0x95, 0x38, 0xed }
23 };
24 
25 /**
26   Initialize HII global accessor for string support.
27 
28 **/
29 VOID
InitializeStringSupport(VOID)30 InitializeStringSupport (
31   VOID
32   )
33 {
34   gStringPackHandle = HiiAddPackages (
35                          &mUiStringPackGuid,
36                          gImageHandle,
37                          UiAppStrings,
38                          NULL
39                          );
40   ASSERT (gStringPackHandle != NULL);
41 }
42 
43 /**
44   Remove the string package.
45 
46 **/
47 VOID
UninitializeStringSupport(VOID)48 UninitializeStringSupport (
49   VOID
50   )
51 {
52   HiiRemovePackages (gStringPackHandle);
53 }
54 
55 /**
56   Get string by string id from HII Interface
57 
58 
59   @param Id              String ID.
60 
61   @retval  CHAR16 *  String from ID.
62   @retval  NULL      If error occurs.
63 
64 **/
65 CHAR16 *
GetStringById(IN EFI_STRING_ID Id)66 GetStringById (
67   IN  EFI_STRING_ID   Id
68   )
69 {
70   return HiiGetString (gStringPackHandle, Id, NULL);
71 }
72