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_dom_ScrollAreaEvent_h_ michael@0: #define mozilla_dom_ScrollAreaEvent_h_ michael@0: michael@0: #include "mozilla/dom/DOMRect.h" michael@0: #include "mozilla/dom/ScrollAreaEventBinding.h" michael@0: #include "mozilla/dom/UIEvent.h" michael@0: #include "mozilla/Attributes.h" michael@0: #include "mozilla/EventForwards.h" michael@0: #include "nsIDOMScrollAreaEvent.h" michael@0: michael@0: namespace mozilla { michael@0: namespace dom { michael@0: michael@0: class ScrollAreaEvent : public UIEvent, michael@0: public nsIDOMScrollAreaEvent michael@0: { michael@0: public: michael@0: ScrollAreaEvent(EventTarget* aOwner, michael@0: nsPresContext* aPresContext, michael@0: InternalScrollAreaEvent* aEvent); michael@0: michael@0: NS_DECL_ISUPPORTS_INHERITED michael@0: michael@0: NS_DECL_NSIDOMSCROLLAREAEVENT michael@0: michael@0: NS_FORWARD_NSIDOMUIEVENT(UIEvent::) michael@0: michael@0: NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION michael@0: NS_IMETHOD DuplicatePrivateData() michael@0: { michael@0: return Event::DuplicatePrivateData(); michael@0: } michael@0: NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE; michael@0: NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE; michael@0: michael@0: virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE michael@0: { michael@0: return ScrollAreaEventBinding::Wrap(aCx, this); michael@0: } michael@0: michael@0: float X() const michael@0: { michael@0: return mClientArea.Left(); michael@0: } michael@0: michael@0: float Y() const michael@0: { michael@0: return mClientArea.Top(); michael@0: } michael@0: michael@0: float Width() const michael@0: { michael@0: return mClientArea.Width(); michael@0: } michael@0: michael@0: float Height() const michael@0: { michael@0: return mClientArea.Height(); michael@0: } michael@0: michael@0: void InitScrollAreaEvent(const nsAString& aType, michael@0: bool aCanBubble, michael@0: bool aCancelable, michael@0: nsIDOMWindow* aView, michael@0: int32_t aDetail, michael@0: float aX, float aY, michael@0: float aWidth, float aHeight, michael@0: ErrorResult& aRv) michael@0: { michael@0: aRv = InitScrollAreaEvent(aType, aCanBubble, aCancelable, aView, michael@0: aDetail, aX, aY, aWidth, aHeight); michael@0: } michael@0: michael@0: protected: michael@0: DOMRect mClientArea; michael@0: }; michael@0: michael@0: } // namespace dom michael@0: } // namespace mozilla michael@0: michael@0: #endif // mozilla_dom_ScrollAreaEvent_h_