Add support for newly defined Browser action type EFI_BROWSER_ACTION_FORM_OPEN and EFI_BROWSER_ACTION_FORM_CLOSE in UEFI spec.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9362 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xdu2 2009-10-26 03:04:31 +00:00
parent 3dde743f62
commit f4a2af1f4d
1 changed files with 80 additions and 1 deletions

View File

@ -866,6 +866,52 @@ SetupBrowser (
return Status; return Status;
} }
//
// Before display the formset, invoke ConfigAccess.Callback() with EFI_BROWSER_ACTION_FORM_OPEN
//
ConfigAccess = Selection->FormSet->ConfigAccess;
if ((ConfigAccess != NULL) && (Selection->Action != UI_ACTION_REFRESH_FORMSET)) {
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
mHiiPackageListUpdated = FALSE;
Status = ConfigAccess->Callback (
ConfigAccess,
EFI_BROWSER_ACTION_FORM_OPEN,
0,
EFI_IFR_TYPE_UNDEFINED,
NULL,
&ActionRequest
);
if (!EFI_ERROR (Status)) {
switch (ActionRequest) {
case EFI_BROWSER_ACTION_REQUEST_RESET:
gResetRequired = TRUE;
break;
case EFI_BROWSER_ACTION_REQUEST_SUBMIT:
//
// Till now there is no uncommitted data, so ignore this request
//
break;
case EFI_BROWSER_ACTION_REQUEST_EXIT:
Selection->Action = UI_ACTION_EXIT;
break;
default:
break;
}
}
if (mHiiPackageListUpdated) {
//
// IFR is updated during callback, force to reparse the IFR binary
//
Selection->Action = UI_ACTION_REFRESH_FORMSET;
goto Done;
}
}
// //
// Initialize current settings of Questions in this FormSet // Initialize current settings of Questions in this FormSet
// //
@ -944,7 +990,6 @@ SetupBrowser (
HiiValue->Value.string = NewString ((CHAR16 *) Statement->BufferValue, Selection->FormSet->HiiHandle); HiiValue->Value.string = NewString ((CHAR16 *) Statement->BufferValue, Selection->FormSet->HiiHandle);
} }
ConfigAccess = Selection->FormSet->ConfigAccess;
if (ConfigAccess == NULL) { if (ConfigAccess == NULL) {
return EFI_UNSUPPORTED; return EFI_UNSUPPORTED;
} }
@ -1008,6 +1053,40 @@ SetupBrowser (
} }
} while (Selection->Action == UI_ACTION_REFRESH_FORM); } while (Selection->Action == UI_ACTION_REFRESH_FORM);
//
// Before exit the formset, invoke ConfigAccess.Callback() with EFI_BROWSER_ACTION_FORM_CLOSE
//
if ((ConfigAccess != NULL) && (Selection->Action == UI_ACTION_EXIT)) {
ActionRequest = EFI_BROWSER_ACTION_REQUEST_NONE;
Status = ConfigAccess->Callback (
ConfigAccess,
EFI_BROWSER_ACTION_FORM_CLOSE,
0,
EFI_IFR_TYPE_UNDEFINED,
NULL,
&ActionRequest
);
if (!EFI_ERROR (Status)) {
switch (ActionRequest) {
case EFI_BROWSER_ACTION_REQUEST_RESET:
gResetRequired = TRUE;
break;
case EFI_BROWSER_ACTION_REQUEST_SUBMIT:
SubmitForm (Selection->FormSet, Selection->Form);
break;
case EFI_BROWSER_ACTION_REQUEST_EXIT:
gNvUpdateRequired = FALSE;
break;
default:
break;
}
}
}
// //
// Record the old formset // Record the old formset
// //