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