X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FInclude%2FLibrary%2FHiiLib.h;h=4ad4cf133f207220289d2dddc3b85774194b8083;hb=ba529e7e5a78e8f20916e1ead53b47a68ac46118;hp=b54fdd29a42c369a939bc8f9a6592b8973b58090;hpb=cd5ebaa06dca3e6ef3c464081e6defe00d358c69;p=mirror_edk2.git diff --git a/MdeModulePkg/Include/Library/HiiLib.h b/MdeModulePkg/Include/Library/HiiLib.h index b54fdd29a4..4ad4cf133f 100644 --- a/MdeModulePkg/Include/Library/HiiLib.h +++ b/MdeModulePkg/Include/Library/HiiLib.h @@ -1,7 +1,7 @@ /** @file Public include file for the HII Library -Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License that accompanies this distribution. The full text of the license may be found at @@ -48,7 +48,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. to packages terminated by a NULL. @retval NULL An HII Handle has already been registered in the HII Database with - the same PackageListGuid. + the same PackageListGuid and DeviceHandle. @retval NULL The HII Handle could not be created. @retval NULL An empty list of packages was passed in. @retval NULL All packages are empty. @@ -224,6 +224,29 @@ HiiGetHiiHandles ( ) ; +/** + This function allows a caller to extract the form set opcode form the Hii Handle. + The returned buffer is allocated using AllocatePool().The caller is responsible + for freeing the allocated buffer using FreePool(). + + @param Handle The HII handle. + @param Buffer On return, opints to a pointer which point to the buffer that contain the formset opcode. + @param BufferSize On return, points to the length of the buffer. + + @retval EFI_OUT_OF_RESOURCES No enough memory resource is allocated. + @retval EFI_NOT_FOUND Can't find the package data for the input Handle. + @retval EFI_INVALID_PARAMETER The input parameters are not correct. + @retval EFI_SUCCESS Get the formset opcode from the hii handle sucessfully. + +**/ +EFI_STATUS +EFIAPI +HiiGetFormSetFromHiiHandle( + IN EFI_HII_HANDLE Handle, + OUT EFI_IFR_FORM_SET **Buffer, + OUT UINTN *BufferSize + ); + /** Retrieves a pointer to a Null-terminated ASCII string containing the list of languages that an HII handle in the HII Database supports. The returned @@ -320,7 +343,7 @@ HiiSetToDefaults ( If it is NULL, all current configurations for the entirety of the current HII database will be validated. - @retval TURE The current configuration is valid. + @retval TRUE The current configuration is valid. @retval FALSE The current configuration is invalid. **/ BOOLEAN @@ -679,6 +702,49 @@ HiiCreateGotoOpCode ( IN EFI_QUESTION_ID QuestionId ); +/** + Create EFI_IFR_REF_OP, EFI_IFR_REF2_OP, EFI_IFR_REF3_OP and EFI_IFR_REF4_OP opcode. + + When RefDevicePath is not zero, EFI_IFR_REF4 opcode will be created. + When RefDevicePath is zero and RefFormSetId is not NULL, EFI_IFR_REF3 opcode will be created. + When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is not zero, EFI_IFR_REF2 opcode will be created. + When RefDevicePath is zero, RefFormSetId is NULL and RefQuestionId is zero, EFI_IFR_REF opcode will be created. + + If OpCodeHandle is NULL, then ASSERT(). + If any reserved bits are set in QuestionFlags, then ASSERT(). + + @param[in] OpCodeHandle The handle to the buffer of opcodes. + @param[in] RefFormId The Destination Form ID. + @param[in] Prompt The string ID for Prompt. + @param[in] Help The string ID for Help. + @param[in] QuestionFlags The flags in Question Header + @param[in] QuestionId Question ID. + @param[in] RefQuestionId The question on the form to which this link is referring. + If its value is zero, then the link refers to the top of the form. + @param[in] RefFormSetId The form set to which this link is referring. If its value is NULL, and RefDevicePath is + zero, then the link is to the current form set. + @param[in] RefDevicePath The string identifier that specifies the string containing the text representation of + the device path to which the form set containing the form specified by FormId. + If its value is zero, then the link refers to the current page. + + @retval NULL There is not enough space left in Buffer to add the opcode. + @retval Other A pointer to the created opcode. + +**/ +UINT8 * +EFIAPI +HiiCreateGotoExOpCode ( + IN VOID *OpCodeHandle, + IN EFI_FORM_ID RefFormId, + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 QuestionFlags, + IN EFI_QUESTION_ID QuestionId, + IN EFI_QUESTION_ID RefQuestionId, + IN EFI_GUID *RefFormSetId, OPTIONAL + IN EFI_STRING_ID RefDevicePath + ); + /** Create EFI_IFR_CHECKBOX_OP opcode. @@ -689,7 +755,8 @@ HiiCreateGotoOpCode ( @param[in] OpCodeHandle The handle to the buffer of opcodes. @param[in] QuestionId The question ID. @param[in] VarStoreId The storage ID. - @param[in] VarOffset The offset in Storage. + @param[in] VarOffset Offset in Storage or String ID of the name (VarName) + for this name/value pair. @param[in] Prompt The string ID for Prompt. @param[in] Help The string ID for Help. @param[in] QuestionFlags The flags in Question Header. @@ -725,7 +792,8 @@ HiiCreateCheckBoxOpCode ( @param[in] OpCodeHandle The handle to the buffer of opcodes. @param[in] QuestionId The question ID. @param[in] VarStoreId The storage ID. - @param[in] VarOffset The offset in Storage. + @param[in] VarOffset Offset in Storage or String ID of the name (VarName) + for this name/value pair. @param[in] Prompt The string ID for Prompt. @param[in] Help The string ID for Help. @param[in] QuestionFlags The flags in Question Header. @@ -767,7 +835,8 @@ HiiCreateNumericOpCode ( @param[in] OpCodeHandle The handle to the buffer of opcodes. @param[in] QuestionId The question ID. @param[in] VarStoreId The storage ID. - @param[in] VarOffset The offset in Storage. + @param[in] VarOffset Offset in Storage or String ID of the name (VarName) + for this name/value pair. @param[in] Prompt The string ID for Prompt. @param[in] Help The string ID for Help. @param[in] QuestionFlags The flags in Question Header. @@ -807,7 +876,8 @@ HiiCreateStringOpCode ( @param[in] OpCodeHandle The handle to the buffer of opcodes. @param[in] QuestionId The question ID. @param[in] VarStoreId The storage ID. - @param[in] VarOffset The offset in Storage. + @param[in] VarOffset Offset in Storage or String ID of the name (VarName) + for this name/value pair. @param[in] Prompt The string ID for Prompt. @param[in] Help The string ID for Help. @param[in] QuestionFlags The flags in Question Header. @@ -845,7 +915,8 @@ HiiCreateOneOfOpCode ( @param[in] OpCodeHandle The handle to the buffer of opcodes. @param[in] QuestionId The question ID. @param[in] VarStoreId The storage ID. - @param[in] VarOffset The offset in Storage. + @param[in] VarOffset Offset in Storage or String ID of the name (VarName) + for this name/value pair. @param[in] Prompt The string ID for Prompt. @param[in] Help The string ID for Help. @param[in] QuestionFlags The flags in Question Header. @@ -877,6 +948,107 @@ HiiCreateOrderedListOpCode ( IN VOID *DefaultsOpCodeHandle OPTIONAL ); +/** + Create EFI_IFR_TEXT_OP opcode. + + If OpCodeHandle is NULL, then ASSERT(). + + @param[in] OpCodeHandle Handle to the buffer of opcodes. + @param[in] Prompt String ID for Prompt. + @param[in] Help String ID for Help. + @param[in] TextTwo String ID for TextTwo. + + @retval NULL There is not enough space left in Buffer to add the opcode. + @retval Other A pointer to the created opcode. + +**/ +UINT8 * +EFIAPI +HiiCreateTextOpCode ( + IN VOID *OpCodeHandle, + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN EFI_STRING_ID TextTwo + ); + +/** + Create EFI_IFR_DATE_OP opcode. + + If OpCodeHandle is NULL, then ASSERT(). + If any reserved bits are set in QuestionFlags, then ASSERT(). + If any reserved bits are set in DateFlags, then ASSERT(). + + @param[in] OpCodeHandle Handle to the buffer of opcodes. + @param[in] QuestionId Question ID + @param[in] VarStoreId Storage ID, optional. If DateFlags is not + QF_DATE_STORAGE_NORMAL, this parameter is ignored. + @param[in] VarOffset Offset in Storage or String ID of the name (VarName) + for this name/value pair, optional. If DateFlags is not + QF_DATE_STORAGE_NORMAL, this parameter is ignored. + @param[in] Prompt String ID for Prompt + @param[in] Help String ID for Help + @param[in] QuestionFlags Flags in Question Header + @param[in] DateFlags Flags for date opcode + @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This + is an optional parameter that may be NULL. + + @retval NULL There is not enough space left in Buffer to add the opcode. + @retval Other A pointer to the created opcode. + +**/ +UINT8 * +EFIAPI +HiiCreateDateOpCode ( + IN VOID *OpCodeHandle, + IN EFI_QUESTION_ID QuestionId, + IN EFI_VARSTORE_ID VarStoreId, OPTIONAL + IN UINT16 VarOffset, OPTIONAL + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 QuestionFlags, + IN UINT8 DateFlags, + IN VOID *DefaultsOpCodeHandle OPTIONAL + ); + +/** + Create EFI_IFR_TIME_OP opcode. + + If OpCodeHandle is NULL, then ASSERT(). + If any reserved bits are set in QuestionFlags, then ASSERT(). + If any reserved bits are set in TimeFlags, then ASSERT(). + + @param[in] OpCodeHandle Handle to the buffer of opcodes. + @param[in] QuestionId Question ID + @param[in] VarStoreId Storage ID, optional. If TimeFlags is not + QF_TIME_STORAGE_NORMAL, this parameter is ignored. + @param[in] VarOffset Offset in Storage or String ID of the name (VarName) + for this name/value pair, optional. If TimeFlags is not + QF_TIME_STORAGE_NORMAL, this parameter is ignored. + @param[in] Prompt String ID for Prompt + @param[in] Help String ID for Help + @param[in] QuestionFlags Flags in Question Header + @param[in] TimeFlags Flags for time opcode + @param[in] DefaultsOpCodeHandle Handle for a buffer of DEFAULT opcodes. This + is an optional parameter that may be NULL. + + @retval NULL There is not enough space left in Buffer to add the opcode. + @retval Other A pointer to the created opcode. + +**/ +UINT8 * +EFIAPI +HiiCreateTimeOpCode ( + IN VOID *OpCodeHandle, + IN EFI_QUESTION_ID QuestionId, + IN EFI_VARSTORE_ID VarStoreId, OPTIONAL + IN UINT16 VarOffset, OPTIONAL + IN EFI_STRING_ID Prompt, + IN EFI_STRING_ID Help, + IN UINT8 QuestionFlags, + IN UINT8 TimeFlags, + IN VOID *DefaultsOpCodeHandle OPTIONAL + ); + /** This function updates a form that has previously been registered with the HII Database. This function will perform at most one update operation.