michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * 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: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * Provides information about a specific implementation class. If you want michael@0: * your class to implement nsIClassInfo, see nsIClassInfoImpl.h for michael@0: * instructions--you most likely do not want to inherit from nsIClassInfo. michael@0: */ michael@0: michael@0: [scriptable, uuid(986c11d0-f340-11d4-9075-0010a4e73d9a)] michael@0: interface nsIClassInfo : nsISupports michael@0: { michael@0: /** michael@0: * Get an ordered list of the interface ids that instances of the class michael@0: * promise to implement. Note that nsISupports is an implicit member michael@0: * of any such list and need not be included. michael@0: * michael@0: * Should set *count = 0 and *array = null and return NS_OK if getting the michael@0: * list is not supported. michael@0: */ michael@0: void getInterfaces(out uint32_t count, michael@0: [array, size_is(count), retval] out nsIIDPtr array); michael@0: michael@0: /** michael@0: * Get a language mapping specific helper object that may assist in using michael@0: * objects of this class in a specific lanaguage. For instance, if asked michael@0: * for the helper for nsIProgrammingLanguage::JAVASCRIPT this might return michael@0: * an object that can be QI'd into the nsIXPCScriptable interface to assist michael@0: * XPConnect in supplying JavaScript specific behavior to callers of the michael@0: * instance object. michael@0: * michael@0: * see: nsIProgrammingLanguage.idl michael@0: * michael@0: * Should return null if no helper available for given language. michael@0: */ michael@0: nsISupports getHelperForLanguage(in uint32_t language); michael@0: michael@0: /** michael@0: * A contract ID through which an instance of this class can be created michael@0: * (or accessed as a service, if |flags & SINGLETON|), or null. michael@0: */ michael@0: readonly attribute string contractID; michael@0: michael@0: /** michael@0: * A human readable string naming the class, or null. michael@0: */ michael@0: readonly attribute string classDescription; michael@0: michael@0: /** michael@0: * A class ID through which an instance of this class can be created michael@0: * (or accessed as a service, if |flags & SINGLETON|), or null. michael@0: */ michael@0: readonly attribute nsCIDPtr classID; michael@0: michael@0: /** michael@0: * Return language type from list in nsIProgrammingLanguage michael@0: */ michael@0: michael@0: readonly attribute uint32_t implementationLanguage; michael@0: michael@0: /** michael@0: * Bitflags for 'flags' attribute. michael@0: */ michael@0: const uint32_t SINGLETON = 1 << 0; michael@0: const uint32_t THREADSAFE = 1 << 1; michael@0: const uint32_t MAIN_THREAD_ONLY = 1 << 2; michael@0: const uint32_t DOM_OBJECT = 1 << 3; michael@0: const uint32_t PLUGIN_OBJECT = 1 << 4; michael@0: const uint32_t SINGLETON_CLASSINFO = 1 << 5; michael@0: michael@0: /** michael@0: * 'flags' attribute bitflag: whether objects of this type implement michael@0: * nsIContent. michael@0: */ michael@0: const uint32_t CONTENT_NODE = 1 << 6; michael@0: michael@0: // The high order bit is RESERVED for consumers of these flags. michael@0: // No implementor of this interface should ever return flags michael@0: // with this bit set. michael@0: const uint32_t RESERVED = 1 << 31; michael@0: michael@0: michael@0: readonly attribute uint32_t flags; michael@0: michael@0: /** michael@0: * Also a class ID through which an instance of this class can be created michael@0: * (or accessed as a service, if |flags & SINGLETON|). If the class does michael@0: * not have a CID, it should return NS_ERROR_NOT_AVAILABLE. This attribute michael@0: * exists so C++ callers can avoid allocating and freeing a CID, as would michael@0: * happen if they used classID. michael@0: */ michael@0: [noscript] readonly attribute nsCID classIDNoAlloc; michael@0: michael@0: };