BeforeAfterKeyboardEvent.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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_BeforeAfterKeyboardEvent_h_
  6. #define mozilla_dom_BeforeAfterKeyboardEvent_h_
  7. #include "mozilla/dom/KeyboardEvent.h"
  8. #include "mozilla/dom/BeforeAfterKeyboardEventBinding.h"
  9. namespace mozilla {
  10. namespace dom {
  11. class BeforeAfterKeyboardEvent : public KeyboardEvent
  12. {
  13. public:
  14. BeforeAfterKeyboardEvent(EventTarget* aOwner,
  15. nsPresContext* aPresContext,
  16. InternalBeforeAfterKeyboardEvent* aEvent);
  17. virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
  18. {
  19. return BeforeAfterKeyboardEventBinding::Wrap(aCx, this, aGivenProto);
  20. }
  21. static already_AddRefed<BeforeAfterKeyboardEvent>
  22. Constructor(const GlobalObject& aGlobal,
  23. const nsAString& aType,
  24. const BeforeAfterKeyboardEventInit& aParam,
  25. ErrorResult& aRv);
  26. static already_AddRefed<BeforeAfterKeyboardEvent>
  27. Constructor(EventTarget* aOwner, const nsAString& aType,
  28. const BeforeAfterKeyboardEventInit& aEventInitDict);
  29. // This function returns a boolean value when event typs is either
  30. // "mozbrowserafterkeydown" or "mozbrowserafterkeyup".
  31. Nullable<bool> GetEmbeddedCancelled();
  32. };
  33. } // namespace dom
  34. } // namespace mozilla
  35. already_AddRefed<mozilla::dom::BeforeAfterKeyboardEvent>
  36. NS_NewDOMBeforeAfterKeyboardEvent(mozilla::dom::EventTarget* aOwner,
  37. nsPresContext* aPresContext,
  38. mozilla::InternalBeforeAfterKeyboardEvent* aEvent);
  39. #endif // mozilla_dom_BeforeAfterKeyboardEvent_h_