Line data Source code
1 : /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 : /* This Source Code Form is subject to the terms of the Mozilla Public
4 : * License, v. 2.0. If a copy of the MPL was not distributed with this
5 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 :
7 : #ifndef mozilla_dom_ScrollAreaEvent_h_
8 : #define mozilla_dom_ScrollAreaEvent_h_
9 :
10 : #include "mozilla/dom/DOMRect.h"
11 : #include "mozilla/dom/ScrollAreaEventBinding.h"
12 : #include "mozilla/dom/UIEvent.h"
13 : #include "mozilla/Attributes.h"
14 : #include "mozilla/EventForwards.h"
15 :
16 : namespace mozilla {
17 : namespace dom {
18 :
19 : class ScrollAreaEvent : public UIEvent
20 : {
21 : public:
22 : ScrollAreaEvent(EventTarget* aOwner,
23 : nsPresContext* aPresContext,
24 : InternalScrollAreaEvent* aEvent);
25 :
26 : NS_DECL_ISUPPORTS_INHERITED
27 0 : NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(ScrollAreaEvent, UIEvent)
28 0 : NS_FORWARD_NSIDOMUIEVENT(UIEvent::)
29 :
30 0 : NS_FORWARD_TO_EVENT_NO_SERIALIZATION_NO_DUPLICATION
31 0 : NS_IMETHOD DuplicatePrivateData() override
32 : {
33 0 : return Event::DuplicatePrivateData();
34 : }
35 : NS_IMETHOD_(void) Serialize(IPC::Message* aMsg, bool aSerializeInterfaceType) override;
36 : NS_IMETHOD_(bool) Deserialize(const IPC::Message* aMsg, PickleIterator* aIter) override;
37 :
38 0 : virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
39 : {
40 0 : return ScrollAreaEventBinding::Wrap(aCx, this, aGivenProto);
41 : }
42 :
43 0 : float X() const
44 : {
45 0 : return mClientArea->Left();
46 : }
47 :
48 0 : float Y() const
49 : {
50 0 : return mClientArea->Top();
51 : }
52 :
53 0 : float Width() const
54 : {
55 0 : return mClientArea->Width();
56 : }
57 :
58 0 : float Height() const
59 : {
60 0 : return mClientArea->Height();
61 : }
62 :
63 : void InitScrollAreaEvent(const nsAString& aType,
64 : bool aCanBubble,
65 : bool aCancelable,
66 : nsGlobalWindow* aView,
67 : int32_t aDetail,
68 : float aX, float aY,
69 : float aWidth, float aHeight);
70 :
71 : protected:
72 0 : ~ScrollAreaEvent() {}
73 :
74 : RefPtr<DOMRect> mClientArea;
75 : };
76 :
77 : } // namespace dom
78 : } // namespace mozilla
79 :
80 : already_AddRefed<mozilla::dom::ScrollAreaEvent>
81 : NS_NewDOMScrollAreaEvent(mozilla::dom::EventTarget* aOwner,
82 : nsPresContext* aPresContext,
83 : mozilla::InternalScrollAreaEvent* aEvent);
84 :
85 : #endif // mozilla_dom_ScrollAreaEvent_h_
|