FocusEvent.h (1693B)
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 #ifndef mozilla_dom_FocusEvent_h_ 7 #define mozilla_dom_FocusEvent_h_ 8 9 #include "mozilla/EventForwards.h" 10 #include "mozilla/dom/FocusEventBinding.h" 11 #include "mozilla/dom/UIEvent.h" 12 13 namespace mozilla::dom { 14 15 class FocusEvent : public UIEvent { 16 public: 17 NS_INLINE_DECL_REFCOUNTING_INHERITED(FocusEvent, UIEvent) 18 19 virtual JSObject* WrapObjectInternal( 20 JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override { 21 return FocusEvent_Binding::Wrap(aCx, this, aGivenProto); 22 } 23 24 FocusEvent(EventTarget* aOwner, nsPresContext* aPresContext, 25 InternalFocusEvent* aEvent); 26 27 already_AddRefed<EventTarget> GetRelatedTarget(); 28 29 static already_AddRefed<FocusEvent> Constructor(const GlobalObject& aGlobal, 30 const nsAString& aType, 31 const FocusEventInit& aParam); 32 33 protected: 34 ~FocusEvent() = default; 35 36 void InitFocusEvent(const nsAString& aType, bool aCanBubble, bool aCancelable, 37 nsGlobalWindowInner* aView, int32_t aDetail, 38 EventTarget* aRelatedTarget); 39 }; 40 41 } // namespace mozilla::dom 42 43 already_AddRefed<mozilla::dom::FocusEvent> NS_NewDOMFocusEvent( 44 mozilla::dom::EventTarget* aOwner, nsPresContext* aPresContext, 45 mozilla::InternalFocusEvent* aEvent); 46 47 #endif // mozilla_dom_FocusEvent_h_