2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-21 15:12:37 +04: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-23 00:37:32 +04:00
|
|
|
|
2018-03-19 22:50:37 +03:00
|
|
|
// This class implements a XUL "command" event. See XULCommandEvent.webidl
|
2006-05-23 00:37:32 +04:00
|
|
|
|
2014-02-28 18:58:42 +04:00
|
|
|
#ifndef mozilla_dom_XULCommandEvent_h_
|
|
|
|
#define mozilla_dom_XULCommandEvent_h_
|
2006-05-23 00:37:32 +04:00
|
|
|
|
2018-04-20 19:55:30 +03:00
|
|
|
#include "mozilla/RefPtr.h"
|
2014-02-28 18:58:43 +04:00
|
|
|
#include "mozilla/dom/UIEvent.h"
|
2013-03-28 18:19:10 +04:00
|
|
|
#include "mozilla/dom/XULCommandEventBinding.h"
|
2006-05-23 00:37:32 +04:00
|
|
|
|
2014-02-28 18:58:42 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2018-03-19 22:50:37 +03:00
|
|
|
class XULCommandEvent : public UIEvent
|
2006-05-23 00:37:32 +04:00
|
|
|
{
|
|
|
|
public:
|
2014-02-28 18:58:42 +04:00
|
|
|
XULCommandEvent(EventTarget* aOwner,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
WidgetInputEvent* aEvent);
|
2006-05-23 00:37:32 +04:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2014-02-28 18:58:43 +04:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(XULCommandEvent, UIEvent)
|
2006-05-23 00:37:32 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
|
2013-03-28 18:19:10 +04:00
|
|
|
{
|
2018-06-26 00:20:54 +03:00
|
|
|
return XULCommandEvent_Binding::Wrap(aCx, this, aGivenProto);
|
2013-03-28 18:19:10 +04:00
|
|
|
}
|
|
|
|
|
2018-03-19 22:50:37 +03:00
|
|
|
virtual XULCommandEvent* AsXULCommandEvent() override
|
|
|
|
{
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
2013-10-18 10:10:26 +04:00
|
|
|
bool AltKey();
|
|
|
|
bool CtrlKey();
|
|
|
|
bool ShiftKey();
|
|
|
|
bool MetaKey();
|
2017-07-20 18:45:56 +03:00
|
|
|
uint16_t InputSource();
|
2013-03-28 18:19:10 +04:00
|
|
|
|
2014-03-05 04:37:43 +04:00
|
|
|
already_AddRefed<Event> GetSourceEvent()
|
2013-03-28 18:19:10 +04:00
|
|
|
{
|
2018-04-20 19:55:30 +03:00
|
|
|
RefPtr<Event> e = mSourceEvent;
|
2013-03-28 18:19:10 +04:00
|
|
|
return e.forget();
|
|
|
|
}
|
|
|
|
|
|
|
|
void InitCommandEvent(const nsAString& aType,
|
|
|
|
bool aCanBubble, bool aCancelable,
|
2017-11-07 01:52:14 +03:00
|
|
|
nsGlobalWindowInner* aView,
|
2013-03-28 18:19:10 +04:00
|
|
|
int32_t aDetail,
|
|
|
|
bool aCtrlKey, bool aAltKey,
|
|
|
|
bool aShiftKey, bool aMetaKey,
|
2017-07-20 18:45:56 +03:00
|
|
|
Event* aSourceEvent,
|
2018-03-19 22:50:37 +03:00
|
|
|
uint16_t aInputSource,
|
|
|
|
ErrorResult& aRv);
|
2013-03-28 18:19:10 +04:00
|
|
|
|
2009-06-30 11:56:40 +04:00
|
|
|
protected:
|
2014-07-09 01:23:17 +04:00
|
|
|
~XULCommandEvent() {}
|
|
|
|
|
2018-04-20 19:55:30 +03:00
|
|
|
RefPtr<Event> mSourceEvent;
|
2017-07-20 18:45:56 +03:00
|
|
|
uint16_t mInputSource;
|
2006-05-23 00:37:32 +04:00
|
|
|
};
|
|
|
|
|
2014-02-28 18:58:42 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2015-08-12 14:39:31 +03:00
|
|
|
already_AddRefed<mozilla::dom::XULCommandEvent>
|
|
|
|
NS_NewDOMXULCommandEvent(mozilla::dom::EventTarget* aOwner,
|
|
|
|
nsPresContext* aPresContext,
|
|
|
|
mozilla::WidgetInputEvent* aEvent);
|
|
|
|
|
2014-02-28 18:58:42 +04:00
|
|
|
#endif // mozilla_dom_XULCommandEvent_h_
|