Back to index

lightning-sunbird  0.9+nobinonly
nsIScriptableInterfaceInfo.idl
Go to the documentation of this file.
00001 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
00002  *
00003  * ***** BEGIN LICENSE BLOCK *****
00004  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00005  *
00006  * The contents of this file are subject to the Mozilla Public License Version
00007  * 1.1 (the "License"); you may not use this file except in compliance with
00008  * the License. You may obtain a copy of the License at
00009  * http://www.mozilla.org/MPL/
00010  *
00011  * Software distributed under the License is distributed on an "AS IS" basis,
00012  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00013  * for the specific language governing rights and limitations under the
00014  * License.
00015  *
00016  * The Original Code is Mozilla Communicator client code, released
00017  * March 31, 1998.
00018  *
00019  * The Initial Developer of the Original Code is
00020  * Netscape Communications Corporation.
00021  * Portions created by the Initial Developer are Copyright (C) 2001
00022  * the Initial Developer. All Rights Reserved.
00023  *
00024  * Contributor(s):
00025  *   John Bandhauer <jband@netscape.com> (original author)
00026  *
00027  * Alternatively, the contents of this file may be used under the terms of
00028  * either the GNU General Public License Version 2 or later (the "GPL"), or
00029  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00030  * in which case the provisions of the GPL or the LGPL are applicable instead
00031  * of those above. If you wish to allow use of your version of this file only
00032  * under the terms of either the GPL or the LGPL, and not to allow others to
00033  * use your version of this file under the terms of the MPL, indicate your
00034  * decision by deleting the provisions above and replace them with the notice
00035  * and other provisions required by the GPL or the LGPL. If you do not delete
00036  * the provisions above, a recipient may use your version of this file under
00037  * the terms of any one of the MPL, the GPL or the LGPL.
00038  *
00039  * ***** END LICENSE BLOCK ***** */
00040 
00041 /* Scriptable version of the information exposed by nsIInterfaceInfo */
00042 
00043 #include "nsISupports.idl"
00044 #include "nsIInterfaceInfo.idl"
00045 #include "nsIVariant.idl"
00046 
00047 [scriptable, uuid(312e3b94-dc98-4ccc-b2fb-e3406f905cc6)]
00048 interface nsIScriptableDataType : nsISupports
00049 {
00050     readonly attribute PRBool isPointer;
00051     readonly attribute PRBool isUniquePointer;
00052     readonly attribute PRBool isReference;
00053     readonly attribute PRBool isArithmetic;
00054     readonly attribute PRBool isInterfacePointer;
00055     readonly attribute PRBool isArray;
00056     readonly attribute PRBool isDependent;
00057 
00061     readonly attribute PRUint16 dataType;
00062 };
00063 
00064 [scriptable, uuid(2309482b-4631-455f-833f-5e4e9ce38589)]
00065 interface nsIScriptableParamInfo : nsISupports
00066 {
00067     readonly attribute PRBool isIn;
00068     readonly attribute PRBool isOut;
00069     readonly attribute PRBool isRetval;
00070     readonly attribute PRBool isShared;
00071     readonly attribute PRBool isDipper;
00072 
00073     readonly attribute nsIScriptableDataType type;
00074 
00075     [noscript] void getParamInfo([shared, const, retval] out nsXPTParamInfoPtr aInfo);
00076 };
00077 
00078 [scriptable, uuid(0f6c5b09-88b0-43ca-b55c-578f24f3d810)]
00079 interface nsIScriptableConstant : nsISupports
00080 {
00081     readonly attribute string                name;
00082     readonly attribute nsIScriptableDataType type;
00083     readonly attribute nsIVariant            value;
00084 };
00085 
00086 [scriptable, uuid(9228afa2-187c-4feb-9228-5108e640ca33)]
00087 interface nsIScriptableMethodInfo : nsISupports
00088 {
00089     readonly attribute PRBool isGetter;
00090     readonly attribute PRBool isSetter;
00091     readonly attribute PRBool isNotXPCOM;
00092     readonly attribute PRBool isConstructor;
00093     readonly attribute PRBool isHidden;
00094 
00095     readonly attribute string name;
00096     readonly attribute PRUint8  paramCount;
00097 
00098     nsIScriptableParamInfo getParam(in PRUint8 idx);
00099 
00100     readonly attribute nsIScriptableParamInfo result;
00101 };
00102 
00103 [scriptable, uuid(f902d5ba-2ef6-444e-8a17-52cb70715c10)]
00104 interface nsIScriptableInterfaceInfo : nsISupports
00105 {
00106     [noscript] attribute nsIInterfaceInfo info;
00107     
00108     void init(in nsIIDPtr aIID);
00109     void initWithName(in string name);
00110 
00111     readonly attribute string   name;
00112     
00113     readonly attribute nsIIDPtr interfaceID;
00114 
00118     readonly attribute PRBool isValid;
00119 
00120     readonly attribute PRBool isScriptable;
00121 
00122     readonly attribute nsIScriptableInterfaceInfo parent;
00123 
00127     readonly attribute PRUint16 methodCount;
00128     readonly attribute PRUint16 constantCount;
00129 
00134     nsIScriptableMethodInfo getMethodInfo(in PRUint16 index);
00135 
00136     nsIScriptableMethodInfo getMethodInfoForName(in string methodName, 
00137                                                  out PRUint16 index);
00138 
00139 
00140     nsIScriptableConstant getConstant(in PRUint16 index);
00141 
00147     nsIScriptableInterfaceInfo getInfoForParam(in PRUint16 methodIndex, 
00148                                                in nsIScriptableParamInfo param);
00149 
00150     nsIIDPtr getIIDForParam(in PRUint16 methodIndex, 
00151                             in nsIScriptableParamInfo param);
00152 
00153 
00154     nsIScriptableDataType getTypeForParam(in PRUint16 methodIndex, 
00155                                           in nsIScriptableParamInfo param,
00156                                           in PRUint16 dimension);
00157 
00158     PRUint8 getSizeIsArgNumberForParam(in PRUint16 methodIndex, 
00159                                        in nsIScriptableParamInfo param,
00160                                        in PRUint16 dimension);
00161 
00162     PRUint8 getLengthIsArgNumberForParam(in PRUint16 methodIndex, 
00163                                          in nsIScriptableParamInfo param,
00164                                          in PRUint16 dimension);
00165 
00166     PRUint8 getInterfaceIsArgNumberForParam(in PRUint16 methodIndex, 
00167                                             in nsIScriptableParamInfo param);
00168 
00169     PRBool isIID(in nsIIDPtr IID);
00170 
00171     readonly attribute PRBool isFunction;
00172 
00173     PRBool hasAncestor(in nsIIDPtr iid);
00174 };
00175 
00176 %{C++
00177 // The contractID for the implementation built in to xpconnect.
00178 #define NS_SCRIPTABLE_INTERFACE_INFO_CONTRACTID "@mozilla.org/scriptableInterfaceInfo;1"
00179 %}