00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #include "nsISupports.idl"
00043
00044 [scriptable,uuid(4d12e540-83d7-11d5-90ed-0010a4e73d9a)]
00045 interface nsIDataType : nsISupports
00046 {
00047
00048
00049
00050 const PRUint16 VTYPE_INT8 = 0;
00051 const PRUint16 VTYPE_INT16 = 1;
00052 const PRUint16 VTYPE_INT32 = 2;
00053 const PRUint16 VTYPE_INT64 = 3;
00054 const PRUint16 VTYPE_UINT8 = 4;
00055 const PRUint16 VTYPE_UINT16 = 5;
00056 const PRUint16 VTYPE_UINT32 = 6;
00057 const PRUint16 VTYPE_UINT64 = 7;
00058 const PRUint16 VTYPE_FLOAT = 8;
00059 const PRUint16 VTYPE_DOUBLE = 9;
00060 const PRUint16 VTYPE_BOOL = 10;
00061 const PRUint16 VTYPE_CHAR = 11;
00062 const PRUint16 VTYPE_WCHAR = 12;
00063 const PRUint16 VTYPE_VOID = 13;
00064 const PRUint16 VTYPE_ID = 14;
00065 const PRUint16 VTYPE_DOMSTRING = 15;
00066 const PRUint16 VTYPE_CHAR_STR = 16;
00067 const PRUint16 VTYPE_WCHAR_STR = 17;
00068 const PRUint16 VTYPE_INTERFACE = 18;
00069 const PRUint16 VTYPE_INTERFACE_IS = 19;
00070 const PRUint16 VTYPE_ARRAY = 20;
00071 const PRUint16 VTYPE_STRING_SIZE_IS = 21;
00072 const PRUint16 VTYPE_WSTRING_SIZE_IS = 22;
00073 const PRUint16 VTYPE_UTF8STRING = 23;
00074 const PRUint16 VTYPE_CSTRING = 24;
00075 const PRUint16 VTYPE_ASTRING = 25;
00076 const PRUint16 VTYPE_EMPTY_ARRAY = 254;
00077 const PRUint16 VTYPE_EMPTY = 255;
00078 };
00079
00080
00089 [scriptable, uuid(6c9eb060-8c6a-11d5-90f3-0010a4e73d9a)]
00090 interface nsIVariant : nsISupports
00091 {
00092 [noscript] readonly attribute PRUint16 dataType;
00093
00094 [noscript] PRUint8 getAsInt8();
00095 [noscript] PRInt16 getAsInt16();
00096 [noscript] PRInt32 getAsInt32();
00097 [noscript] PRInt64 getAsInt64();
00098 [noscript] PRUint8 getAsUint8();
00099 [noscript] PRUint16 getAsUint16();
00100 [noscript] PRUint32 getAsUint32();
00101 [noscript] PRUint64 getAsUint64();
00102 [noscript] float getAsFloat();
00103 [noscript] double getAsDouble();
00104 [noscript] PRBool getAsBool();
00105 [noscript] char getAsChar();
00106 [noscript] wchar getAsWChar();
00107 [notxpcom] nsresult getAsID(out nsID retval);
00108 [noscript] AString getAsAString();
00109 [noscript] DOMString getAsDOMString();
00110 [noscript] ACString getAsACString();
00111 [noscript] AUTF8String getAsAUTF8String();
00112 [noscript] string getAsString();
00113 [noscript] wstring getAsWString();
00114 [noscript] nsISupports getAsISupports();
00115
00116 [noscript] void getAsInterface(out nsIIDPtr iid,
00117 [iid_is(iid), retval] out nsQIResult iface);
00118
00119 [notxpcom] nsresult getAsArray(out PRUint16 type, out nsIID iid,
00120 out PRUint32 count, out voidPtr ptr);
00121
00122 [noscript] void getAsStringWithSize(out PRUint32 size,
00123 [size_is(size), retval] out string str);
00124
00125 [noscript] void getAsWStringWithSize(out PRUint32 size,
00126 [size_is(size), retval] out wstring str);
00127 };
00128
00139 [scriptable, uuid(5586a590-8c82-11d5-90f3-0010a4e73d9a)]
00140 interface nsIWritableVariant : nsIVariant
00141 {
00142 attribute PRBool writable;
00143
00144 void setAsInt8(in PRUint8 aValue);
00145 void setAsInt16(in PRInt16 aValue);
00146 void setAsInt32(in PRInt32 aValue);
00147 void setAsInt64(in PRInt64 aValue);
00148 void setAsUint8(in PRUint8 aValue);
00149 void setAsUint16(in PRUint16 aValue);
00150 void setAsUint32(in PRUint32 aValue);
00151 void setAsUint64(in PRUint64 aValue);
00152 void setAsFloat(in float aValue);
00153 void setAsDouble(in double aValue);
00154 void setAsBool(in PRBool aValue);
00155 void setAsChar(in char aValue);
00156 void setAsWChar(in wchar aValue);
00157 void setAsID(in nsIDRef aValue);
00158 void setAsAString(in AString aValue);
00159 void setAsDOMString(in DOMString aValue);
00160 void setAsACString(in ACString aValue);
00161 void setAsAUTF8String(in AUTF8String aValue);
00162 void setAsString(in string aValue);
00163 void setAsWString(in wstring aValue);
00164 void setAsISupports(in nsISupports aValue);
00165
00166 void setAsInterface(in nsIIDRef iid,
00167 [iid_is(iid)] in nsQIResult iface);
00168
00169 [noscript] void setAsArray(in PRUint16 type, in nsIIDPtr iid,
00170 in PRUint32 count, in voidPtr ptr);
00171
00172 void setAsStringWithSize(in PRUint32 size,
00173 [size_is(size)] in string str);
00174
00175 void setAsWStringWithSize(in PRUint32 size,
00176 [size_is(size)] in wstring str);
00177
00178 void setAsVoid();
00179 void setAsEmpty();
00180 void setAsEmptyArray();
00181
00182 void setFromVariant(in nsIVariant aValue);
00183 };
00184
00185 %{C++
00186
00187 #define NS_VARIANT_CONTRACTID "@mozilla.org/variant;1"
00188 %}