package nxm.sys.inc;

/**
  Interface Definitions for Midas I/O Devices.

  This interface defines all of the methods that a user I/O terminal
  must implement to interact with the shell.

  @author Jeff Schoen
  @version $Id: IODevice.java,v 1.9 2014/10/21 18:23:52 ntn Exp $
*/
public interface IODevice {
  /** Print a non-terminated line to the terminal.

      @param text The text to print to the terminal.
   */
  void print (String text);

  /** Print a terminated line to the terminal.

      @param text The text to print to the terminal.
   */
  void println (String text);

  /** Get a line of input from the keyboard.

      @param prompt The text to prompt the user with.
      @param seed   The default value.
      @param flags  The flags indicating how the user is to be prompted.
      @return a line of input from the keyboard.
      @todo Explain what flags can be used here.
   */
  String getInput (String prompt, String seed, int flags);

  /** Check for user interrupt from the terminal (Control-C).

      @return The user interrupt.
      @todo Explain what return values are appropriate.
   */
  int getInterrupt();

  /** Get the number of rows displayed in the terminal.

      @return the number of rows displayed in the terminal.
   */
  int getRows();

  /** Get the number of columns displayed in the terminal.

      @return The number of columns displayed in the terminal.
   */
  int getColumns();
}
