]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Compatibility/FrameworkHiiOnUefiHiiThunk/Utility.h
HII Library Class interface refine.
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / FrameworkHiiOnUefiHiiThunk / Utility.h
1 /**@file
2
3 This file contains utility functions by HII Thunk Modules.
4
5 Copyright (c) 2006 - 2008, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef _HII_THUNK_UTILITY_H
17 #define _HII_THUNK_UTILITY_H
18
19 /**
20
21 This function returns a list of the package handles of the
22 specified type that are currently active in the HII database. The
23 pseudo-type EFI_HII_PACKAGE_TYPE_ALL will cause all package
24 handles to be listed.
25
26 If HandleBufferLength is NULL, then ASSERT.
27 If HandleBuffer is NULL, the ASSERT.
28 If PackageType is EFI_HII_PACKAGE_TYPE_GUID and PackageGuid is
29 NULL, then ASSERT.
30 If PackageType is not EFI_HII_PACKAGE_TYPE_GUID and PackageGuid is not
31 NULL, then ASSERT.
32
33
34 @param PackageType Specifies the package type of the packages
35 to list or EFI_HII_PACKAGE_TYPE_ALL for
36 all packages to be listed.
37
38 @param PackageGuid If PackageType is
39 EFI_HII_PACKAGE_TYPE_GUID, then this is
40 the pointer to the GUID which must match
41 the Guid field of
42 EFI_HII_PACKAGE_GUID_HEADER. Otherwise, it
43 must be NULL.
44
45 @param HandleBufferLength On output, the length of the handle buffer
46 that is required for the handles found.
47
48 @param HandleBuffer On output, an array of EFI_HII_HANDLE instances returned.
49 The caller is responcible to free this pointer allocated.
50
51 @retval EFI_SUCCESS The matching handles are outputed successfully.
52 HandleBufferLength is updated with the actual length.
53 @retval EFI_OUT_OF_RESOURCES Not enough resource to complete the operation.
54 @retval EFI_NOT_FOUND No matching handle could not be found in database.
55 **/
56 EFI_STATUS
57 EFIAPI
58 ListPackageLists (
59 IN UINT8 PackageType,
60 IN CONST EFI_GUID *PackageGuid,
61 IN OUT UINTN *HandleBufferLength,
62 OUT EFI_HII_HANDLE **HandleBuffer
63 )
64 ;
65
66 /**
67 Exports the contents of one or all package lists in the HII database into a buffer.
68
69 If Handle is not NULL and not a valid EFI_HII_HANDLE registered in the database,
70 then ASSERT.
71 If PackageListHeader is NULL, then ASSERT.
72 If PackageListSize is NULL, then ASSERT.
73
74 @param Handle The HII Handle.
75 @param PackageListHeader A pointer to a buffer that will contain the results of
76 the export function.
77 @param PackageListSize On output, the length of the buffer that is required for the exported data.
78
79 @retval EFI_SUCCESS Package exported.
80
81 @retval EFI_OUT_OF_RESOURCES Not enought memory to complete the operations.
82
83 **/
84 EFI_STATUS
85 EFIAPI
86 ExportPackageLists (
87 IN EFI_HII_HANDLE Handle,
88 OUT EFI_HII_PACKAGE_LIST_HEADER **PackageListHeader,
89 OUT UINTN *PackageListSize
90 )
91 ;
92
93 /**
94 Extract Hii package list GUID for given HII handle.
95
96 If HiiHandle could not be found in the HII database, then ASSERT.
97 If Guid is NULL, then ASSERT.
98
99 @param Handle Hii handle
100 @param Guid Package list GUID
101
102 @retval EFI_SUCCESS Successfully extract GUID from Hii database.
103
104 **/
105 EFI_STATUS
106 EFIAPI
107 ExtractGuidFromHiiHandle (
108 IN EFI_HII_HANDLE Handle,
109 OUT EFI_GUID *Guid
110 )
111 ;
112
113 /**
114 Find the UefiHiiHandle based on a Framework HII Handle returned by
115 the HII Thunk to Framework HII code.
116
117 @param Private The pointer to the private data of Hii Thunk.
118 @param FwHiiHandle Framework HII Handle returned by the HII Thunk to Framework HII code.
119
120 @retval NULL If Framework HII Handle passed in does not have matching UEFI HII handle.
121 @retval !NULL If the match is found.
122
123 **/
124 EFI_HII_HANDLE
125 FwHiiHandleToUefiHiiHandle (
126 IN CONST HII_THUNK_PRIVATE_DATA *Private,
127 IN FRAMEWORK_EFI_HII_HANDLE FwHiiHandle
128 );
129
130 HII_THUNK_CONTEXT *
131 FwHiiHandleToThunkContext (
132 IN CONST HII_THUNK_PRIVATE_DATA *Private,
133 IN FRAMEWORK_EFI_HII_HANDLE FwHiiHandle
134 );
135
136 HII_THUNK_CONTEXT *
137 UefiHiiHandleToThunkContext (
138 IN CONST HII_THUNK_PRIVATE_DATA *Private,
139 IN EFI_HII_HANDLE UefiHiiHandle
140 );
141
142 HII_THUNK_CONTEXT *
143 TagGuidToIfrPackThunkContext (
144 IN CONST HII_THUNK_PRIVATE_DATA *Private,
145 IN CONST EFI_GUID *Guid
146 );
147
148 HII_THUNK_CONTEXT *
149 CreateThunkContextForUefiHiiHandle (
150 IN EFI_HII_HANDLE UefiHiiHandle
151 );
152
153 VOID
154 DestroyThunkContextForUefiHiiHandle (
155 IN HII_THUNK_PRIVATE_DATA *Private,
156 IN EFI_HII_HANDLE UefiHiiHandle
157 );
158
159 UINTN
160 GetPackageCountByType (
161 IN CONST EFI_HII_PACKAGE_LIST_HEADER *PackageListHeader,
162 IN UINT8 PackageType
163 );
164
165 EFI_STATUS
166 CreateQuestionIdMap (
167 IN OUT HII_THUNK_CONTEXT *ThunkContext
168 );
169
170 VOID
171 GetAttributesOfFirstFormSet (
172 IN OUT HII_THUNK_CONTEXT *ThunkContext
173 );
174
175 LIST_ENTRY *
176 GetMapEntryListHead (
177 IN CONST HII_THUNK_CONTEXT *ThunkContext,
178 IN UINT16 VarStoreId
179 );
180
181 HII_THUNK_CONTEXT *
182 CreateThunkContext (
183 IN HII_THUNK_PRIVATE_DATA *Private,
184 IN UINTN StringPackageCount,
185 IN UINTN IfrPackageCount
186 );
187
188 VOID
189 DestroyThunkContext (
190 IN HII_THUNK_CONTEXT *ThunkContext
191 );
192
193 VOID
194 DestoryOneOfOptionMap (
195 IN LIST_ENTRY *OneOfOptionMapListHead
196 );
197
198 VOID
199 GetFormSetGuid (
200 IN EFI_HII_PACKAGE_HEADER *Package,
201 OUT EFI_GUID *FormSetGuid
202 )
203 ;
204
205 EFI_HII_PACKAGE_HEADER *
206 GetIfrPackage (
207 IN CONST EFI_HII_PACKAGES *Packages
208 )
209 ;
210
211 FORM_BROWSER_FORMSET *
212 ParseFormSet (
213 IN EFI_HII_HANDLE UefiHiiHandle
214 )
215 ;
216
217 #endif