InputEvent.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef mozilla_dom_InputEvent_h_
  6. #define mozilla_dom_InputEvent_h_
  7. #include "mozilla/dom/UIEvent.h"
  8. #include "mozilla/dom/InputEventBinding.h"
  9. #include "mozilla/EventForwards.h"
  10. namespace mozilla {
  11. namespace dom {
  12. class InputEvent : public UIEvent
  13. {
  14. public:
  15. InputEvent(EventTarget* aOwner,
  16. nsPresContext* aPresContext,
  17. InternalEditorInputEvent* aEvent);
  18. NS_DECL_ISUPPORTS_INHERITED
  19. // Forward to base class
  20. NS_FORWARD_TO_UIEVENT
  21. static already_AddRefed<InputEvent> Constructor(const GlobalObject& aGlobal,
  22. const nsAString& aType,
  23. const InputEventInit& aParam,
  24. ErrorResult& aRv);
  25. virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
  26. {
  27. return InputEventBinding::Wrap(aCx, this, aGivenProto);
  28. }
  29. bool IsComposing();
  30. protected:
  31. ~InputEvent() {}
  32. };
  33. } // namespace dom
  34. } // namespace mozilla
  35. already_AddRefed<mozilla::dom::InputEvent>
  36. NS_NewDOMInputEvent(mozilla::dom::EventTarget* aOwner,
  37. nsPresContext* aPresContext,
  38. mozilla::InternalEditorInputEvent* aEvent);
  39. #endif // mozilla_dom_InputEvent_h_