TextEvent.h (1482B)
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_TextEvent_h 8 #define mozilla_dom_TextEvent_h 9 10 #include "mozilla/EventForwards.h" 11 #include "mozilla/dom/TextEventBinding.h" 12 #include "mozilla/dom/UIEvent.h" 13 14 class nsIPrincipal; 15 16 namespace mozilla::dom { 17 18 class TextEvent : public UIEvent { 19 public: 20 TextEvent(EventTarget* aOwner, nsPresContext* aPresContext, 21 InternalLegacyTextEvent* aEvent); 22 23 NS_INLINE_DECL_REFCOUNTING_INHERITED(TextEvent, UIEvent) 24 25 virtual JSObject* WrapObjectInternal( 26 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override { 27 return TextEvent_Binding::Wrap(aCx, this, aGivenProto); 28 } 29 30 void GetData(nsAString& aData, nsIPrincipal& aSubjectPrincipal) const; 31 void InitTextEvent(const nsAString& typeArg, bool canBubbleArg, 32 bool cancelableArg, nsGlobalWindowInner* viewArg, 33 const nsAString& dataArg); 34 35 protected: 36 ~TextEvent() = default; 37 }; 38 39 } // namespace mozilla::dom 40 41 already_AddRefed<mozilla::dom::TextEvent> NS_NewDOMTextEvent( 42 mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, 43 mozilla::InternalLegacyTextEvent* aEvent); 44 45 #endif // mozilla_dom_InputEvent_h_