dom/telephony/CallEvent.h

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:f7333a975d25
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 file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7 #ifndef mozilla_dom_telephony_callevent_h
8 #define mozilla_dom_telephony_callevent_h
9
10 #include "mozilla/dom/Event.h"
11 #include "mozilla/dom/telephony/TelephonyCommon.h"
12
13 namespace mozilla {
14 namespace dom {
15
16 struct CallEventInit;
17
18 class CallEvent MOZ_FINAL : public Event
19 {
20 nsRefPtr<TelephonyCall> mCall;
21
22 public:
23 NS_DECL_ISUPPORTS_INHERITED
24 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CallEvent, Event)
25 NS_FORWARD_TO_EVENT
26
27 virtual JSObject*
28 WrapObject(JSContext* aCx) MOZ_OVERRIDE;
29
30 // WebIDL
31 static already_AddRefed<CallEvent>
32 Constructor(const GlobalObject& aGlobal, const nsAString& aType,
33 const CallEventInit& aOptions, ErrorResult& aRv);
34
35 already_AddRefed<TelephonyCall>
36 GetCall() const;
37
38 static already_AddRefed<CallEvent>
39 Create(EventTarget* aOwner, const nsAString& aType, TelephonyCall* aCall,
40 bool aCanBubble, bool aCancelable);
41
42 private:
43 CallEvent(EventTarget* aOwner,
44 nsPresContext* aPresContext,
45 WidgetEvent* aEvent)
46 : Event(aOwner, aPresContext, aEvent)
47 {
48 SetIsDOMBinding();
49 }
50
51 virtual ~CallEvent()
52 { }
53 };
54
55 } // namespace dom
56 } // namespace mozilla
57
58 #endif // mozilla_dom_telephony_callevent_h

mercurial