michael@0: /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* nsISupports wrappers for single primitive pieces of data. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * Primitive base interface. michael@0: * michael@0: * These first three are pointer types and do data copying michael@0: * using the nsIMemory. Be careful! michael@0: */ michael@0: michael@0: [scriptable, uuid(d0d4b136-1dd1-11b2-9371-f0727ef827c0)] michael@0: interface nsISupportsPrimitive : nsISupports michael@0: { michael@0: const unsigned short TYPE_ID = 1; michael@0: const unsigned short TYPE_CSTRING = 2; michael@0: const unsigned short TYPE_STRING = 3; michael@0: const unsigned short TYPE_PRBOOL = 4; michael@0: const unsigned short TYPE_PRUINT8 = 5; michael@0: const unsigned short TYPE_PRUINT16 = 6; michael@0: const unsigned short TYPE_PRUINT32 = 7; michael@0: const unsigned short TYPE_PRUINT64 = 8; michael@0: const unsigned short TYPE_PRTIME = 9; michael@0: const unsigned short TYPE_CHAR = 10; michael@0: const unsigned short TYPE_PRINT16 = 11; michael@0: const unsigned short TYPE_PRINT32 = 12; michael@0: const unsigned short TYPE_PRINT64 = 13; michael@0: const unsigned short TYPE_FLOAT = 14; michael@0: const unsigned short TYPE_DOUBLE = 15; michael@0: const unsigned short TYPE_VOID = 16; michael@0: const unsigned short TYPE_INTERFACE_POINTER = 17; michael@0: michael@0: readonly attribute unsigned short type; michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for nsID structures michael@0: */ michael@0: michael@0: [scriptable, uuid(d18290a0-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsID : nsISupportsPrimitive michael@0: { michael@0: attribute nsIDPtr data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for ASCII strings michael@0: */ michael@0: michael@0: [scriptable, uuid(d65ff270-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsCString : nsISupportsPrimitive michael@0: { michael@0: attribute ACString data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for Unicode strings michael@0: */ michael@0: michael@0: [scriptable, uuid(d79dc970-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsString : nsISupportsPrimitive michael@0: { michael@0: attribute AString data; michael@0: wstring toString(); michael@0: }; michael@0: michael@0: /** michael@0: * The rest are truly primitive and are passed by value michael@0: */ michael@0: michael@0: /** michael@0: * Scriptable storage for booleans michael@0: */ michael@0: michael@0: [scriptable, uuid(ddc3b490-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsPRBool : nsISupportsPrimitive michael@0: { michael@0: attribute boolean data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for 8-bit integers michael@0: */ michael@0: michael@0: [scriptable, uuid(dec2e4e0-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsPRUint8 : nsISupportsPrimitive michael@0: { michael@0: attribute uint8_t data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for unsigned 16-bit integers michael@0: */ michael@0: michael@0: [scriptable, uuid(dfacb090-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsPRUint16 : nsISupportsPrimitive michael@0: { michael@0: attribute uint16_t data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for unsigned 32-bit integers michael@0: */ michael@0: michael@0: [scriptable, uuid(e01dc470-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsPRUint32 : nsISupportsPrimitive michael@0: { michael@0: attribute uint32_t data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for 64-bit integers michael@0: */ michael@0: michael@0: [scriptable, uuid(e13567c0-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsPRUint64 : nsISupportsPrimitive michael@0: { michael@0: attribute uint64_t data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for NSPR date/time values michael@0: */ michael@0: michael@0: [scriptable, uuid(e2563630-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsPRTime : nsISupportsPrimitive michael@0: { michael@0: attribute PRTime data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for single character values michael@0: * (often used to store an ASCII character) michael@0: */ michael@0: michael@0: [scriptable, uuid(e2b05e40-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsChar : nsISupportsPrimitive michael@0: { michael@0: attribute char data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for 16-bit integers michael@0: */ michael@0: michael@0: [scriptable, uuid(e30d94b0-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsPRInt16 : nsISupportsPrimitive michael@0: { michael@0: attribute int16_t data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for 32-bit integers michael@0: */ michael@0: michael@0: [scriptable, uuid(e36c5250-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsPRInt32 : nsISupportsPrimitive michael@0: { michael@0: attribute int32_t data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for 64-bit integers michael@0: */ michael@0: michael@0: [scriptable, uuid(e3cb0ff0-4a1c-11d3-9890-006008962422)] michael@0: interface nsISupportsPRInt64 : nsISupportsPrimitive michael@0: { michael@0: attribute int64_t data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for floating point numbers michael@0: */ michael@0: michael@0: [scriptable, uuid(abeaa390-4ac0-11d3-baea-00805f8a5dd7)] michael@0: interface nsISupportsFloat : nsISupportsPrimitive michael@0: { michael@0: attribute float data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for doubles michael@0: */ michael@0: michael@0: [scriptable, uuid(b32523a0-4ac0-11d3-baea-00805f8a5dd7)] michael@0: interface nsISupportsDouble : nsISupportsPrimitive michael@0: { michael@0: attribute double data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for generic pointers michael@0: */ michael@0: michael@0: [scriptable, uuid(464484f0-568d-11d3-baf8-00805f8a5dd7)] michael@0: interface nsISupportsVoid : nsISupportsPrimitive michael@0: { michael@0: [noscript] attribute voidPtr data; michael@0: string toString(); michael@0: }; michael@0: michael@0: /** michael@0: * Scriptable storage for other XPCOM objects michael@0: */ michael@0: michael@0: [scriptable, uuid(995ea724-1dd1-11b2-9211-c21bdd3e7ed0)] michael@0: interface nsISupportsInterfacePointer : nsISupportsPrimitive michael@0: { michael@0: attribute nsISupports data; michael@0: attribute nsIDPtr dataIID; michael@0: michael@0: string toString(); michael@0: }; michael@0: michael@0: