2008-08-27 12:07:27 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2008-08-27 12:07:27 +00:00
|
|
|
|
|
|
|
#ifndef nsDOMDragEvent_h__
|
|
|
|
#define nsDOMDragEvent_h__
|
|
|
|
|
|
|
|
#include "nsIDOMDragEvent.h"
|
|
|
|
#include "nsDOMMouseEvent.h"
|
2013-04-18 23:13:35 +00:00
|
|
|
#include "mozilla/dom/DragEventBinding.h"
|
2008-08-27 12:07:27 +00:00
|
|
|
|
|
|
|
class nsEvent;
|
|
|
|
|
2009-10-21 09:38:39 +00:00
|
|
|
class nsDOMDragEvent : public nsDOMMouseEvent,
|
|
|
|
public nsIDOMDragEvent
|
2008-08-27 12:07:27 +00:00
|
|
|
{
|
|
|
|
public:
|
2013-03-09 11:34:29 +00:00
|
|
|
nsDOMDragEvent(mozilla::dom::EventTarget* aOwner,
|
|
|
|
nsPresContext* aPresContext, nsInputEvent* aEvent);
|
2008-08-27 12:07:27 +00:00
|
|
|
virtual ~nsDOMDragEvent();
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
NS_DECL_NSIDOMDRAGEVENT
|
|
|
|
|
|
|
|
NS_FORWARD_TO_NSDOMMOUSEEVENT
|
2013-04-18 23:13:35 +00:00
|
|
|
|
|
|
|
virtual JSObject* WrapObject(JSContext* aCx, JSObject* aScope)
|
|
|
|
{
|
|
|
|
return mozilla::dom::DragEventBinding::Wrap(aCx, aScope, this);
|
|
|
|
}
|
|
|
|
|
|
|
|
nsIDOMDataTransfer* GetDataTransfer();
|
|
|
|
|
|
|
|
void InitDragEvent(const nsAString& aType,
|
|
|
|
bool aCanBubble, bool aCancelable,
|
|
|
|
nsIDOMWindow* aView, int32_t aDetail,
|
|
|
|
int32_t aScreenX, int32_t aScreenY,
|
|
|
|
int32_t aClientX, int32_t aClientY,
|
|
|
|
bool aCtrlKey, bool aAltKey, bool aShiftKey,
|
|
|
|
bool aMetaKey, uint16_t aButton,
|
|
|
|
mozilla::dom::EventTarget* aRelatedTarget,
|
|
|
|
nsIDOMDataTransfer* aDataTransfer,
|
|
|
|
mozilla::ErrorResult& aRv)
|
|
|
|
{
|
|
|
|
aRv = InitDragEvent(aType, aCanBubble, aCancelable,
|
|
|
|
aView, aDetail, aScreenX, aScreenY, aClientX, aClientY,
|
|
|
|
aCtrlKey, aAltKey, aShiftKey, aMetaKey, aButton,
|
|
|
|
aRelatedTarget, aDataTransfer);
|
|
|
|
}
|
2008-08-27 12:07:27 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nsresult NS_NewDOMDragEvent(nsIDOMEvent** aInstancePtrResult,
|
2013-03-09 11:34:29 +00:00
|
|
|
mozilla::dom::EventTarget* aOwner,
|
2008-08-27 12:07:27 +00:00
|
|
|
nsPresContext* aPresContext,
|
|
|
|
nsDragEvent* aEvent);
|
|
|
|
|
|
|
|
#endif // nsDOMDragEvent_h__
|