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_DragEvent_h_
8 : #define mozilla_dom_DragEvent_h_
9 :
10 : #include "nsIDOMDragEvent.h"
11 : #include "mozilla/dom/MouseEvent.h"
12 : #include "mozilla/dom/DragEventBinding.h"
13 : #include "mozilla/EventForwards.h"
14 :
15 : namespace mozilla {
16 : namespace dom {
17 :
18 : class DataTransfer;
19 :
20 : class DragEvent : public MouseEvent,
21 : public nsIDOMDragEvent
22 : {
23 : public:
24 : DragEvent(EventTarget* aOwner,
25 : nsPresContext* aPresContext,
26 : WidgetDragEvent* aEvent);
27 :
28 : NS_DECL_ISUPPORTS_INHERITED
29 :
30 : NS_DECL_NSIDOMDRAGEVENT
31 :
32 0 : NS_FORWARD_TO_MOUSEEVENT
33 :
34 0 : virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
35 : {
36 0 : return DragEventBinding::Wrap(aCx, this, aGivenProto);
37 : }
38 :
39 : DataTransfer* GetDataTransfer();
40 :
41 : void InitDragEvent(const nsAString& aType,
42 : bool aCanBubble, bool aCancelable,
43 : nsGlobalWindow* aView, int32_t aDetail,
44 : int32_t aScreenX, int32_t aScreenY,
45 : int32_t aClientX, int32_t aClientY,
46 : bool aCtrlKey, bool aAltKey, bool aShiftKey,
47 : bool aMetaKey, uint16_t aButton,
48 : EventTarget* aRelatedTarget,
49 : DataTransfer* aDataTransfer);
50 :
51 : static already_AddRefed<DragEvent> Constructor(const GlobalObject& aGlobal,
52 : const nsAString& aType,
53 : const DragEventInit& aParam,
54 : ErrorResult& aRv);
55 :
56 : protected:
57 0 : ~DragEvent() {}
58 : };
59 :
60 : } // namespace dom
61 : } // namespace mozilla
62 :
63 : already_AddRefed<mozilla::dom::DragEvent>
64 : NS_NewDOMDragEvent(mozilla::dom::EventTarget* aOwner,
65 : nsPresContext* aPresContext,
66 : mozilla::WidgetDragEvent* aEvent);
67 :
68 : #endif // mozilla_dom_DragEvent_h_
|