dom/telephony/CallEvent.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/telephony/CallEvent.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,58 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=8 sts=2 et sw=2 tw=80: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this file,
     1.8 + * You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef mozilla_dom_telephony_callevent_h
    1.11 +#define mozilla_dom_telephony_callevent_h
    1.12 +
    1.13 +#include "mozilla/dom/Event.h"
    1.14 +#include "mozilla/dom/telephony/TelephonyCommon.h"
    1.15 +
    1.16 +namespace mozilla {
    1.17 +namespace dom {
    1.18 +
    1.19 +struct CallEventInit;
    1.20 +
    1.21 +class CallEvent MOZ_FINAL : public Event
    1.22 +{
    1.23 +  nsRefPtr<TelephonyCall> mCall;
    1.24 +
    1.25 +public:
    1.26 +  NS_DECL_ISUPPORTS_INHERITED
    1.27 +  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(CallEvent, Event)
    1.28 +  NS_FORWARD_TO_EVENT
    1.29 +
    1.30 +  virtual JSObject*
    1.31 +  WrapObject(JSContext* aCx) MOZ_OVERRIDE;
    1.32 +
    1.33 +  // WebIDL
    1.34 +  static already_AddRefed<CallEvent>
    1.35 +  Constructor(const GlobalObject& aGlobal, const nsAString& aType,
    1.36 +              const CallEventInit& aOptions, ErrorResult& aRv);
    1.37 +
    1.38 +  already_AddRefed<TelephonyCall>
    1.39 +  GetCall() const;
    1.40 +
    1.41 +  static already_AddRefed<CallEvent>
    1.42 +  Create(EventTarget* aOwner, const nsAString& aType, TelephonyCall* aCall,
    1.43 +         bool aCanBubble, bool aCancelable);
    1.44 +
    1.45 +private:
    1.46 +  CallEvent(EventTarget* aOwner,
    1.47 +            nsPresContext* aPresContext,
    1.48 +            WidgetEvent* aEvent)
    1.49 +    : Event(aOwner, aPresContext, aEvent)
    1.50 +  {
    1.51 +    SetIsDOMBinding();
    1.52 +  }
    1.53 +
    1.54 +  virtual ~CallEvent()
    1.55 +  { }
    1.56 +};
    1.57 +
    1.58 +} // namespace dom
    1.59 +} // namespace mozilla
    1.60 +
    1.61 +#endif // mozilla_dom_telephony_callevent_h

mercurial