Bug 776929 - Let event implementation codegen to generate MozContactChangeEvent, r=gwagner

This commit is contained in:
Olli Pettay 2012-07-24 22:28:26 +03:00
Родитель de8e8d66a7
Коммит adf35f6898
11 изменённых файлов: 27 добавлений и 137 удалений

Просмотреть файл

@ -63,7 +63,6 @@ CPPSRCS = \
nsDOMTransitionEvent.cpp \
nsDOMAnimationEvent.cpp \
nsDOMSettingsEvent.cpp \
nsDOMContactChangeEvent.cpp \
nsDOMTouchEvent.cpp \
nsDOMCompositionEvent.cpp \
nsDOMApplicationEvent.cpp \
@ -89,7 +88,6 @@ LOCAL_INCLUDES += \
-I$(srcdir)/../../xml/content/src \
-I$(srcdir)/../../../dom/base \
-I$(srcdir)/../../../dom/settings \
-I$(srcdir)/../../../dom/contacts \
-I$(srcdir)/../../../dom/src/storage \
-I$(srcdir)/../../../layout/generic \
-I$(srcdir)/../../../layout/xul/base/src \

Просмотреть файл

@ -1,68 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "nsDOMContactChangeEvent.h"
#include "nsContentUtils.h"
#include "DictionaryHelpers.h"
#include "nsDOMClassInfoID.h"
DOMCI_DATA(MozContactChangeEvent, nsDOMMozContactChangeEvent)
NS_INTERFACE_MAP_BEGIN(nsDOMMozContactChangeEvent)
NS_INTERFACE_MAP_ENTRY(nsIDOMMozContactChangeEvent)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MozContactChangeEvent)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEvent)
NS_IMPL_ADDREF_INHERITED(nsDOMMozContactChangeEvent, nsDOMEvent)
NS_IMPL_RELEASE_INHERITED(nsDOMMozContactChangeEvent, nsDOMEvent)
NS_IMETHODIMP
nsDOMMozContactChangeEvent::GetContactID(nsAString& aContactID)
{
aContactID = mContactID;
return NS_OK;
}
NS_IMETHODIMP
nsDOMMozContactChangeEvent::GetReason(nsAString& aReason)
{
aReason = mReason;
return NS_OK;
}
NS_IMETHODIMP
nsDOMMozContactChangeEvent::InitMozContactChangeEvent(const nsAString& aType,
bool aCanBubble,
bool aCancelable,
const nsAString& aContactID,
const nsAString& aReason)
{
nsresult rv = nsDOMEvent::InitEvent(aType, aCanBubble, aCancelable);
NS_ENSURE_SUCCESS(rv, rv);
mContactID = aContactID;
mReason = aReason;
return NS_OK;
}
nsresult
nsDOMMozContactChangeEvent::InitFromCtor(const nsAString& aType,
JSContext* aCx, jsval* aVal)
{
mozilla::dom::MozContactChangeEventInit d;
nsresult rv = d.Init(aCx, aVal);
NS_ENSURE_SUCCESS(rv, rv);
return InitMozContactChangeEvent(aType, d.bubbles, d.cancelable, d.contactID, d.reason);
}
nsresult
NS_NewDOMMozContactChangeEvent(nsIDOMEvent** aInstancePtrResult,
nsPresContext* aPresContext,
nsEvent* aEvent)
{
nsDOMMozContactChangeEvent* e = new nsDOMMozContactChangeEvent(aPresContext, aEvent);
return CallQueryInterface(e, aInstancePtrResult);
}

Просмотреть файл

@ -1,33 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef nsDOMContactChangeEvent_h__
#define nsDOMContactChangeEvent_h__
#include "nsIDOMContactManager.h"
#include "nsDOMEvent.h"
class nsDOMMozContactChangeEvent : public nsDOMEvent,
public nsIDOMMozContactChangeEvent
{
public:
nsDOMMozContactChangeEvent(nsPresContext* aPresContext, nsEvent* aEvent)
: nsDOMEvent(aPresContext, aEvent) {}
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMMozContactChangeEvent, nsDOMEvent)
// Forward to base class
NS_FORWARD_TO_NSDOMEVENT
NS_DECL_NSIDOMMOZCONTACTCHANGEEVENT
virtual nsresult InitFromCtor(const nsAString& aType,
JSContext* aCx, jsval* aVal);
private:
nsString mContactID;
nsString mReason;
};
#endif // nsDOMContactChangeEvent_h__

Просмотреть файл

@ -1641,8 +1641,6 @@ static nsDOMClassInfoData sClassInfoData[] = {
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozSettingsEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozContactChangeEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
NS_DEFINE_CLASSINFO_DATA(MozApplicationEvent, nsDOMGenericSH,
DOM_DEFAULT_SCRIPTABLE_FLAGS)
@ -1729,7 +1727,6 @@ static const nsContractIDMapData kConstructorMap[] =
NS_DEFINE_EVENT_CTOR(Event)
NS_DEFINE_EVENT_CTOR(MozSettingsEvent)
NS_DEFINE_EVENT_CTOR(MozContactChangeEvent)
NS_DEFINE_EVENT_CTOR(MozApplicationEvent)
NS_DEFINE_EVENT_CTOR(UIEvent)
NS_DEFINE_EVENT_CTOR(MouseEvent)
@ -1778,7 +1775,6 @@ static const nsConstructorFuncMapData kConstructorFuncMap[] =
NS_DEFINE_CONSTRUCTOR_FUNC_DATA(MozBlobBuilder, NS_NewBlobBuilder)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(Event)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MozSettingsEvent)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MozContactChangeEvent)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MozApplicationEvent)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(UIEvent)
NS_DEFINE_EVENT_CONSTRUCTOR_FUNC_DATA(MouseEvent)
@ -4413,11 +4409,6 @@ nsDOMClassInfo::Init()
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MozContactChangeEvent, nsIDOMMozContactChangeEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozContactChangeEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES
DOM_CLASSINFO_MAP_END
DOM_CLASSINFO_MAP_BEGIN(MozApplicationEvent, nsIDOMMozApplicationEvent)
DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozApplicationEvent)
DOM_CLASSINFO_EVENT_MAP_ENTRIES

Просмотреть файл

@ -508,7 +508,6 @@ DOMCI_CLASS(MutationObserver)
DOMCI_CLASS(MutationRecord)
DOMCI_CLASS(MozSettingsEvent)
DOMCI_CLASS(MozContactChangeEvent)
DOMCI_CLASS(MozApplicationEvent)

Просмотреть файл

@ -16,6 +16,7 @@ GRE_MODULE = 1
XPIDLSRCS = \
nsIDOMContactProperties.idl \
nsIDOMContactManager.idl \
nsIDOMMozContactChangeEvent.idl \
$(NULL)
include $(topsrcdir)/config/rules.mk

Просмотреть файл

@ -5,7 +5,6 @@
#include "domstubs.idl"
#include "nsIDOMContactProperties.idl"
#include "nsIDOMEventTarget.idl"
#include "nsIDOMEvent.idl"
interface nsIArray;
interface nsIDOMContactFindOptions;
@ -22,25 +21,6 @@ interface nsIDOMContact : nsIDOMContactProperties
void init(in nsIDOMContactProperties properties); // Workaround BUG 723206
};
[scriptable, builtinclass, uuid(6ed26570-b640-11e1-afa6-0800200c9a66)]
interface nsIDOMMozContactChangeEvent : nsIDOMEvent
{
readonly attribute DOMString contactID;
readonly attribute DOMString reason;
[noscript] void initMozContactChangeEvent(in DOMString aType,
in boolean aCanBubble,
in boolean aCancelable,
in DOMString aContactID,
in DOMString aReason);
};
dictionary MozContactChangeEventInit : EventInit
{
DOMString contactID;
DOMString reason;
};
[scriptable, uuid(d88af7e0-a45f-11e1-b3dd-0800200c9a66)]
interface nsIDOMContactManager : nsISupports
{

Просмотреть файл

@ -0,0 +1,24 @@
/* 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/. */
#include "nsIDOMEvent.idl"
[scriptable, builtinclass, uuid(6ed26570-b640-11e1-afa6-0800200c9a66)]
interface nsIDOMMozContactChangeEvent : nsIDOMEvent
{
readonly attribute DOMString contactID;
readonly attribute DOMString reason;
[noscript] void initMozContactChangeEvent(in DOMString aType,
in boolean aCanBubble,
in boolean aCancelable,
in DOMString aContactID,
in DOMString aReason);
};
dictionary MozContactChangeEventInit : EventInit
{
DOMString contactID;
DOMString reason;
};

Просмотреть файл

@ -257,8 +257,6 @@ NS_NewDOMSmsEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext,
nsresult
NS_NewDOMMozSettingsEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent* aEvent);
nsresult
NS_NewDOMMozContactChangeEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent* aEvent);
nsresult
NS_NewDOMMozWifiStatusChangeEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent* aEvent);
nsresult
NS_NewDOMMozWifiConnectionInfoEvent(nsIDOMEvent** aInstancePtrResult, nsPresContext* aPresContext, nsEvent* aEvent);

Просмотреть файл

@ -13,7 +13,6 @@ dictionaries = [
[ 'BlobPropertyBag', 'nsIDOMFile.idl' ],
[ 'MutationObserverInit', 'nsIDOMMutationObserver.idl' ],
[ 'SettingsEventInit', 'nsIDOMSettingsManager.idl' ],
[ 'ContactChangeEventInit', 'nsIDOMContactManager.idl' ],
[ 'WifiConnectionInfoEventInit', 'nsIWifiEventInits.idl' ],
[ 'WifiStatusChangeEventInit', 'nsIWifiEventInits.idl' ],
[ 'GeoPositionOptions', 'nsIDOMGeoGeolocation.idl' ],

Просмотреть файл

@ -14,7 +14,8 @@ simple_events = [
'PageTransitionEvent',
'PopStateEvent',
'HashChangeEvent',
'CloseEvent'
'CloseEvent',
'MozContactChangeEvent'
]
""" include file names """