michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef mozilla_EventListenerService_h_ michael@0: #define mozilla_EventListenerService_h_ michael@0: michael@0: #include "jsapi.h" michael@0: #include "mozilla/Attributes.h" michael@0: #include "nsAutoPtr.h" michael@0: #include "nsCycleCollectionParticipant.h" michael@0: #include "nsIDOMEventListener.h" michael@0: #include "nsIEventListenerService.h" michael@0: #include "nsString.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: template michael@0: class Maybe; michael@0: michael@0: class EventListenerInfo MOZ_FINAL : public nsIEventListenerInfo michael@0: { michael@0: public: michael@0: EventListenerInfo(const nsAString& aType, michael@0: already_AddRefed aListener, michael@0: bool aCapturing, michael@0: bool aAllowsUntrusted, michael@0: bool aInSystemEventGroup) michael@0: : mType(aType) michael@0: , mListener(aListener) michael@0: , mCapturing(aCapturing) michael@0: , mAllowsUntrusted(aAllowsUntrusted) michael@0: , mInSystemEventGroup(aInSystemEventGroup) michael@0: { michael@0: } michael@0: michael@0: virtual ~EventListenerInfo() {} michael@0: michael@0: NS_DECL_CYCLE_COLLECTING_ISUPPORTS michael@0: NS_DECL_CYCLE_COLLECTION_CLASS(EventListenerInfo) michael@0: NS_DECL_NSIEVENTLISTENERINFO michael@0: michael@0: protected: michael@0: bool GetJSVal(JSContext* aCx, michael@0: Maybe& aAc, michael@0: JS::MutableHandle aJSVal); michael@0: michael@0: nsString mType; michael@0: // nsReftPtr because that is what nsListenerStruct uses too. michael@0: nsRefPtr mListener; michael@0: bool mCapturing; michael@0: bool mAllowsUntrusted; michael@0: bool mInSystemEventGroup; michael@0: }; michael@0: michael@0: class EventListenerService MOZ_FINAL : public nsIEventListenerService michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSIEVENTLISTENERSERVICE michael@0: }; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_EventListenerService_h_