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
|
|
|
|
|
2014-02-28 06:58:42 -08:00
|
|
|
#ifndef mozilla_dom_XULCommandEvent_h_
|
|
|
|
#define mozilla_dom_XULCommandEvent_h_
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-02-28 06:58:43 -08:00
|
|
|
#include "mozilla/dom/UIEvent.h"
|
2013-03-28 07:19:10 -07:00
|
|
|
#include "mozilla/dom/XULCommandEventBinding.h"
|
2014-02-28 06:58:43 -08:00
|
|
|
#include "nsIDOMXULCommandEvent.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2014-02-28 06:58:42 -08:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2014-02-28 06:58:43 -08:00
|
|
|
class XULCommandEvent : public UIEvent,
|
2014-02-28 06:58:42 -08:00
|
|
|
public nsIDOMXULCommandEvent
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
public:
|
2014-02-28 06:58:42 -08:00
|
|
|
XULCommandEvent(EventTarget* aOwner,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
WidgetInputEvent* aEvent);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-02-28 06:58:43 -08:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULCommandEvent, UIEvent)
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_DECL_NSIDOMXULCOMMANDEVENT
|
|
|
|
|
|
|
|
// Forward our inherited virtual methods to the base class
|
2014-02-28 06:58:43 -08:00
|
|
|
NS_FORWARD_TO_UIEVENT
|
2007-03-22 10:30:00 -07:00
|
|
|
|
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
|
|
|
{
|
Bug 991742 part 6. Remove the "aScope" argument of binding Wrap() methods. r=bholley
This patch was mostly generated with this command:
find . -name "*.h" -o -name "*.cpp" | xargs sed -e 's/Binding::Wrap(aCx, aScope, this/Binding::Wrap(aCx, this/' -e 's/Binding_workers::Wrap(aCx, aScope, this/Binding_workers::Wrap(aCx, this/' -e 's/Binding::Wrap(cx, scope, this/Binding::Wrap(cx, this/' -i ""
plus a few manual fixes to dom/bindings/Codegen.py, js/xpconnect/src/event_impl_gen.py, and a few C++ files that were not caught in the search-and-replace above.
2014-04-08 15:27:17 -07:00
|
|
|
return XULCommandEventBinding::Wrap(aCx, this);
|
2013-03-28 07:19:10 -07:00
|
|
|
}
|
|
|
|
|
2013-10-17 23:10:26 -07:00
|
|
|
bool AltKey();
|
|
|
|
bool CtrlKey();
|
|
|
|
bool ShiftKey();
|
|
|
|
bool MetaKey();
|
2013-03-28 07:19:10 -07:00
|
|
|
|
2014-03-04 16:37:43 -08:00
|
|
|
already_AddRefed<Event> GetSourceEvent()
|
2013-03-28 07:19:10 -07:00
|
|
|
{
|
2014-03-04 16:37:43 -08:00
|
|
|
nsRefPtr<Event> e =
|
2013-03-28 07:19:10 -07:00
|
|
|
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,
|
2014-03-04 16:37:43 -08:00
|
|
|
Event* aSourceEvent,
|
2014-02-28 06:58:42 -08:00
|
|
|
ErrorResult& aRv)
|
2013-03-28 07:19:10 -07:00
|
|
|
{
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2014-02-28 06:58:42 -08:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_XULCommandEvent_h_
|