Line data Source code
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/dom/FocusEventBinding.h"
10 : #include "mozilla/dom/UIEvent.h"
11 : #include "mozilla/EventForwards.h"
12 : #include "nsIDOMFocusEvent.h"
13 :
14 : namespace mozilla {
15 : namespace dom {
16 :
17 : class FocusEvent : public UIEvent,
18 : public nsIDOMFocusEvent
19 : {
20 : public:
21 : NS_DECL_ISUPPORTS_INHERITED
22 : NS_DECL_NSIDOMFOCUSEVENT
23 :
24 : // Forward to base class
25 19 : NS_FORWARD_TO_UIEVENT
26 :
27 0 : virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override
28 : {
29 0 : return FocusEventBinding::Wrap(aCx, this, aGivenProto);
30 : }
31 :
32 : FocusEvent(EventTarget* aOwner,
33 : nsPresContext* aPresContext,
34 : InternalFocusEvent* aEvent);
35 :
36 : already_AddRefed<EventTarget> GetRelatedTarget();
37 :
38 : static already_AddRefed<FocusEvent> Constructor(const GlobalObject& aGlobal,
39 : const nsAString& aType,
40 : const FocusEventInit& aParam,
41 : ErrorResult& aRv);
42 : protected:
43 3 : ~FocusEvent() {}
44 :
45 : void InitFocusEvent(const nsAString& aType,
46 : bool aCanBubble,
47 : bool aCancelable,
48 : nsGlobalWindow* aView,
49 : int32_t aDetail,
50 : EventTarget* aRelatedTarget);
51 : };
52 :
53 : } // namespace dom
54 : } // namespace mozilla
55 :
56 : already_AddRefed<mozilla::dom::FocusEvent>
57 : NS_NewDOMFocusEvent(mozilla::dom::EventTarget* aOwner,
58 : nsPresContext* aPresContext,
59 : mozilla::InternalFocusEvent* aEvent);
60 :
61 : #endif // mozilla_dom_FocusEvent_h_
|