2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
2012-05-21 04:12:37 -07: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/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// This class implements a XUL "command" event. See nsIDOMXULCommandEvent.idl
|
|
|
|
|
|
|
|
#ifndef nsDOMXULCommandEvent_h_
|
|
|
|
#define nsDOMXULCommandEvent_h_
|
|
|
|
|
|
|
|
#include "nsDOMUIEvent.h"
|
|
|
|
#include "nsIDOMXULCommandEvent.h"
|
2013-03-28 07:19:10 -07:00
|
|
|
#include "mozilla/dom/XULCommandEventBinding.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class nsDOMXULCommandEvent : public nsDOMUIEvent,
|
|
|
|
public nsIDOMXULCommandEvent
|
|
|
|
{
|
|
|
|
public:
|
2013-03-09 03:34:29 -08:00
|
|
|
nsDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
|
2013-10-01 00:23:02 -07:00
|
|
|
nsPresContext* aPresContext,
|
|
|
|
mozilla::WidgetInputEvent* aEvent);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2009-06-30 00:56:40 -07:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsDOMXULCommandEvent, nsDOMUIEvent)
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_NSIDOMXULCOMMANDEVENT
|
|
|
|
|
|
|
|
// Forward our inherited virtual methods to the base class
|
|
|
|
NS_FORWARD_TO_NSDOMUIEVENT
|
|
|
|
|
2013-04-25 09:29:54 -07:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx,
|
|
|
|
JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
|
2013-03-28 07:19:10 -07:00
|
|
|
{
|
|
|
|
return mozilla::dom::XULCommandEventBinding::Wrap(aCx, aScope, this);
|
|
|
|
}
|
|
|
|
|
2013-10-17 23:10:26 -07:00
|
|
|
bool AltKey();
|
|
|
|
bool CtrlKey();
|
|
|
|
bool ShiftKey();
|
|
|
|
bool MetaKey();
|
2013-03-28 07:19:10 -07:00
|
|
|
|
|
|
|
already_AddRefed<nsDOMEvent> GetSourceEvent()
|
|
|
|
{
|
|
|
|
nsRefPtr<nsDOMEvent> e =
|
|
|
|
mSourceEvent ? mSourceEvent->InternalDOMEvent() : nullptr;
|
|
|
|
return e.forget();
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitCommandEvent(const nsAString& aType,
|
|
|
|
bool aCanBubble, bool aCancelable,
|
|
|
|
nsIDOMWindow* aView,
|
|
|
|
int32_t aDetail,
|
|
|
|
bool aCtrlKey, bool aAltKey,
|
|
|
|
bool aShiftKey, bool aMetaKey,
|
|
|
|
nsDOMEvent* aSourceEvent,
|
|
|
|
mozilla::ErrorResult& aRv)
|
|
|
|
{
|
|
|
|
aRv = InitCommandEvent(aType, aCanBubble, aCancelable, aView, aDetail,
|
|
|
|
aCtrlKey, aAltKey, aShiftKey, aMetaKey,
|
|
|
|
aSourceEvent);
|
|
|
|
}
|
|
|
|
|
2009-06-30 00:56:40 -07:00
|
|
|
protected:
|
|
|
|
nsCOMPtr<nsIDOMEvent> mSourceEvent;
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // nsDOMXULCommandEvent_h_
|