]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/HiiImageEx.h
MdePkg: Add the missing spec version information for header files
[mirror_edk2.git] / MdePkg / Include / Protocol / HiiImageEx.h
CommitLineData
a48d0a3d
CS
1/** @file\r
2 Protocol which allows access to the images in the images database.\r
3\r
497a5fb1 4(C) Copyright 2016-2018 Hewlett Packard Enterprise Development LP<BR>\r
a48d0a3d
CS
5\r
6This program and the accompanying materials are licensed and made available under\r
7the terms and conditions of the BSD License that accompanies this distribution.\r
8The full text of the license may be found at\r
9http://opensource.org/licenses/bsd-license.php.\r
10\r
11THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
497a5fb1
SZ
14 @par Revision Reference:\r
15 This Protocol was introduced in UEFI Specification 2.6.\r
16\r
a48d0a3d
CS
17**/\r
18\r
19#ifndef __EFI_HII_IMAGE_EX_H__\r
20#define __EFI_HII_IMAGE_EX_H__\r
21\r
22#include <Protocol/HiiImage.h>\r
23\r
24//\r
25// Global ID for the Hii Image Ex Protocol.\r
26//\r
27#define EFI_HII_IMAGE_EX_PROTOCOL_GUID \\r
28 {0x1a1241e6, 0x8f19, 0x41a9, { 0xbc, 0xe, 0xe8, 0xef, 0x39, 0xe0, 0x65, 0x46 }}\r
29\r
30typedef struct _EFI_HII_IMAGE_EX_PROTOCOL EFI_HII_IMAGE_EX_PROTOCOL;\r
31\r
32/**\r
33 The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.NewImage().\r
b16dd6c8 34 This protocol invokes EFI_HII_IMAGE_PROTOCOL.NewImage() implicitly.\r
a48d0a3d
CS
35\r
36 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
37 @param PackageList Handle of the package list where this image will\r
38 be added.\r
39 @param ImageId On return, contains the new image id, which is\r
40 unique within PackageList.\r
41 @param Image Points to the image.\r
42\r
43 @retval EFI_SUCCESS The new image was added successfully.\r
44 @retval EFI_NOT_FOUND The specified PackageList could not be found in\r
45 database.\r
46 @retval EFI_OUT_OF_RESOURCES Could not add the image due to lack of resources.\r
47 @retval EFI_INVALID_PARAMETER Image is NULL or ImageId is NULL.\r
48\r
49**/\r
50typedef\r
51EFI_STATUS\r
52(EFIAPI *EFI_HII_NEW_IMAGE_EX)(\r
53 IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r
54 IN EFI_HII_HANDLE PackageList,\r
55 OUT EFI_IMAGE_ID *ImageId,\r
56 IN CONST EFI_IMAGE_INPUT *Image\r
57 );\r
58\r
59/**\r
60 Return the information about the image, associated with the package list.\r
61 The prototype of this extension function is the same with EFI_HII_IMAGE_PROTOCOL.GetImage().\r
b16dd6c8
DB
62\r
63 This function is similar to EFI_HII_IMAGE_PROTOCOL.GetImage().The difference is that\r
64 this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the\r
65 system if the decoder of the certain image type is not supported by the\r
66 EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the\r
67 EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that\r
68 supports the requested image type.\r
a48d0a3d
CS
69\r
70 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
b16dd6c8
DB
71 @param PackageList The package list in the HII database to search for the\r
72 specified image.\r
73 @param ImageId The image's id, which is unique within PackageList.\r
a48d0a3d
CS
74 @param Image Points to the image.\r
75\r
76 @retval EFI_SUCCESS The new image was returned successfully.\r
b16dd6c8
DB
77 @retval EFI_NOT_FOUND The image specified by ImageId is not available. The specified\r
78 PackageList is not in the Database.\r
79 @retval EFI_INVALID_PARAMETER Image was NULL or ImageId was 0.\r
a48d0a3d
CS
80 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there\r
81 was not enough memory.\r
82\r
83**/\r
84typedef\r
85EFI_STATUS\r
86(EFIAPI *EFI_HII_GET_IMAGE_EX)(\r
87 IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r
88 IN EFI_HII_HANDLE PackageList,\r
89 IN EFI_IMAGE_ID ImageId,\r
90 OUT EFI_IMAGE_INPUT *Image\r
91 );\r
92\r
93/**\r
b16dd6c8
DB
94 Change the information about the image.\r
95\r
96 Same with EFI_HII_IMAGE_PROTOCOL.SetImage(),this protocol invokes\r
97 EFI_HII_IMAGE_PROTOCOL.SetImage()implicitly.\r
a48d0a3d
CS
98\r
99 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
100 @param PackageList The package list containing the images.\r
b16dd6c8 101 @param ImageId The image's id, which is unique within PackageList.\r
a48d0a3d
CS
102 @param Image Points to the image.\r
103\r
b16dd6c8 104 @retval EFI_SUCCESS The new image was successfully updated.\r
a48d0a3d
CS
105 @retval EFI_NOT_FOUND The image specified by ImageId is not in the\r
106 database. The specified PackageList is not in\r
107 the database.\r
b16dd6c8
DB
108 @retval EFI_INVALID_PARAMETER The Image was NULL, the ImageId was 0 or\r
109 the Image->Bitmap was NULL.\r
a48d0a3d
CS
110\r
111**/\r
112typedef\r
113EFI_STATUS\r
114(EFIAPI *EFI_HII_SET_IMAGE_EX)(\r
115 IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r
116 IN EFI_HII_HANDLE PackageList,\r
117 IN EFI_IMAGE_ID ImageId,\r
118 IN CONST EFI_IMAGE_INPUT *Image\r
119 );\r
120\r
121/**\r
b16dd6c8
DB
122 Renders an image to a bitmap or to the display.\r
123\r
124 The prototype of this extension function is the same with\r
125 EFI_HII_IMAGE_PROTOCOL.DrawImage(). This protocol invokes\r
126 EFI_HII_IMAGE_PROTOCOL.DrawImage() implicitly.\r
a48d0a3d
CS
127\r
128 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
129 @param Flags Describes how the image is to be drawn.\r
130 @param Image Points to the image to be displayed.\r
131 @param Blt If this points to a non-NULL on entry, this points\r
132 to the image, which is Width pixels wide and\r
133 Height pixels high. The image will be drawn onto\r
134 this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r
b16dd6c8
DB
135 If this points to a NULL on entry, then a buffer\r
136 will be allocated to hold the generated image and\r
a48d0a3d
CS
137 the pointer updated on exit. It is the caller's\r
138 responsibility to free this buffer.\r
139 @param BltX Specifies the offset from the left and top edge of\r
b16dd6c8 140 the output image of the first pixel in the image.\r
a48d0a3d 141 @param BltY Specifies the offset from the left and top edge of\r
b16dd6c8 142 the output image of the first pixel in the image.\r
a48d0a3d
CS
143\r
144 @retval EFI_SUCCESS The image was successfully drawn.\r
145 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.\r
146 @retval EFI_INVALID_PARAMETER The Image or Blt was NULL.\r
a48d0a3d
CS
147\r
148**/\r
149typedef\r
150EFI_STATUS\r
151(EFIAPI *EFI_HII_DRAW_IMAGE_EX)(\r
152 IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r
153 IN EFI_HII_DRAW_FLAGS Flags,\r
154 IN CONST EFI_IMAGE_INPUT *Image,\r
155 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
156 IN UINTN BltX,\r
157 IN UINTN BltY\r
158 );\r
159\r
160/**\r
161 Renders an image to a bitmap or the screen containing the contents of the specified\r
b16dd6c8
DB
162 image.\r
163\r
164 This function is similar to EFI_HII_IMAGE_PROTOCOL.DrawImageId(). The difference is that\r
165 this function will locate all EFI_HII_IMAGE_DECODER_PROTOCOL instances installed in the\r
166 system if the decoder of the certain image type is not supported by the\r
167 EFI_HII_IMAGE_EX_PROTOCOL. The function will attempt to decode the image to the\r
168 EFI_IMAGE_INPUT using the first EFI_HII_IMAGE_DECODER_PROTOCOL instance that\r
169 supports the requested image type.\r
a48d0a3d
CS
170\r
171 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
172 @param Flags Describes how the image is to be drawn.\r
173 @param PackageList The package list in the HII database to search for\r
174 the specified image.\r
b16dd6c8 175 @param ImageId The image's id, which is unique within PackageList.\r
a48d0a3d
CS
176 @param Blt If this points to a non-NULL on entry, this points\r
177 to the image, which is Width pixels wide and\r
178 Height pixels high. The image will be drawn onto\r
179 this image and EFI_HII_DRAW_FLAG_CLIP is implied.\r
180 If this points to a NULL on entry, then a buffer\r
181 will be allocated to hold the generated image\r
182 and the pointer updated on exit. It is the caller's\r
183 responsibility to free this buffer.\r
184 @param BltX Specifies the offset from the left and top edge of\r
185 the output image of the first pixel in the image.\r
186 @param BltY Specifies the offset from the left and top edge of\r
187 the output image of the first pixel in the image.\r
188\r
189 @retval EFI_SUCCESS The image was successfully drawn.\r
190 @retval EFI_OUT_OF_RESOURCES Unable to allocate an output buffer for Blt.\r
b16dd6c8 191 @retval EFI_INVALID_PARAMETER The Blt was NULL or ImageId was 0.\r
a48d0a3d
CS
192 @retval EFI_NOT_FOUND The image specified by ImageId is not in the database.\r
193 The specified PackageList is not in the database.\r
194\r
195**/\r
196typedef\r
197EFI_STATUS\r
198(EFIAPI *EFI_HII_DRAW_IMAGE_ID_EX)(\r
199 IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r
200 IN EFI_HII_DRAW_FLAGS Flags,\r
201 IN EFI_HII_HANDLE PackageList,\r
202 IN EFI_IMAGE_ID ImageId,\r
203 IN OUT EFI_IMAGE_OUTPUT **Blt,\r
204 IN UINTN BltX,\r
205 IN UINTN BltY\r
206 );\r
207\r
208/**\r
209 This function returns the image information to EFI_IMAGE_OUTPUT. Only the width\r
210 and height are returned to the EFI_IMAGE_OUTPUT instead of decoding the image\r
211 to the buffer. This function is used to get the geometry of the image. This function\r
212 will try to locate all of the EFI_HII_IMAGE_DECODER_PROTOCOL installed on the\r
213 system if the decoder of image type is not supported by the EFI_HII_IMAGE_EX_PROTOCOL.\r
214\r
215 @param This A pointer to the EFI_HII_IMAGE_EX_PROTOCOL instance.\r
216 @param PackageList Handle of the package list where this image will\r
217 be searched.\r
b16dd6c8 218 @param ImageId The image's id, which is unique within PackageList.\r
a48d0a3d
CS
219 @param Image Points to the image.\r
220\r
221 @retval EFI_SUCCESS The new image was returned successfully.\r
222 @retval EFI_NOT_FOUND The image specified by ImageId is not in the\r
223 database. The specified PackageList is not in the database.\r
224 @retval EFI_BUFFER_TOO_SMALL The buffer specified by ImageSize is too small to\r
225 hold the image.\r
b16dd6c8 226 @retval EFI_INVALID_PARAMETER The Image was NULL or the ImageId was 0.\r
a48d0a3d
CS
227 @retval EFI_OUT_OF_RESOURCES The bitmap could not be retrieved because there\r
228 was not enough memory.\r
229\r
230**/\r
231typedef\r
232EFI_STATUS\r
233(EFIAPI *EFI_HII_GET_IMAGE_INFO)(\r
234 IN CONST EFI_HII_IMAGE_EX_PROTOCOL *This,\r
235 IN EFI_HII_HANDLE PackageList,\r
236 IN EFI_IMAGE_ID ImageId,\r
6e227fb5 237 OUT EFI_IMAGE_OUTPUT *Image\r
a48d0a3d
CS
238 );\r
239\r
240///\r
241/// Protocol which allows access to the images in the images database.\r
242///\r
243struct _EFI_HII_IMAGE_EX_PROTOCOL {\r
244 EFI_HII_NEW_IMAGE_EX NewImageEx;\r
245 EFI_HII_GET_IMAGE_EX GetImageEx;\r
246 EFI_HII_SET_IMAGE_EX SetImageEx;\r
247 EFI_HII_DRAW_IMAGE_EX DrawImageEx;\r
248 EFI_HII_DRAW_IMAGE_ID_EX DrawImageIdEx;\r
249 EFI_HII_GET_IMAGE_INFO GetImageInfo;\r
250};\r
251\r
252extern EFI_GUID gEfiHiiImageExProtocolGuid;\r
253\r
254#endif\r