Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #ifndef mozilla_dom_ScrollAreaEvent_h_ |
michael@0 | 7 | #define mozilla_dom_ScrollAreaEvent_h_ |
michael@0 | 8 | |
michael@0 | 9 | #include "mozilla/dom/DOMRect.h" |
michael@0 | 10 | #include "mozilla/dom/ScrollAreaEventBinding.h" |
michael@0 | 11 | #include "mozilla/dom/UIEvent.h" |
michael@0 | 12 | #include "mozilla/Attributes.h" |
michael@0 | 13 | #include "mozilla/EventForwards.h" |
michael@0 | 14 | #include "nsIDOMScrollAreaEvent.h" |
michael@0 | 15 | |
michael@0 | 16 | namespace mozilla { |
michael@0 | 17 | namespace dom { |
michael@0 | 18 | |
michael@0 | 19 | class ScrollAreaEvent : public UIEvent, |
michael@0 | 20 | public nsIDOMScrollAreaEvent |
michael@0 | 21 | { |
michael@0 | 22 | public: |
michael@0 | 23 | ScrollAreaEvent(EventTarget* aOwner, |
michael@0 | 24 | nsPresContext* aPresContext, |
michael@0 | 25 | InternalScrollAreaEvent* aEvent); |
michael@0 | 26 | |
michael@0 | 27 | NS_DECL_ISUPPORTS_INHERITED |
michael@0 | 28 | |
michael@0 | 29 | NS_DECL_NSIDOMSCROLLAREAEVENT |
michael@0 | 30 | |
michael@0 | 31 | NS_FORWARD_NSIDOMUIEVENT(UIEvent::) |
michael@0 | 32 | |
michael@0 | 33 | NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION |
michael@0 | 34 | NS_IMETHOD DuplicatePrivateData() |
michael@0 | 35 | { |
michael@0 | 36 | return Event::DuplicatePrivateData(); |
michael@0 | 37 | } |
michael@0 | 38 | NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) MOZ_OVERRIDE; |
michael@0 | 39 | NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, void** aIter) MOZ_OVERRIDE; |
michael@0 | 40 | |
michael@0 | 41 | virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE |
michael@0 | 42 | { |
michael@0 | 43 | return ScrollAreaEventBinding::Wrap(aCx, this); |
michael@0 | 44 | } |
michael@0 | 45 | |
michael@0 | 46 | float X() const |
michael@0 | 47 | { |
michael@0 | 48 | return mClientArea.Left(); |
michael@0 | 49 | } |
michael@0 | 50 | |
michael@0 | 51 | float Y() const |
michael@0 | 52 | { |
michael@0 | 53 | return mClientArea.Top(); |
michael@0 | 54 | } |
michael@0 | 55 | |
michael@0 | 56 | float Width() const |
michael@0 | 57 | { |
michael@0 | 58 | return mClientArea.Width(); |
michael@0 | 59 | } |
michael@0 | 60 | |
michael@0 | 61 | float Height() const |
michael@0 | 62 | { |
michael@0 | 63 | return mClientArea.Height(); |
michael@0 | 64 | } |
michael@0 | 65 | |
michael@0 | 66 | void InitScrollAreaEvent(const nsAString& aType, |
michael@0 | 67 | bool aCanBubble, |
michael@0 | 68 | bool aCancelable, |
michael@0 | 69 | nsIDOMWindow* aView, |
michael@0 | 70 | int32_t aDetail, |
michael@0 | 71 | float aX, float aY, |
michael@0 | 72 | float aWidth, float aHeight, |
michael@0 | 73 | ErrorResult& aRv) |
michael@0 | 74 | { |
michael@0 | 75 | aRv = InitScrollAreaEvent(aType, aCanBubble, aCancelable, aView, |
michael@0 | 76 | aDetail, aX, aY, aWidth, aHeight); |
michael@0 | 77 | } |
michael@0 | 78 | |
michael@0 | 79 | protected: |
michael@0 | 80 | DOMRect mClientArea; |
michael@0 | 81 | }; |
michael@0 | 82 | |
michael@0 | 83 | } // namespace dom |
michael@0 | 84 | } // namespace mozilla |
michael@0 | 85 | |
michael@0 | 86 | #endif // mozilla_dom_ScrollAreaEvent_h_ |