|
1 /* vim: set shiftwidth=2 tabstop=8 autoindent cindent expandtab: */ |
|
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_FocusEvent_h_ |
|
6 #define mozilla_dom_FocusEvent_h_ |
|
7 |
|
8 #include "mozilla/dom/FocusEventBinding.h" |
|
9 #include "mozilla/dom/UIEvent.h" |
|
10 #include "mozilla/EventForwards.h" |
|
11 #include "nsIDOMFocusEvent.h" |
|
12 |
|
13 namespace mozilla { |
|
14 namespace dom { |
|
15 |
|
16 class FocusEvent : public UIEvent, |
|
17 public nsIDOMFocusEvent |
|
18 { |
|
19 public: |
|
20 NS_DECL_ISUPPORTS |
|
21 NS_DECL_NSIDOMFOCUSEVENT |
|
22 |
|
23 // Forward to base class |
|
24 NS_FORWARD_TO_UIEVENT |
|
25 |
|
26 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE |
|
27 { |
|
28 return FocusEventBinding::Wrap(aCx, this); |
|
29 } |
|
30 |
|
31 FocusEvent(EventTarget* aOwner, |
|
32 nsPresContext* aPresContext, |
|
33 InternalFocusEvent* aEvent); |
|
34 |
|
35 EventTarget* GetRelatedTarget(); |
|
36 |
|
37 static already_AddRefed<FocusEvent> Constructor(const GlobalObject& aGlobal, |
|
38 const nsAString& aType, |
|
39 const FocusEventInit& aParam, |
|
40 ErrorResult& aRv); |
|
41 protected: |
|
42 nsresult InitFocusEvent(const nsAString& aType, |
|
43 bool aCanBubble, |
|
44 bool aCancelable, |
|
45 nsIDOMWindow* aView, |
|
46 int32_t aDetail, |
|
47 EventTarget* aRelatedTarget); |
|
48 }; |
|
49 |
|
50 } // namespace dom |
|
51 } // namespace mozilla |
|
52 |
|
53 #endif // mozilla_dom_FocusEvent_h_ |