/** @file
Implements inputbar interface functions.
Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "EditInputBar.h"
#include "UefiShellDebug1CommandsLib.h"
/**
Initialize the input bar.
**/
)
{
StringSize = 0;
}
/**
Cleanup function for input bar.
**/
)
{
//
// free input bar's prompt and input string
//
}
/**
Display the prompt.
Do the requesting of input.
@param[in] LastColumn The last printable column.
@param[in] LastRow The last printable row.
**/
)
{
//
// check whether the mPrompt length and input length will
// exceed limit
//
} else {
}
//
// print " " after mPrompt
//
}
}
typedef struct {
typedef union {
/**
The refresh function for InputBar, it will wait for user input
@param[in] LastRow The last printable row.
@param[in] LastColumn The last printable column.
@retval EFI_SUCCESS The operation was successful.
**/
)
{
//
// variable initialization
//
Size = 0;
//
// back up the old screen attributes
//
//
// clear input bar
//
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_EDIT_LIBINPUTBAR_MAININPUTBAR), gShellDebug1HiiHandle, mPrompt);
//
// that's the maximum input length that can be displayed on screen
//
//
// this is a selection mPrompt, cursor will stay in edit area
//
} else {
}
//
// wait for user input
//
for (;;) {
continue;
}
//
// pressed ESC
//
Size = 0;
break;
}
//
// return pressed
//
break;
//
// backspace
//
if (Size > 0) {
Size--;
if (!NoDisplay) {
}
}
//
// VALID ASCII char pressed
//
//
// should be less than specified length
//
if (Size >= StringSize) {
continue;
}
Size++;
if (!NoDisplay) {
} else {
//
//
break;
}
}
}
//
// restore screen attributes
//
return Status;
}
/**
SetPrompt and wait for input.
@param[in] Str The prompt string.
@retval EFI_SUCCESS The operation was successful.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed.
**/
)
{
//
// FREE the old mPrompt string
//
return EFI_OUT_OF_RESOURCES;
}
return EFI_SUCCESS;
}
/**
Set the size of the string in characters.
@param[in] Size The max number of characters to accept.
@retval EFI_SUCCESS The operation was successful.
@retval EFI_OUT_OF_RESOURCES A memory allocation failed.
**/
)
{
//
// free the old ReturnStirng
//
StringSize = Size;
if (mReturnString == NULL) {
return EFI_OUT_OF_RESOURCES;
}
return EFI_SUCCESS;
}
/**
Function to retrieve the input from the user.
@retval NULL No input has been received.
@return The string that was input.
**/
)
{
return (mReturnString);
}