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

#include "nsISupports.idl"

// A place for light PyXPCOM interfaces to parts of Python's std library.
// 
// Eventually, perhaps other modules in this spirit (koIOs, part of
// koISysUtils, koIWebbrowser, koIUrllib, etc.) could move here but there is
// no hurry. The idea is to create *one* file in which all further such
// interfaces can be added.
// 

[scriptable, uuid(1D55BFC1-5DCA-4CE6-85A5-22B58AB2E054)]
interface koITime : nsISupports {
    double time();
    AString asctime(in unsigned long count,
                    [array, size_is(count)] in unsigned long timetuple);
    void localtime(in double secs, out unsigned long count,
                   [retval, array, size_is(count)] out unsigned long tuple);
    AString strftime(in wstring format, in unsigned long count,
                     [array, size_is(count)] in unsigned long timetuple);
    
    // XXX Other possibly useful ones:
    //     .sleep()
    
    //---- Extra methods not strictly part of the Python 'time' module.
    
    /* Return a pretty string giving the approximate time since the
     * given path was last modified.
     */
    wstring nice_modtime_from_path(in wstring path);
};



[scriptable, uuid(862D0CE5-B99E-4eea-9355-56EDB28E6AB6)]
interface koIShUtil : nsISupports {
    // These routines all use the koILastErrorService to if an exception
    // is raised.
    void copyfile(in wstring src, in wstring dst);
    void copymode(in wstring src, in wstring dst);
    void copystat(in wstring src, in wstring dst);
    void copy(in wstring src, in wstring dst);
    void copy2(in wstring src, in wstring dst);
    void copytree(in wstring src, in wstring dst, in boolean symlinks);
    void rmtree(in wstring path, in boolean ignore_errors);
};

[scriptable, uuid(5B252430-996B-4FC5-B578-D69FF0BE470F)]
interface koIGlob : nsISupports {
    void glob(in wstring expression,
              out unsigned long count,
              [retval, array, size_is(count)] out wstring filenames);
};

