gecko/dom/telephony/TelephonyCall.h
Ehsan Akhgari 8c296bbcd4 Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00

121 lines
2.7 KiB
C++

/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
/* vim: set ts=2 et sw=2 tw=40: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef mozilla_dom_telephony_telephonycall_h__
#define mozilla_dom_telephony_telephonycall_h__
#include "TelephonyCommon.h"
#include "nsIDOMTelephonyCall.h"
#include "nsIRadioInterfaceLayer.h"
class nsPIDOMWindow;
BEGIN_TELEPHONY_NAMESPACE
class TelephonyCall : public nsDOMEventTargetHelper,
public nsIDOMTelephonyCall
{
NS_DECL_EVENT_HANDLER(statechange)
NS_DECL_EVENT_HANDLER(dialing)
NS_DECL_EVENT_HANDLER(alerting)
NS_DECL_EVENT_HANDLER(busy)
NS_DECL_EVENT_HANDLER(connecting)
NS_DECL_EVENT_HANDLER(connected)
NS_DECL_EVENT_HANDLER(disconnecting)
NS_DECL_EVENT_HANDLER(disconnected)
NS_DECL_EVENT_HANDLER(holding)
NS_DECL_EVENT_HANDLER(held)
NS_DECL_EVENT_HANDLER(resuming)
NS_DECL_EVENT_HANDLER(error)
nsRefPtr<Telephony> mTelephony;
nsString mNumber;
nsString mState;
nsCOMPtr<nsIDOMDOMError> mError;
uint32_t mCallIndex;
uint16_t mCallState;
bool mLive;
bool mOutgoing;
public:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMTELEPHONYCALL
NS_FORWARD_NSIDOMEVENTTARGET(nsDOMEventTargetHelper::)
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(TelephonyCall,
nsDOMEventTargetHelper)
static already_AddRefed<TelephonyCall>
Create(Telephony* aTelephony, const nsAString& aNumber, uint16_t aCallState,
uint32_t aCallIndex = kOutgoingPlaceholderCallIndex);
nsIDOMEventTarget*
ToIDOMEventTarget() const
{
return static_cast<nsDOMEventTargetHelper*>(
const_cast<TelephonyCall*>(this));
}
nsISupports*
ToISupports() const
{
return ToIDOMEventTarget();
}
void
ChangeState(uint16_t aCallState)
{
ChangeStateInternal(aCallState, true);
}
uint32_t
CallIndex() const
{
return mCallIndex;
}
void
UpdateCallIndex(uint32_t aCallIndex)
{
NS_ASSERTION(mCallIndex == kOutgoingPlaceholderCallIndex,
"Call index should not be set!");
mCallIndex = aCallIndex;
}
uint16_t
CallState() const
{
return mCallState;
}
bool
IsOutgoing() const
{
return mOutgoing;
}
void
NotifyError(const nsAString& aError);
private:
TelephonyCall()
: mCallIndex(kOutgoingPlaceholderCallIndex),
mCallState(nsIRadioInterfaceLayer::CALL_STATE_UNKNOWN), mLive(false), mOutgoing(false)
{ }
~TelephonyCall()
{ }
void
ChangeStateInternal(uint16_t aCallState, bool aFireEvents);
};
END_TELEPHONY_NAMESPACE
#endif // mozilla_dom_telephony_telephonycall_h__