package talk;

/**
   ITalkSession is an interface that a frontend can use to communcate
   with a backend for a single talk session.  It communicates with an
   ITalkView to display the output from a remote user and get input
   from the local user.  The frontend creates an ITalkSession, and
   uses the functions in this interface to tell the backend what to
   do.   */

public interface ITalkSession {
    
  /** Initiate a talk session with the specified user, host, and tty,
      from the specified local user.  The connect function will return
      immediately.  The frontend will know if/when a connection has
      actually been established when ITalkView.connected() is
      called, or that it failed when ITalkView.connectFailed() is
      called.  */ 
  public void connect(String ruser, String rhost, String rtty,
		      String luser, String lhost);

  /** Disconnect the current connection.  Will call its view's
      disconnected() method when done. */
  public void disconnect();

  /** Returns true if this session is currently connected */
  public boolean isConnected();

  /** Sends a string to the remote user for this session. */
  public void sendUserInput(String input);

  /** Sends backspace to the remote user for this session. */
  public void sendBackspace();

}
