2006-05-22 20:37:32 +00: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 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/. */
|
2006-05-22 20:37:32 +00:00
|
|
|
|
|
|
|
// This class implements a XUL "command" event. See nsIDOMXULCommandEvent.idl
|
|
|
|
|
2014-02-28 14:58:42 +00:00
|
|
|
#ifndef mozilla_dom_XULCommandEvent_h_
|
|
|
|
#define mozilla_dom_XULCommandEvent_h_
|
2006-05-22 20:37:32 +00:00
|
|
|
|
2014-02-28 14:58:43 +00:00
|
|
|
#include "mozilla/dom/UIEvent.h"
|
2013-03-28 14:19:10 +00:00
|
|
|
#include "mozilla/dom/XULCommandEventBinding.h"
|
2014-02-28 14:58:43 +00:00
|
|
|
#include "nsIDOMXULCommandEvent.h"
|
2006-05-22 20:37:32 +00:00
|
|
|
|
2014-02-28 14:58:42 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2014-02-28 14:58:43 +00:00
|
|
|
class XULCommandEvent : public UIEvent,
|
2014-02-28 14:58:42 +00:00
|
|
|
public nsIDOMXULCommandEvent
|
2006-05-22 20:37:32 +00:00
|
|
|
{
|
|
|
|
public:
|
2014-02-28 14:58:42 +00:00
|
|
|
XULCommandEvent(EventTarget* aOwner,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
WidgetInputEvent* aEvent);
|
2006-05-22 20:37:32 +00:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-02-28 14:58:43 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULCommandEvent, UIEvent)
|
2006-05-22 20:37:32 +00:00
|
|
|
NS_DECL_NSIDOMXULCOMMANDEVENT
|
|
|
|
|
|
|
|
// Forward our inherited virtual methods to the base class
|
2014-02-28 14:58:43 +00:00
|
|
|
NS_FORWARD_TO_UIEVENT
|
2006-05-22 20:37:32 +00:00
|
|
|
|
2014-04-08 22:27:18 +00:00
|
|
|
virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
|
2013-03-28 14:19:10 +00: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 22:27:17 +00:00
|
|
|
return XULCommandEventBinding::Wrap(aCx, this);
|
2013-03-28 14:19:10 +00:00
|
|
|
}
|
|
|
|
|
2013-10-18 06:10:26 +00:00
|
|
|
bool AltKey();
|
|
|
|
bool CtrlKey();
|
|
|
|
bool ShiftKey();
|
|
|
|
bool MetaKey();
|
2013-03-28 14:19:10 +00:00
|
|
|
|
2014-03-05 00:37:43 +00:00
|
|
|
already_AddRefed<Event> GetSourceEvent()
|
2013-03-28 14:19:10 +00:00
|
|
|
{
|
2014-03-05 00:37:43 +00:00
|
|
|
nsRefPtr<Event> e =
|
2013-03-28 14:19:10 +00: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-05 00:37:43 +00:00
|
|
|
Event* aSourceEvent,
|
2014-02-28 14:58:42 +00:00
|
|
|
ErrorResult& aRv)
|
2013-03-28 14:19:10 +00:00
|
|
|
{
|
|
|
|
aRv = InitCommandEvent(aType, aCanBubble, aCancelable, aView, aDetail,
|
|
|
|
aCtrlKey, aAltKey, aShiftKey, aMetaKey,
|
|
|
|
aSourceEvent);
|
|
|
|
}
|
|
|
|
|
2009-06-30 07:56:40 +00:00
|
|
|
protected:
|
|
|
|
nsCOMPtr<nsIDOMEvent> mSourceEvent;
|
2006-05-22 20:37:32 +00:00
|
|
|
};
|
|
|
|
|
2014-02-28 14:58:42 +00:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_XULCommandEvent_h_
|