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: /** michael@0: * Root idl declarations to be used by all. michael@0: */ michael@0: michael@0: %{C++ michael@0: michael@0: #include "nscore.h" michael@0: typedef int64_t PRTime; michael@0: michael@0: /* michael@0: * Forward declarations for new string types michael@0: */ michael@0: class nsAString; michael@0: class nsACString; michael@0: michael@0: /* michael@0: * Start commenting out the C++ versions of the below in the output header michael@0: */ michael@0: #if 0 michael@0: %} michael@0: michael@0: typedef boolean bool ; michael@0: typedef octet uint8_t ; michael@0: typedef unsigned short uint16_t ; michael@0: typedef unsigned short char16_t; michael@0: typedef unsigned long uint32_t ; michael@0: typedef unsigned long long uint64_t ; michael@0: typedef long long PRTime ; michael@0: typedef short int16_t ; michael@0: typedef long int32_t ; michael@0: typedef long long int64_t ; michael@0: michael@0: typedef unsigned long nsrefcnt ; michael@0: typedef unsigned long nsresult ; michael@0: michael@0: // XXX need this built into xpidl compiler so that it's really size_t or size_t michael@0: // and it's scriptable: michael@0: typedef unsigned long size_t; michael@0: michael@0: [ptr] native voidPtr(void); michael@0: [ptr] native charPtr(char); michael@0: [ptr] native unicharPtr(char16_t); michael@0: michael@0: [ref, nsid] native nsIDRef(nsID); michael@0: [ref, nsid] native nsIIDRef(nsIID); michael@0: [ref, nsid] native nsCIDRef(nsCID); michael@0: michael@0: [ptr, nsid] native nsIDPtr(nsID); michael@0: [ptr, nsid] native nsIIDPtr(nsIID); michael@0: [ptr, nsid] native nsCIDPtr(nsCID); michael@0: michael@0: // NOTE: Be careful in using the following 3 types. The *Ref and *Ptr variants michael@0: // are more commonly used (and better supported). Those variants require michael@0: // nsMemory alloc'd copies when used as 'out' params while these types do not. michael@0: // However, currently these types can not be used for 'in' params. And, methods michael@0: // that use them as 'out' params *must* be declared [notxpcom] (with an explicit michael@0: // return type of nsresult). This makes such methods implicitly not scriptable. michael@0: // Use of these types in methods without a [notxpcom] declaration will cause michael@0: // the xpidl compiler to raise an error. michael@0: // See: http://bugzilla.mozilla.org/show_bug.cgi?id=93792 michael@0: michael@0: [nsid] native nsIID(nsIID); michael@0: [nsid] native nsID(nsID); michael@0: [nsid] native nsCID(nsCID); michael@0: michael@0: [ptr] native nsQIResult(void); michael@0: michael@0: [ref, domstring] native DOMString(ignored); michael@0: [ref, domstring] native DOMStringRef(ignored); michael@0: [ptr, domstring] native DOMStringPtr(ignored); michael@0: michael@0: [ref, utf8string] native AUTF8String(ignored); michael@0: [ref, utf8string] native AUTF8StringRef(ignored); michael@0: [ptr, utf8string] native AUTF8StringPtr(ignored); michael@0: michael@0: [ref, cstring] native ACString(ignored); michael@0: [ref, cstring] native ACStringRef(ignored); michael@0: [ptr, cstring] native ACStringPtr(ignored); michael@0: michael@0: [ref, astring] native AString(ignored); michael@0: [ref, astring] native AStringRef(ignored); michael@0: [ptr, astring] native AStringPtr(ignored); michael@0: michael@0: [ref, jsval] native jsval(jsval); michael@0: native jsid(jsid); michael@0: michael@0: %{C++ michael@0: /* michael@0: * End commenting out the C++ versions of the above in the output header michael@0: */ michael@0: #endif michael@0: %}