//
// XPIDL expression of the EAI for VRML97.
//
// Copyright 2004  Braden McDaniel
//

#include "nsISupports.idl"

%{C++
# include <nsError.h>
# define VRML_ERROR                             NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 1)
# define VRML_ERROR_ILLEGAL_ARGUMENT            NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 2)
# define VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS   NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 3)
# define VRML_ERROR_INVALID_BROWSER             NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 4)
# define VRML_ERROR_INVALID_NODE                NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 5)
# define VRML_ERROR_INVALID_VRML                NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 6)
# define VRML_ERROR_NO_SUCH_BROWSER             NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 7)
# define VRML_ERROR_NOT_SUPPORTED               NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 8)
# define VRML_ERROR_CONNECTION                  NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 9)
# define VRML_FIELD_ERROR_INVALID_FIELD         NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 10)
# define VRML_FIELD_ERROR_INVALID_EVENTIN       NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 11)
# define VRML_FIELD_ERROR_INVALID_EVENTOUT      NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_PLUGINS, 12)
%}

interface VrmlBrowser;

[scriptable, uuid(6c4e1ff8-7f23-4462-860d-65dd5cd4a694)]
interface VrmlBrowserEvent : nsISupports {
    const long INITIALIZED      = 1;
    const long SHUTDOWN         = 2;
    const long URL_ERROR        = 3;
    const long CONNECTION_ERROR = 4;
    const long LAST_IDENTIFIER  = 5;

    long getID();
    VrmlBrowser getSource();
};

[scriptable, uuid(707b31e7-db74-42a1-8967-89fd39084b9b)]
interface VrmlBrowserListener : nsISupports {
    void browserChanged(in VrmlBrowserEvent event);
};

interface VrmlBaseField;

[scriptable, uuid(ede94f03-935a-4e6a-85af-04ff5695a121)]
interface VrmlEvent : nsISupports {
    VrmlBaseField getSource();
    double getTime();
};

[scriptable, uuid(95173372-548d-44f7-b7a2-937a614cf384)]
interface VrmlEventListener : nsISupports{
    void eventOutChanged(in VrmlEvent event);
};

interface VrmlEventIn;
interface VrmlEventOut;

[scriptable, uuid(3560cbb0-20fa-40eb-8ae3-b00dbb17246b)]
interface VrmlNode : nsISupports {
    string getType(); // raises VRML_ERROR_INVALID_NODE
    string getName(); // raises VRML_ERROR_INVALID_NODE
    VrmlEventIn getEventIn(in string name);
        // raises VRML_FIELD_ERROR_INVALID_EVENTIN, VRML_ERROR_INVALID_NODE
    VrmlEventOut getEventOut(in string name);
        // raises VRML_FIELD_ERROR_INVALID_EVENTOUT, VRML_ERROR_INVALID_NODE
    void dispose(); // raises VRML_ERROR_INVALID_NODE
};

[scriptable, uuid(718d2919-4620-4515-a0c6-a455abc73b6a)]
interface VrmlBrowser : nsISupports {
    string getName();
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    string getVersion();
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    float getCurrentSpeed();
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    float getCurrentFrameRate();
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    string getWorldURL();
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    void replaceWorld(in unsigned long nodeArraySize,
                      [array, size_is(nodeArraySize)] in VrmlNode nodeArray);
        // raises VRML_ERROR_ILLEGAL_ARGUMENT, VRML_ERROR_INVALID_BROWSER,
        //        VRML_ERROR_CONNECTION
    void loadURL(in unsigned long urlArraySize,
                 [array, size_is(urlArraySize)] in string url,
                 in unsigned long paramArraySize,
                 [array, size_is(paramArraySize)] in string parameter);
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    void setDescription(in string description);
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    void createVrmlFromString(in string vrmlSyntax,
                              out unsigned long nodeArraySize,
                              [retval, array, size_is(nodeArraySize)] out VrmlNode nodeArray);
        // raises VRML_ERROR_INVALID_VRML, VRML_ERROR_INVALID_BROWSER,
        //        VRML_ERROR_CONNECTION
    void createVrmlFromURL(in unsigned long urlArraySize,
                           [array, size_is(urlArraySize)] in string url,
                           in VrmlNode node, in string event);
        // raises VRML_ERROR_INVALID_BROWSER,
        //        VRML_ERROR_INVALID_NODE, VRML_ERROR_CONNECTION
    VrmlNode getNode(in string name);
        // raises VRML_ERROR_INVALID_NODE,
        //        VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    void addRoute(in VrmlNode fromNode, in string fromEventOut,
                  in VrmlNode toNode, in string toEventIn);
        // raises VRML_FIELD_ERROR_INVALID_EVENTIN,
        //        VRML_FIELD_ERROR_INVALID_EVENTOUT,
        //        VRML_ERROR_INVALID_BROWSER,
        //        VRML_ERROR_INVALID_NODE, VRML_ERROR_CONNECTION
    void deleteRoute(in VrmlNode fromNode, in string fromEventOut,
                     in VrmlNode toNode, in string toEventIn);
        // raises VRML_FIELD_ERROR_INVALID_EVENTIN,
        //        VRML_FIELD_ERROR_INVALID_EVENTOUT,
        //        VRML_ERROR_INVALID_BROWSER,
        //        VRML_ERROR_INVALID_NODE, VRML_ERROR_CONNECTION
    void beginUpdate();
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    void endUpdate();
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    void dispose();

    void addBrowserListener(in VrmlBrowserListener listener);
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
    void removeBrowserListener(in VrmlBrowserListener listener);
        // raises VRML_ERROR_INVALID_BROWSER, VRML_ERROR_CONNECTION
};

[scriptable, uuid(75e40114-1a96-4a10-864c-c24ceda073f5)]
interface VrmlBaseField : nsISupports {
    const long SFBool       = 1;
    const long SFColor      = 2;
    const long SFFloat      = 3;
    const long SFImage      = 4;
    const long SFInt32      = 5;
    const long SFNode       = 6;
    const long SFRotation   = 7;
    const long SFString     = 8;
    const long SFTime       = 9;
    const long SFVec2f      = 10;
    const long SFVec3f      = 11;
    const long MFColor      = 12;
    const long MFFloat      = 13;
    const long MFInt32      = 14;
    const long MFNode       = 15;
    const long MFRotation   = 16;
    const long MFString     = 17;
    const long MFTime       = 18;
    const long MFVec2f      = 19;
    const long MFVec3f      = 20;
    const long UNSET_FIELD  = 21;

    const long EVENTIN      = 22;
    const long EVENTOUT     = 23;
    const long EXPOSEDFIELD = 24;

    long getType();
    long getAccessType();
    string getName();

    void addVrmlEventListener(in VrmlEventListener listener);
    void removeVrmlEventListener(in VrmlEventListener listener);
};

[scriptable, uuid(82e09137-e89d-46e5-850c-7bd7af0d97ef)]
interface VrmlEventIn : VrmlBaseField {};

[scriptable, uuid(cf1251de-195d-4a4c-8b2b-b1d44ee495f1)]
interface VrmlEventInMFColor : VrmlEventIn {
    void setValue(in unsigned long size,
                  [array, size_is(size)] in float values);
        // raises VRML_ERROR_ILLEGAL_ARGUMENT,
        //        VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
    void set1Value(in unsigned long index,
                   in unsigned long arraySize,
                   [array, size_is(arraySize)] in float value);
        // raises VRML_ERROR_ILLEGAL_ARGUMENT,
        //        VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(82b30ced-e197-4483-b863-779f1aca09f2)]
interface VrmlEventInMFFloat : VrmlEventIn {
    void setValue(in unsigned long size,
                  [array, size_is(size)] in float values);
    void set1Value(in unsigned long index, in float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(cfacb8b6-cf4e-48d3-ac3a-10df7d7d31ea)]
interface VrmlEventInMFInt32 : VrmlEventIn {
    void setValue(in unsigned long size,
                  [array, size_is(size)] in long values);
    void set1Value(in unsigned long index,
    	    	   in unsigned long arraySize,
		   [array, size_is(arraySize)] in float value);
        // raises VRML_ERROR_ILLEGAL_ARGUMENT,
        //        VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(ceba757f-760c-4ccc-b9ba-3256d38b4ef3)]
interface VrmlEventInMFNode : VrmlEventIn {
    void setValue(in unsigned long size,
                  [array, size_is(size)] in VrmlNode values);
        // raises VRML_ERROR_INVALID_NODE
    void set1Value(in unsigned long index, in VrmlNode value);
        // raises VRML_ERROR_INVALID_NODE
};

[scriptable, uuid(57ee2f18-026d-42eb-b7bd-2fb98f53f415)]
interface VrmlEventInMFRotation : VrmlEventIn {
    void setValue(in unsigned long size,
                  [array, size_is(size)] in float values);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
    void set1Value(in unsigned long index,
    	    	   in unsigned long arraySize,
                   [array, size_is(arraySize)] in float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(95e7a306-9003-4e66-bff5-6439296eb5f6)]
interface VrmlEventInMFString : VrmlEventIn {
    void setValue(in unsigned long size,
		  [array, size_is(size)] in string values);
    void set1Value(in unsigned long index, in string value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(dadaa4de-1076-49f3-9fe7-4d4fa8fe873a)]
interface VrmlEventInMFTime : VrmlEventIn {
    void setValue(in unsigned long size,
                  [array, size_is(size)] in double values);
    void set1Value(in unsigned long index, in double value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(03f617cc-1f41-4f8f-8c7a-9cc9d23bdc00)]
interface VrmlEventInMFVec2f : VrmlEventIn {
    void setValue(in unsigned long size,
                  [array, size_is(size)] in float values);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
    void set1Value(in unsigned long index,
    	    	   in unsigned long arraySize,
		   [array, size_is(arraySize)] in float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(d91952fc-698c-4569-af31-77f36d9c27c9)]
interface VrmlEventInMFVec3f : VrmlEventIn {
    void setValue(in unsigned long size,
                  [array, size_is(size)] in float values);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
    void set1Value(in unsigned long index,
    	    	   in unsigned long arraySize,
    	    	   [array, size_is(arraySize)] in float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(2c9ad3b7-ab75-4e76-a178-9cce3fa2d123)]
interface VrmlEventInSFBool : VrmlEventIn {
    void setValue(in boolean value);
};

[scriptable, uuid(4b56cf10-6987-4930-b613-6d2a7d9ec252)]
interface VrmlEventInSFColor : VrmlEventIn {
    void setValue(in unsigned long arraySize,
    	    	  [array, size_is(arraySize)] in float value);
        // raises VRML_ERROR_ILLEGAL_ARGUMENT,
        //        VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(4e8a3bcb-a027-4111-a7b0-eeef195e05a7)]
interface VrmlEventInSFFloat : VrmlEventIn {
    void setValue(in float value);
};

[scriptable, uuid(ae485b81-dba5-48fb-b10e-0f672e7c03d5)]
interface VrmlEventInSFImage : VrmlEventIn {
    void setValue(in unsigned long width, in unsigned long height,
                  in unsigned long numComponents,
		  in unsigned long pixelArraySize,
                  [array, size_is(pixelArraySize)] in unsigned long pixels);
        // raises VRML_ERROR_ILLEGAL_ARGUMENT,
        //        VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(42ec0052-b9b0-4aab-8403-31d70331f22b)]
interface VrmlEventInSFInt32 : VrmlEventIn {
    void setValue(in long value);
};

[scriptable, uuid(9d7247db-5e0a-4e04-94e4-70ba3fd8c7f1)]
interface VrmlEventInSFNode : VrmlEventIn {
    void setValue(in VrmlNode value); // raises VRML_ERROR_INVALID_NODE
};

[scriptable, uuid(f186bdd4-01d8-417a-97ef-615a02350830)]
interface VrmlEventInSFRotation : VrmlEventIn {
    void setValue(in unsigned long arraySize,
    	    	  [array, size_is(arraySize)] in float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(08c482ac-8097-489b-935a-056a0795b1bc)]
interface VrmlEventInSFString : VrmlEventIn {
    void setValue(in string value);
};

[scriptable, uuid(8230166d-4df5-4950-9022-49472167892f)]
interface VrmlEventInSFTime : VrmlEventIn {
    void setValue(in double value);
};

[scriptable, uuid(11b2b140-2dac-4eb3-b227-ff806fbb954b)]
interface VrmlEventInSFVec2f : VrmlEventIn {
    void setValue(in unsigned long arraySize,
    	    	  [array, size_is(arraySize)] in float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(5f9d3b98-3360-4a47-96b1-41178f2076d1)]
interface VrmlEventInSFVec3f : VrmlEventIn {
    void setValue(in unsigned long arraySize,
    	    	  [array, size_is(arraySize)] in float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(48e6406d-f570-4aa7-b99c-b4d75b2eb172)]
interface VrmlEventOut : VrmlBaseField {};

[scriptable, uuid(c5cc0345-9d52-4a66-8713-6b6c9ba75cb2)]
interface VrmlEventOutMField : VrmlEventOut {
    unsigned long getSize();
};

[scriptable, uuid(dc58b7df-1a57-4612-aafb-8ac209df7cdd)]
interface VrmlEventOutMFColor : VrmlEventOutMField {
    void getValue(out unsigned long size,
                  [retval, array, size_is(size)] out float values);
    void get1Value(in unsigned long index,
    	    	   in unsigned long arraySize,
                   [retval, array, size_is(arraySize)] out float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(0fabe472-b553-429f-8c75-66fc16d20bb4)]
interface VrmlEventOutMFFloat : VrmlEventOutMField {
    void getValue(out unsigned long size,
                  [retval, array, size_is(size)] out float values);
    float get1Value(in unsigned long index);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(9287d84b-56cf-4c91-a70c-73f5e07e8871)]
interface VrmlEventOutMFInt32 : VrmlEventOutMField {
    void getValue(out unsigned long size,
                  [retval, array, size_is(size)] out long values);
    long get1Value(in unsigned long index);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(403d3098-3410-430a-b5d2-27d32c3eb1b0)]
interface VrmlEventOutMFNode : VrmlEventOutMField {
    void getValue(out unsigned long size,
                  [retval, array, size_is(size)] out VrmlNode values);
    VrmlNode get1Value(in unsigned long index);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(bc4d3620-3632-4082-b6fd-d4d68ebfeb6b)]
interface VrmlEventOutMFRotation : VrmlEventOutMField {
    void getValue(out unsigned long size,
                  [retval, array, size_is(size)] out float values);
    void get1Value(in unsigned long index,
    	    	   in unsigned long arraySize,
                   [retval, array, size_is(arraySize)] out float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(328ad93a-9bfb-40b4-8344-1d1988f83a40)]
interface VrmlEventOutMFString : VrmlEventOutMField {
    void getValue(out unsigned long size,
                  [retval, array, size_is(size)] out string values);
    string get1Value(in unsigned long index);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(7a5417d3-1d7c-431c-a8ce-0ef7884b1454)]
interface VrmlEventOutMFTime : VrmlEventOutMField {
    void getValue(out unsigned long size,
                  [retval, array, size_is(size)] out double values);
    double get1Value(in unsigned long index);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(cdcfbb5d-0a49-496e-929b-f9047e9ce136)]
interface VrmlEventOutMFVec2f : VrmlEventOutMField {
    void getValue(out unsigned long size,
                  [retval, array, size_is(size)] out float value);
    void get1Value(in unsigned long index,
    	    	   in unsigned long arraySize,
                   [retval, array, size_is(arraySize)] out float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(967be756-877f-4321-93f3-d55ec9e3fe7d)]
interface VrmlEventOutMFVec3f : VrmlEventOutMField {
    void getValue(out unsigned long size,
                  [retval, array, size_is(size)] out float value);
    void get1Value(in unsigned long index,
    	    	   in unsigned long arraySize,
                   [retval, array, size_is(arraySize)] out float value);
        // raises VRML_ERROR_ARRAY_INDEX_OUT_OF_BOUNDS
};

[scriptable, uuid(434c5ee5-31e1-4236-a35a-cbc2ecf751ea)]
interface VrmlEventOutSFBool : VrmlEventOut {
    boolean getValue();
};

[scriptable, uuid(e20bff8c-701e-447c-a131-690cedc861dd)]
interface VrmlEventOutSFColor : VrmlEventOut {
    void getValue(in unsigned long arraySize,
    	    	  [retval, array, size_is(arraySize)] out float value);
};

[scriptable, uuid(eacefb06-01fb-424f-8405-fab3ae033fcf)]
interface VrmlEventOutSFFloat : VrmlEventOut {
    float getValue();
};

[scriptable, uuid(605718be-cf73-4d04-a8f0-9904721a04e5)]
interface VrmlEventOutSFImage : VrmlEventOut {
    long getWidth();
    long getHeight();
    long getNumComponents();
    void getPixels(out unsigned long size,
                   [retval, array, size_is(size)] out unsigned long pixels);
};

[scriptable, uuid(67132c53-a70e-40c1-a5f7-3a4213039780)]
interface VrmlEventOutSFInt32 : VrmlEventOut {
    long getValue();
};

[scriptable, uuid(3bc5dac9-7188-4924-b94b-115751f32ef5)]
interface VrmlEventOutSFNode : VrmlEventOut {
    VrmlNode getValue();
};

[scriptable, uuid(0131ec4c-64e0-4854-b239-aad03fd0b496)]
interface VrmlEventOutSFRotation : VrmlEventOut {
    void value(in unsigned long arraySize,
    	       [retval, array, size_is(arraySize)] out float value);
};

[scriptable, uuid(52435b41-09ee-4c6b-b102-a2c0adf0c59f)]
interface VrmlEventOutSFString : VrmlEventOut {
    string getValue();
};

[scriptable, uuid(067efc51-c1bd-4227-a5cb-431e64978998)]
interface VrmlEventOutSFTime : VrmlEventOut {
    double getValue();
};

[scriptable, uuid(80cc40d1-8954-4f6b-a0cf-7cf91c582a53)]
interface VrmlEventOutSFVec2f : VrmlEventOut {
    void getValue(in unsigned long arraySize,
    	          [retval, array, size_is(arraySize)] out float value);
};

[scriptable, uuid(bffc1ae6-f9d6-478e-a721-69c1b5e7ef3c)]
interface VrmlEventOutSFVec3f : VrmlEventOut {
    void getValue(in unsigned long arraySize,
    	          [retval, array, size_is(arraySize)] out float value);
};
