2014-06-30 19:39:45 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2013-08-22 10:31:21 +04:00
|
|
|
// IWYU pragma: private, include "nsISupports.h"
|
2001-09-27 07:43:00 +04:00
|
|
|
|
|
|
|
#ifndef nsISupportsBase_h__
|
|
|
|
#define nsISupportsBase_h__
|
|
|
|
|
|
|
|
#ifndef nscore_h___
|
|
|
|
# include "nscore.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef nsID_h__
|
|
|
|
# include "nsID.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*@{*/
|
|
|
|
/**
|
|
|
|
* IID for the nsISupports interface
|
|
|
|
* {00000000-0000-0000-c000-000000000046}
|
|
|
|
*
|
2003-11-12 00:53:36 +03:00
|
|
|
* To maintain binary compatibility with COM's IUnknown, we define the IID
|
|
|
|
* of nsISupports to be the same as that of COM's IUnknown.
|
2001-09-27 07:43:00 +04:00
|
|
|
*/
|
|
|
|
#define NS_ISUPPORTS_IID \
|
2018-11-30 13:46:48 +03:00
|
|
|
{ \
|
2001-09-27 07:43:00 +04:00
|
|
|
0x00000000, 0x0000, 0x0000, { \
|
|
|
|
0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46 \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Basic component object model interface. Objects which implement
|
|
|
|
* this interface support runtime interface discovery (QueryInterface)
|
|
|
|
* and a reference counted memory model (AddRef/Release). This is
|
|
|
|
* modelled after the win32 IUnknown API.
|
|
|
|
*/
|
2014-05-13 21:41:38 +04:00
|
|
|
class NS_NO_VTABLE nsISupports {
|
2001-09-27 07:43:00 +04:00
|
|
|
public:
|
2006-11-15 00:21:37 +03:00
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISUPPORTS_IID)
|
|
|
|
|
2001-09-27 07:43:00 +04:00
|
|
|
/**
|
|
|
|
* @name Methods
|
|
|
|
*/
|
|
|
|
|
|
|
|
//@{
|
|
|
|
/**
|
|
|
|
* A run time mechanism for interface discovery.
|
|
|
|
* @param aIID [in] A requested interface IID
|
|
|
|
* @param aInstancePtr [out] A pointer to an interface pointer to
|
|
|
|
* receive the result.
|
|
|
|
* @return <b>NS_OK</b> if the interface is supported by the associated
|
|
|
|
* instance, <b>NS_NOINTERFACE</b> if it is not.
|
2007-08-21 02:55:06 +04:00
|
|
|
*
|
|
|
|
* aInstancePtr must not be null.
|
2001-09-27 07:43:00 +04:00
|
|
|
*/
|
|
|
|
NS_IMETHOD QueryInterface(REFNSIID aIID, void** aInstancePtr) = 0;
|
|
|
|
/**
|
|
|
|
* Increases the reference count for this interface.
|
|
|
|
* The associated instance will not be deleted unless
|
|
|
|
* the reference count is returned to zero.
|
|
|
|
*
|
|
|
|
* @return The resulting reference count.
|
|
|
|
*/
|
2014-03-28 00:38:33 +04:00
|
|
|
NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0;
|
2001-09-27 07:43:00 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Decreases the reference count for this interface.
|
|
|
|
* Generally, if the reference count returns to zero,
|
|
|
|
* the associated instance is deleted.
|
|
|
|
*
|
|
|
|
* @return The resulting reference count.
|
|
|
|
*/
|
2014-03-28 00:38:33 +04:00
|
|
|
NS_IMETHOD_(MozExternalRefCountType) Release(void) = 0;
|
2001-09-27 07:43:00 +04:00
|
|
|
|
|
|
|
//@}
|
|
|
|
};
|
2006-11-15 00:21:37 +03:00
|
|
|
|
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(nsISupports, NS_ISUPPORTS_IID)
|
|
|
|
|
2001-09-27 07:43:00 +04:00
|
|
|
/*@}*/
|
2006-11-15 00:21:37 +03:00
|
|
|
|
2001-09-27 07:43:00 +04:00
|
|
|
#endif
|