2015-05-03 22:32:37 +03: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/. */
|
2006-03-22 21:36:36 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This file defines enum values for all of the DOM objects which have
|
|
|
|
* an entry in nsDOMClassInfo.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsDOMClassInfoID_h__
|
|
|
|
#define nsDOMClassInfoID_h__
|
|
|
|
|
2011-08-11 17:29:50 +04:00
|
|
|
#include "nsIXPCScriptable.h"
|
|
|
|
|
2010-01-12 17:24:00 +03:00
|
|
|
#define DOMCI_CLASS(_dom_class) \
|
2010-01-12 16:08:43 +03:00
|
|
|
eDOMClassInfo_##_dom_class##_id,
|
2006-03-22 21:36:36 +03:00
|
|
|
|
2010-01-12 16:08:43 +03:00
|
|
|
enum nsDOMClassInfoID {
|
2009-12-23 22:10:31 +03:00
|
|
|
|
2010-01-12 16:08:43 +03:00
|
|
|
#include "nsDOMClassInfoClasses.h"
|
2010-02-25 08:58:18 +03:00
|
|
|
|
2006-03-22 21:36:36 +03:00
|
|
|
// This one better be the last one in this list
|
|
|
|
eDOMClassInfoIDCount
|
|
|
|
};
|
|
|
|
|
2010-01-12 16:08:43 +03:00
|
|
|
#undef DOMCI_CLASS
|
|
|
|
|
2007-03-19 12:19:16 +03:00
|
|
|
/**
|
|
|
|
* nsIClassInfo helper macros
|
|
|
|
*/
|
|
|
|
|
2013-03-16 08:31:38 +04:00
|
|
|
#ifdef MOZILLA_INTERNAL_API
|
2009-02-17 17:08:08 +03:00
|
|
|
|
2009-09-29 01:00:35 +04:00
|
|
|
class nsIClassInfo;
|
|
|
|
class nsXPCClassInfo;
|
|
|
|
|
2007-03-19 12:19:16 +03:00
|
|
|
extern nsIClassInfo*
|
|
|
|
NS_GetDOMClassInfoInstance(nsDOMClassInfoID aID);
|
|
|
|
|
|
|
|
#define NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(_class) \
|
2009-09-29 01:00:35 +04:00
|
|
|
if (aIID.Equals(NS_GET_IID(nsIClassInfo)) || \
|
|
|
|
aIID.Equals(NS_GET_IID(nsXPCClassInfo))) { \
|
2007-03-19 12:19:16 +03:00
|
|
|
foundInterface = NS_GetDOMClassInfoInstance(eDOMClassInfo_##_class##_id); \
|
|
|
|
if (!foundInterface) { \
|
2012-07-30 18:20:58 +04:00
|
|
|
*aInstancePtr = nullptr; \
|
2007-03-19 12:19:16 +03:00
|
|
|
return NS_ERROR_OUT_OF_MEMORY; \
|
|
|
|
} \
|
|
|
|
} else
|
|
|
|
|
2010-10-14 03:25:33 +04:00
|
|
|
#define NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO_CONDITIONAL(_class, condition) \
|
|
|
|
if ((condition) && \
|
|
|
|
(aIID.Equals(NS_GET_IID(nsIClassInfo)) || \
|
|
|
|
aIID.Equals(NS_GET_IID(nsXPCClassInfo)))) { \
|
|
|
|
foundInterface = NS_GetDOMClassInfoInstance(eDOMClassInfo_##_class##_id); \
|
|
|
|
if (!foundInterface) { \
|
2012-07-30 18:20:58 +04:00
|
|
|
*aInstancePtr = nullptr; \
|
2010-10-14 03:25:33 +04:00
|
|
|
return NS_ERROR_OUT_OF_MEMORY; \
|
|
|
|
} \
|
|
|
|
} else
|
|
|
|
|
2013-03-16 08:31:38 +04:00
|
|
|
#endif // MOZILLA_INTERNAL_API
|
2009-02-17 17:08:08 +03:00
|
|
|
|
2006-03-22 21:36:36 +03:00
|
|
|
#endif // nsDOMClassInfoID_h__
|