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