/work/obj-fuzz/dist/include/mozilla/dom/CompositionEvent.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 | | /* vim: set ts=8 sts=2 et sw=2 tw=80: */ |
3 | | /* This Source Code Form is subject to the terms of the Mozilla Public |
4 | | * License, v. 2.0. If a copy of the MPL was not distributed with this |
5 | | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
6 | | |
7 | | #ifndef mozilla_dom_CompositionEvent_h_ |
8 | | #define mozilla_dom_CompositionEvent_h_ |
9 | | |
10 | | #include "mozilla/dom/CompositionEventBinding.h" |
11 | | #include "mozilla/dom/TextClause.h" |
12 | | #include "mozilla/dom/TypedArray.h" |
13 | | #include "mozilla/dom/UIEvent.h" |
14 | | #include "mozilla/EventForwards.h" |
15 | | |
16 | | namespace mozilla { |
17 | | namespace dom { |
18 | | |
19 | | typedef nsTArray<RefPtr<TextClause>> TextClauseArray; |
20 | | |
21 | | class CompositionEvent : public UIEvent |
22 | | { |
23 | | public: |
24 | | CompositionEvent(EventTarget* aOwner, |
25 | | nsPresContext* aPresContext, |
26 | | WidgetCompositionEvent* aEvent); |
27 | | |
28 | | NS_DECL_ISUPPORTS_INHERITED |
29 | | NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CompositionEvent, UIEvent) |
30 | | |
31 | | static already_AddRefed<CompositionEvent> Constructor(const GlobalObject& aGlobal, |
32 | | const nsAString& aType, |
33 | | const CompositionEventInit& aParam, |
34 | | ErrorResult& aRv); |
35 | | |
36 | | virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override |
37 | 0 | { |
38 | 0 | return CompositionEvent_Binding::Wrap(aCx, this, aGivenProto); |
39 | 0 | } |
40 | | |
41 | | void InitCompositionEvent(const nsAString& aType, |
42 | | bool aCanBubble, |
43 | | bool aCancelable, |
44 | | nsGlobalWindowInner* aView, |
45 | | const nsAString& aData, |
46 | | const nsAString& aLocale); |
47 | | void GetData(nsAString&) const; |
48 | | void GetLocale(nsAString&) const; |
49 | | void GetRanges(TextClauseArray& aRanges); |
50 | | |
51 | | protected: |
52 | 0 | ~CompositionEvent() {} |
53 | | |
54 | | nsString mData; |
55 | | nsString mLocale; |
56 | | TextClauseArray mRanges; |
57 | | }; |
58 | | |
59 | | } // namespace dom |
60 | | } // namespace mozilla |
61 | | |
62 | | already_AddRefed<mozilla::dom::CompositionEvent> |
63 | | NS_NewDOMCompositionEvent(mozilla::dom::EventTarget* aOwner, |
64 | | nsPresContext* aPresContext, |
65 | | mozilla::WidgetCompositionEvent* aEvent); |
66 | | |
67 | | #endif // mozilla_dom_CompositionEvent_h_ |