/* Copyright (c) 2000-2006 ActiveState Software Inc.
   See the file LICENSE.txt for licensing information. */

#include "nsISupports.idl"
#include "koIDocument.idl"
interface koIAsyncCallback;

/**
 * This allows for querying of information on a particular installation of an
 * application.
 *
 * Application information (like executable paths and version information) will
 * be cached for each instance.
 */
[scriptable, uuid(61a45a55-0cb0-4019-b1a7-8096ab2cca88)]
interface koIAppInfoEx : nsISupports {
    // Query for a list of found installation executables for this application.
    // Can be slow, as some executables may require validation, which means
    // running the interpreters in a process.
    void FindExecutables(out unsigned long count,
                         [retval, array, size_is(count)] out wstring strs);
    // Async version of FindExecutables.
    void FindExecutablesAsync(in koIAsyncCallback callback);

    // Query for a list of found installation paths for this application. These
    // are the installation directories for the paths found by
    // FindExecutables, typically the parent directories.
    void FindInstallationPaths(out unsigned long count,
                               [retval,
                                array,
                                size_is(count)] out wstring strs);
    // Given the path to an interpreter binary, return the
    // path of the installation
    wstring getInstallationPathFromBinary(in wstring binaryPath);

    // Resets any cached information.
    void reset();

    // The specific installation path for which the other attributes
    // apply to. It may be required for this to be set for certain
    // attributes to be determined.
    attribute wstring installationPath;

    // The path to the executable for the interpreter e.g. "usr/bin/perl"
    attribute wstring executablePath;

    wstring getExecutableFromPrefs(in koIPreferenceSet prefset);

    wstring getExecutableFromDocument(in koIDocument koDoc);

    // True if user is licensed for the current version of this app.
    // (For an app that does not require a license this will always be
    //  true.)
    attribute boolean haveLicense;

    // version (duh, null if don't know how to determine)
    attribute string version;
    // The build number. (May be null if it is not applicable.)
    attribute long buildNumber;

    // path to local help file (null if none)
    attribute wstring localHelpFile;
    // Web URL to main help file (null if none)
    attribute wstring webHelpURL;
    
    // Return true if the language's current installation has the given modules.
    boolean haveModules(in unsigned long count,
                        [array, size_is(count)] in wstring modules);

    // A few methods from several of the subclasses should go here:
    wstring getVersionForBinary(in wstring binaryPath);
    
    // determines if php is 4.0.5 or later
    readonly attribute boolean valid_version;

    // Determine if the given binary is a supported version.
    boolean isSupportedBinary(in wstring binaryPath);
};

[scriptable, uuid(3E2D6B06-3488-4069-B471-2510DE0109C2)]
interface koIPerlInfoEx : koIAppInfoEx {
    boolean isMsysPerl();
    boolean isPerlCriticInstalled(in boolean forceCheck);
    double getPerlCriticVersion();
};


[scriptable, uuid(e31fcd80-dca2-4174-8d7d-243423775b95)]
interface koIPHPInfoEx : koIAppInfoEx {
    // The PHP.ini file which would be used by the given PHP installation.
    // NOTE: This cannot handle the case where an alternate PHP.ini file
    //       is typically specified on the command line of the PHP
    //       invocation.
    attribute wstring cfg_file_path;
    // get the sapi version (cgi, cgi-fcgi, cli, etc.)
    readonly attribute wstring sapi;
    readonly attribute wstring cliExecutable;
    readonly attribute wstring cgiExecutable;

    // Configuration items of interest.
    // where php looks for included files
    readonly attribute wstring include_path;
    void GetIncludePathArray(out unsigned long count,    // must use method
                             [retval,               // retval to return array
                              array,
                              size_is(count)] out wstring strs);
    // where activedebug extension is located
    readonly attribute wstring extension_dir;
    // True if the ActiveState debugging extension is loadable.
    readonly attribute boolean isDebuggerExtensionLoadable;
    readonly attribute wstring phpBuildInfo;
    
    wstring autoConfigureDebugger();
};

[scriptable, uuid(7f582dbf-b88a-407e-a3b5-726b3e766afa)]
interface koITclInfoEx : koIAppInfoEx {
    readonly attribute wstring tclsh_path;
    readonly attribute wstring wish_path;
};
