package nxm.sys.inc;

import nxm.sys.lib.Terminal;

/** Interface for all objects that are allowed to be parents of a Shell.
    Parents provide the details of the context in which the shell is
    executing.  This includes things like loading and saving state, some of
    the configuration steps, etc.

    @author Jeff Schoen / Neon Ngo
    @version $Id: ShellParent.java,v 1.19 2014/10/21 18:37:25 ntn Exp $
 */
public interface ShellParent {
  /** Return the full path that should be used for the codebase. The codebase is
      the directory that all of the NeXtMidas code is assumed to reside under.
      @return The NMROOT full path. This should must not be null.
   */
  String getNmRoot();

  /** Retrieve the arguments used to set the aux path.  These arguments are
      passed verbatim to the AUX command during the initialization of the
      Shell.  Since the string is interpreted as the argument to the aux
      command it should specify the write path and optionally the read path.
      See the help on the aux command for detailed information.<br>
      <br>
      If there is no explicit aux path to be set then this method should
      simply return null.
      @return The arguments to the AUX command or null if there is to be no
              special configuring.
   */
  String getAux();

  /** Return the option trees that are to be loaded by the Shell on startup.
      The String is a list of comma separated option tree names. The details
      on how the option trees are specified is left to the child class but
      normally it would use a property with the same name as OPT_STR.
      @return A comma separated list of option trees to configure on startup
              or null if there are none.
   */
  String getOpts();

  /** Return the current working directory.
      @return The current working directory or null if there is none.
   */
  String getCWD();

  /** Gets the NM Startup script.
      @return The URL of the NM Startup script or null if none.
   */
  String getNMS();

  /** Return the directory that should be used as a home directory for the Shell.
      This is also used as the initial HOMEPATH.
      @return A string specifying the home directory for the Shell or null if none.
   */
  String getHome();

  /** Return the hostname where the execution of this Shell originated.  For
      servlets this should specify the hostname where the code was
      retrieved from.  For locally running Shells this should return null.
      @return The name of the origin host or null if the host is the local machine.
  */
  String getServer();

  /** The theme to use. This will get set into "ENV.THEME")
      @return Name of theme to use, null to use system default.
      @since NeXtMidas 2.9.3
   */
  String getTheme();

  /** The theme style to use. This will get set into "ENV.STYLE")
      @return Name of style to use, null to use system default.
      @since NeXtMidas 2.9.3
   */
   String getStyle();

   /** Returns a terminal that NeXtMidas should use, null if the Shell should pick
       an appropriate terminal.
       @since NeXtMidas 3.3.0
       @return a terminal that NeXtMidas should use, null if the Shell should pick.
    */
   Terminal getTerminal();
}
