2011-09-22 09:17:40 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2015-05-03 19:32:37 +00:00
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
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/. */
|
2011-09-22 09:17:40 +00:00
|
|
|
|
2014-02-26 05:23:57 +00:00
|
|
|
#ifndef mozilla_dom_CompositionEvent_h_
|
|
|
|
#define mozilla_dom_CompositionEvent_h_
|
2011-09-22 09:17:40 +00:00
|
|
|
|
2013-03-26 11:45:45 +00:00
|
|
|
#include "mozilla/dom/CompositionEventBinding.h"
|
2016-07-26 10:09:07 +00:00
|
|
|
#include "mozilla/dom/TextClause.h"
|
|
|
|
#include "mozilla/dom/TypedArray.h"
|
2014-02-28 14:58:43 +00:00
|
|
|
#include "mozilla/dom/UIEvent.h"
|
2013-10-18 06:10:25 +00:00
|
|
|
#include "mozilla/EventForwards.h"
|
2011-09-22 09:17:40 +00:00
|
|
|
|
2022-05-09 20:41:06 +00:00
|
|
|
namespace mozilla::dom {
|
2014-02-26 05:23:57 +00:00
|
|
|
|
2021-08-07 10:36:35 +00:00
|
|
|
using TextClauseArray = nsTArray<RefPtr<TextClause>>;
|
2016-07-26 10:09:07 +00:00
|
|
|
|
2016-01-30 17:05:36 +00:00
|
|
|
class CompositionEvent : public UIEvent {
|
2011-09-22 09:17:40 +00:00
|
|
|
public:
|
2014-02-26 05:23:57 +00:00
|
|
|
CompositionEvent(EventTarget* aOwner, nsPresContext* aPresContext,
|
|
|
|
WidgetCompositionEvent* aEvent);
|
2011-09-22 09:17:40 +00:00
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
2017-01-26 06:35:09 +00:00
|
|
|
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CompositionEvent, UIEvent)
|
2011-09-22 09:17:40 +00:00
|
|
|
|
2016-11-16 20:16:22 +00:00
|
|
|
static already_AddRefed<CompositionEvent> Constructor(
|
|
|
|
const GlobalObject& aGlobal, const nsAString& aType,
|
2019-09-11 14:35:28 +00:00
|
|
|
const CompositionEventInit& aParam);
|
2016-11-16 20:16:22 +00:00
|
|
|
|
2015-03-21 16:28:04 +00:00
|
|
|
virtual JSObject* WrapObjectInternal(
|
|
|
|
JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override {
|
2018-06-25 21:20:54 +00:00
|
|
|
return CompositionEvent_Binding::Wrap(aCx, this, aGivenProto);
|
2013-03-26 11:45:45 +00:00
|
|
|
}
|
|
|
|
|
2014-02-26 05:23:57 +00:00
|
|
|
void InitCompositionEvent(const nsAString& aType, bool aCanBubble,
|
2017-11-06 22:52:14 +00:00
|
|
|
bool aCancelable, nsGlobalWindowInner* aView,
|
2016-01-30 17:05:36 +00:00
|
|
|
const nsAString& aData, const nsAString& aLocale);
|
|
|
|
void GetData(nsAString&) const;
|
|
|
|
void GetLocale(nsAString&) const;
|
2016-07-26 10:09:07 +00:00
|
|
|
void GetRanges(TextClauseArray& aRanges);
|
2013-03-26 11:45:45 +00:00
|
|
|
|
2011-09-22 09:17:40 +00:00
|
|
|
protected:
|
2020-02-20 15:56:28 +00:00
|
|
|
~CompositionEvent() = default;
|
2014-07-08 21:23:17 +00:00
|
|
|
|
2011-09-22 09:17:40 +00:00
|
|
|
nsString mData;
|
|
|
|
nsString mLocale;
|
2016-07-26 10:09:07 +00:00
|
|
|
TextClauseArray mRanges;
|
2011-09-22 09:17:40 +00:00
|
|
|
};
|
|
|
|
|
2022-05-09 20:41:06 +00:00
|
|
|
} // namespace mozilla::dom
|
2014-02-26 05:23:57 +00:00
|
|
|
|
2015-08-12 11:39:31 +00:00
|
|
|
already_AddRefed<mozilla::dom::CompositionEvent> NS_NewDOMCompositionEvent(
|
|
|
|
mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext,
|
|
|
|
mozilla::WidgetCompositionEvent* aEvent);
|
|
|
|
|
2014-02-26 05:23:57 +00:00
|
|
|
#endif // mozilla_dom_CompositionEvent_h_
|