Backed out 2 changesets (bug 1853057) for causing mda failures on test_video_low_powe...
[gecko.git] / xpcom / components / nsIClassInfo.idl
blob1ebef34ecf176e7fe4204ad443b9e63b2eeb5920
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #include "nsISupports.idl"
9 interface nsIXPCScriptable;
11 /**
12 * Provides information about a specific implementation class. If you want
13 * your class to implement nsIClassInfo, see nsIClassInfoImpl.h for
14 * instructions--you most likely do not want to inherit from nsIClassInfo.
17 [scriptable, uuid(a60569d7-d401-4677-ba63-2aa5971af25d)]
18 interface nsIClassInfo : nsISupports
20 /**
21 * Returns a list of the interfaces which instances of this class promise
22 * to implement. Note that nsISupports is an implicit member of any such
23 * list, and need not be included.
25 readonly attribute Array<nsIIDRef> interfaces;
27 /**
28 * Return an object to assist XPConnect in supplying JavaScript-specific
29 * behavior to callers of the instance object, or null if not needed.
31 nsIXPCScriptable getScriptableHelper();
33 /**
34 * A contract ID through which an instance of this class can be created
35 * (or accessed as a service, if |flags & SINGLETON|), or null/void.
37 readonly attribute AUTF8String contractID;
39 /**
40 * A human readable string naming the class, or null/void.
42 readonly attribute AUTF8String classDescription;
44 /**
45 * A class ID through which an instance of this class can be created
46 * (or accessed as a service, if |flags & SINGLETON|), or null.
48 readonly attribute nsCIDPtr classID;
50 /**
51 * Bitflags for 'flags' attribute.
53 const uint32_t SINGLETON = 1 << 0;
54 const uint32_t THREADSAFE = 1 << 1;
55 const uint32_t SINGLETON_CLASSINFO = 1 << 5;
57 // The high order bit is RESERVED for consumers of these flags.
58 // No implementor of this interface should ever return flags
59 // with this bit set.
60 const uint32_t RESERVED = 1 << 31;
63 readonly attribute uint32_t flags;
65 /**
66 * Also a class ID through which an instance of this class can be created
67 * (or accessed as a service, if |flags & SINGLETON|). If the class does
68 * not have a CID, it should return NS_ERROR_NOT_AVAILABLE. This attribute
69 * exists so C++ callers can avoid allocating and freeing a CID, as would
70 * happen if they used classID.
72 [noscript] readonly attribute nsCID classIDNoAlloc;