#include "nsIDOMNode.idl" #include "nsIArray.idl" // This interface is used to extract exe namespace xml data from // XHTML/XForms/XUL/SVG content // Elements are associated by the name attribute // Instances can be created with // extractor = Components.classes['@exe.data-extractor;1'].createInstance() // exe.register(myNSIExeElementImplementation) [scriptable, uuid(a1330258-2ef5-4ce3-82be-419ed887da41)] interface nsIExeDataExtractor : nsISupports { // Call this function passing a XHTML/SVG/XUL/XForms node // Returns an XML node in the exe name space of either or nsIDOMNode extractData(in nsIDOMNode content); }; [scriptable, uuid(f32fa4ab-d5d2-4460-ad35-d76bfab4f3aa)] interface nsIExeDataExtractor2 : nsISupports { // Wether this is an IDevice (as apposed to a field) attribute boolean isIDevice; // Call this function passing a XHTML/SVG/XUL/XForms node // Returns an XML node in the exe name space of either or }; // an ExeElement is either a field or an IDevice // When you create a field or idevice, you should provide an XPCOM object that // implements these interfaces [scriptable, uuid(10181ce1-82a4-419d-b36d-1ed541a9adf4)] interface nsIExeElement : nsISupports { // Wether this is an IDevice (as apposed to a field) attribute boolean isIDevice; // The human readable universally unique (amongst all eXeElements of the // same type) className of this idevice. Should be something like // author.idevicename or author.fieldname, e.g. it's ok (but not reccommended) // for a field to exist called 'matthewsherborne.cloze' and also an idevice to exist // with the same className. (should be all lowercase for consistency). attribute string className; // The name of the field or idevice, should really try to keep it unique but // won't kill the program if it isn't, it'll just confuse the user attribute wstring name; // The name of the individual or organisation that created the field/idevice attribute wstring author; // The version number attribute string version; // A short description to show in a tooltip window, from the idevice list pane // or the field list pane in the idevice editor attribute wstring description; // A URL to the XHTML help attribute string helpTextUrl; // The URL to the edit template attribute string editOverlayUrl; // The URL to the view template attribute string viewOverlayUrl; // This will be called when we want the field/idevice to show it's data // edit/teacher mode. // The 'data' is an XML node, that was earlier retrieved // from calling getData() and possibly saved and loaded. // 'content' is the edit XUL/XHTML/SVG/etc. imported from the field/idevice // editoverlay.xul, the node with the id=content nsIDOMNode fillInEditDOM(in nsIDOMNode content, in nsIDOMNode data); // This will be called when we want the field/idevice to show it's data // view/student mode. // The 'data' is an XML node, that was earlier retrieved // from calling getData() and possibly saved and loaded. // 'content' is the edit XUL/XHTML/SVG/etc. imported from the field/idevice // editoverlay.xul, the node with the id=content nsIDOMNode fillInViewDOM(in nsIDOMNode content, in nsIDOMNode data); // This will be called after render edit exits to get some XML data from the // field/idevice. This data can be in any format the author likes, but // simpler is better. It will be incorporated into the xlp file format when // the user saves the data. // 'content' is the node from the imported editoverlay.xul content node // 'data' is the XML DOM node, could be empty or have data. The implementor // should modify this. void getData(in nsIDOMNode content, in nsIDOMNode data); }; // This element helps you set up a field or idevice before rendering // and then render it. One of the main differences between objects // that implement this interface and objects that implement nsIExeElement // is that objects that implement this interface maintain a state and are // used once then discarded, whereas the nsIExeElement implementors // Represent the definition of a field or idevice, rather than a particular // instance. // // Instances of this element are provided by the nsIExeRegistrationManager [scriptable, uuid(a4a339f8-07c3-43c1-8c49-0dcda292767d)] interface nsIExeElementRenderer : nsISupports { // A one off uri given for this rendering. Usually appended to id's inside attribute string uri; // Helps you set up simple parameters, that will be passed to the field via it's XML // as tags wstring getParameter(in string name); // Helps you set up simple parameters, that will be passed to the field via // the XML attributes of the main tag and tags for other void setParameter(in string name, in wstring value); // Get the XML dom as made so far nsIDOMNode getData(); // Set the XML Data for loading, replaces all parameters and old data void setData(in nsIDOMNode data); // Replace a node with the rendered DOM. // To be called after params and data have been set // This method renders in edit mode void renderReplaceEdit(in nsiDOMNode node); // Replace a node with the rendered DOM. // To be called after params and data have been set // This method renders in view mode void renderReplaceView(in nsiDOMNode node); }; // The Idevice author should do: // exe = Components.classes['@exe.registration-manager;1'].getService() // exe.register(myNSIExeElementImplementation) // as soon as their xul file is loaded [scriptable, uuid(14578383-703d-40f0-905a-4f092feec4fa)] interface nsIExeRegistrationManager : nsISupports { // The version of eXe attribute wstring version; // Called by fields and idevices when their xul is imported to register // themselves with the global repository void register(in nsIExeElement element); // Returns a field/idevice renderer from an id nsIExeElementRenderer getFieldOrIdeviceRenderer(in string className); };