dom/smil/TimeEvent.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:5e23f8c93f75
1 /* -*- Mode: C++; tab-width: 2; 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
6 #ifndef mozilla_dom_TimeEvent_h_
7 #define mozilla_dom_TimeEvent_h_
8
9 #include "mozilla/dom/Event.h"
10 #include "mozilla/dom/TimeEventBinding.h"
11 #include "nsIDOMTimeEvent.h"
12
13 namespace mozilla {
14 namespace dom {
15
16 class TimeEvent MOZ_FINAL : public Event,
17 public nsIDOMTimeEvent
18 {
19 public:
20 TimeEvent(EventTarget* aOwner,
21 nsPresContext* aPresContext,
22 WidgetEvent* aEvent);
23
24 // nsISupports interface:
25 NS_DECL_ISUPPORTS_INHERITED
26 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TimeEvent, Event)
27
28 // nsIDOMTimeEvent interface:
29 NS_DECL_NSIDOMTIMEEVENT
30
31 // Forward to base class
32 NS_FORWARD_TO_EVENT
33
34 virtual JSObject* WrapObject(JSContext* aCx) MOZ_OVERRIDE
35 {
36 return TimeEventBinding::Wrap(aCx, this);
37 }
38
39 int32_t Detail() const
40 {
41 return mDetail;
42 }
43
44 nsIDOMWindow* GetView() const
45 {
46 return mView;
47 }
48
49 void InitTimeEvent(const nsAString& aType, nsIDOMWindow* aView,
50 int32_t aDetail, ErrorResult& aRv)
51 {
52 aRv = InitTimeEvent(aType, aView, aDetail);
53 }
54
55 private:
56 nsCOMPtr<nsIDOMWindow> mView;
57 int32_t mDetail;
58 };
59
60 } // namespace dom
61 } // namespace mozilla
62
63 #endif // mozilla_dom_TimeEvent_h_

mercurial