Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | // IWYU pragma: private, include "nsISupports.h" |
michael@0 | 5 | |
michael@0 | 6 | #ifndef nsISupportsBase_h__ |
michael@0 | 7 | #define nsISupportsBase_h__ |
michael@0 | 8 | |
michael@0 | 9 | #ifndef nscore_h___ |
michael@0 | 10 | #include "nscore.h" |
michael@0 | 11 | #endif |
michael@0 | 12 | |
michael@0 | 13 | #ifndef nsID_h__ |
michael@0 | 14 | #include "nsID.h" |
michael@0 | 15 | #endif |
michael@0 | 16 | |
michael@0 | 17 | |
michael@0 | 18 | /*@{*/ |
michael@0 | 19 | /** |
michael@0 | 20 | * IID for the nsISupports interface |
michael@0 | 21 | * {00000000-0000-0000-c000-000000000046} |
michael@0 | 22 | * |
michael@0 | 23 | * To maintain binary compatibility with COM's IUnknown, we define the IID |
michael@0 | 24 | * of nsISupports to be the same as that of COM's IUnknown. |
michael@0 | 25 | */ |
michael@0 | 26 | #define NS_ISUPPORTS_IID \ |
michael@0 | 27 | { 0x00000000, 0x0000, 0x0000, \ |
michael@0 | 28 | {0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46} } |
michael@0 | 29 | |
michael@0 | 30 | /** |
michael@0 | 31 | * Basic component object model interface. Objects which implement |
michael@0 | 32 | * this interface support runtime interface discovery (QueryInterface) |
michael@0 | 33 | * and a reference counted memory model (AddRef/Release). This is |
michael@0 | 34 | * modelled after the win32 IUnknown API. |
michael@0 | 35 | */ |
michael@0 | 36 | class NS_NO_VTABLE nsISupports { |
michael@0 | 37 | public: |
michael@0 | 38 | |
michael@0 | 39 | NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISUPPORTS_IID) |
michael@0 | 40 | |
michael@0 | 41 | /** |
michael@0 | 42 | * @name Methods |
michael@0 | 43 | */ |
michael@0 | 44 | |
michael@0 | 45 | //@{ |
michael@0 | 46 | /** |
michael@0 | 47 | * A run time mechanism for interface discovery. |
michael@0 | 48 | * @param aIID [in] A requested interface IID |
michael@0 | 49 | * @param aInstancePtr [out] A pointer to an interface pointer to |
michael@0 | 50 | * receive the result. |
michael@0 | 51 | * @return <b>NS_OK</b> if the interface is supported by the associated |
michael@0 | 52 | * instance, <b>NS_NOINTERFACE</b> if it is not. |
michael@0 | 53 | * |
michael@0 | 54 | * aInstancePtr must not be null. |
michael@0 | 55 | */ |
michael@0 | 56 | NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) = 0; |
michael@0 | 57 | /** |
michael@0 | 58 | * Increases the reference count for this interface. |
michael@0 | 59 | * The associated instance will not be deleted unless |
michael@0 | 60 | * the reference count is returned to zero. |
michael@0 | 61 | * |
michael@0 | 62 | * @return The resulting reference count. |
michael@0 | 63 | */ |
michael@0 | 64 | NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0; |
michael@0 | 65 | |
michael@0 | 66 | /** |
michael@0 | 67 | * Decreases the reference count for this interface. |
michael@0 | 68 | * Generally, if the reference count returns to zero, |
michael@0 | 69 | * the associated instance is deleted. |
michael@0 | 70 | * |
michael@0 | 71 | * @return The resulting reference count. |
michael@0 | 72 | */ |
michael@0 | 73 | NS_IMETHOD_(MozExternalRefCountType) Release(void) = 0; |
michael@0 | 74 | |
michael@0 | 75 | //@} |
michael@0 | 76 | }; |
michael@0 | 77 | |
michael@0 | 78 | NS_DEFINE_STATIC_IID_ACCESSOR(nsISupports, NS_ISUPPORTS_IID) |
michael@0 | 79 | |
michael@0 | 80 | /*@}*/ |
michael@0 | 81 | |
michael@0 | 82 | #endif |