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: */
|
2014-07-01 03:02:04 +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/. */
|
|
|
|
|
|
|
|
#ifndef CustomEvent_h__
|
|
|
|
#define CustomEvent_h__
|
|
|
|
|
|
|
|
#include "mozilla/dom/Event.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
struct CustomEventInit;
|
|
|
|
|
2018-03-26 21:53:51 +03:00
|
|
|
class CustomEvent final : public Event {
|
2014-07-01 03:02:04 +04:00
|
|
|
private:
|
|
|
|
virtual ~CustomEvent();
|
|
|
|
|
2016-03-09 13:13:12 +03:00
|
|
|
JS::Heap<JS::Value> mDetail;
|
2014-07-01 03:02:04 +04:00
|
|
|
|
|
|
|
public:
|
2014-09-02 04:49:25 +04:00
|
|
|
explicit CustomEvent(mozilla::dom::EventTarget* aOwner,
|
|
|
|
nsPresContext* aPresContext = nullptr,
|
|
|
|
mozilla::WidgetEvent* aEvent = nullptr);
|
2014-07-01 03:02:04 +04:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2016-03-09 13:13:12 +03:00
|
|
|
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(CustomEvent, Event)
|
2014-07-01 03:02:04 +04:00
|
|
|
|
|
|
|
static already_AddRefed<CustomEvent> Constructor(
|
|
|
|
const GlobalObject& aGlobal, const nsAString& aType,
|
2019-09-11 17:35:28 +03:00
|
|
|
const CustomEventInit& aParam);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapObjectInternal(
|
|
|
|
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2018-03-26 21:53:51 +03:00
|
|
|
CustomEvent* AsCustomEvent() override { return this; }
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2014-07-01 03:02:04 +04:00
|
|
|
void GetDetail(JSContext* aCx, JS::MutableHandle<JS::Value> aRetval);
|
2018-11-30 13:46:48 +03:00
|
|
|
|
2014-07-01 03:02:04 +04:00
|
|
|
void InitCustomEvent(JSContext* aCx, const nsAString& aType, bool aCanBubble,
|
2018-03-26 21:53:51 +03:00
|
|
|
bool aCancelable, JS::Handle<JS::Value> aDetail);
|
2014-07-01 03:02:04 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2015-08-12 14:39:31 +03:00
|
|
|
already_AddRefed<mozilla::dom::CustomEvent> NS_NewDOMCustomEvent(
|
|
|
|
mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
|
|
|
|
mozilla::WidgetEvent* aEvent);
|
|
|
|
|
2014-07-01 03:02:04 +04:00
|
|
|
#endif // CustomEvent_h__
|