Phone

#include <bb/system/phone/Phone>

To link against this class, add the following line to your .pro file: LIBS += -lbbsystem

Provides phone-related functionality.

The Phone class is the entry point for phone-related functionality, such as showing the dial pad, starting an outgoing call, checking the available lines supported on the phone, listening to call related notifications, and so on.

The following example shows how to start a cellular call to the phone number "519-555-0100":

bb::system::phone::Phone phone;
phone.initiateCellularCall("519-555-0100");

Permissions:

You must also specify the access_phone permission in your bar-descriptor.xml file.

Since:

BlackBerry 10.0.0

Public Functions Index

Phone (QObject *parent=0)
virtual ~Phone ()
QMap< QString, Line >lines () const
LineactiveLine () const
boolisLineAvailable (LineType::Type type) const

Public Slots Index

voidrequestDialpad (const QString &address, bb::system::phone::LineType::Type type=bb::system::phone::LineType::Cellular)
voidinitiateCellularCall (const QString &phoneNumber, bool applySmartDialing=false)
voidinitiateCall (const QString &address, bb::system::phone::LineType::Type lineType=bb::system::phone::LineType::Cellular)
boolsendDTMFTones (const QByteArray &tones, bb::system::phone::LineType::Type lineType=bb::system::phone::LineType::Cellular)

Signals Index

voidcallUpdated (const bb::system::phone::Call &call)
voidlineUpdated (const bb::system::phone::Line &line)
voidlineRemoved (const bb::system::phone::Line &line)

Public Functions

Phone (

Creates a new Phone object.

Parameters
parent

If not 0, the supplied parent will be responsible for deleting this instance.

Since:

BlackBerry 10.0.0

virtual~Phone ()

Destructor.

Since:

BlackBerry 10.0.0

QMap< QString, Line > lines ()

Returns a map of lines supported on the device.

You cannot immediately query the phone service for the number of lines supported on the device. You need to wait until you get the callUpdated() and lineUpdated() signals before requesting the number of lines.

Return:

A map of lines keyed on the line identifier supported on the device.

Since:

BlackBerry 10.0.0

Line activeLine ()

Returns the currently active line.

You cannot immediately query the phone service for the currently active line. You need to wait until you get the callUpdated() and lineUpdated() signals before requesting the currently active line.

Return:

The currently active line. If there is no active line, an invalid Line object is returned.

Since:

BlackBerry 10.0.0

bool isLineAvailable (

Checks whether a given line is available.

You cannot immediately query the phone service for whether a line is available. You need to wait until you get the callUpdated() and lineUpdated() signals before querying the line.

Parameters
type

The type of the line to check. See LineType for the list of line types.

Return:

true if the given line type is available, false otherwise.

Since:

BlackBerry 10.0.0

Public Slots

void requestDialpad (

Brings the phone dial pad to the foreground with the number field pre-populated with the given address.

The callUpdated() signal will not be emitted for calls resulting from the requestDialpad() method.

Parameters
address

The address with which to populate the number field.

type

The phone line to use when making the call. The default is LineType::Cellular. See LineType for the complete list of line types.

Since:

BlackBerry 10.0.0

void initiateCellularCall (
  • const QString &phoneNumber,
  • boolapplySmartDialing )

Initiates an outgoing cellular call.

Subsequent updates for the initiated call are indicated by the callUpdated() signal.

Parameters
phoneNumber

The phone number to call.

applySmartDialing

Whether to apply smart dialing or not. The default is false.

Since:

BlackBerry 10.0.0

void initiateCall (

Initiate an outgoing call.

Parameters
address

The address (for example, phone number for cellular call, BBID for video chat, and so on) to call.

lineType

The phone line to use when making the call. The default is LineType::Cellular. See LineType for the list of line types.

Since:

BlackBerry 10.0.0

bool sendDTMFTones (

Sends DTMF tones to the active call.

The DTMF tones are sent in the order in which they appear in the QByteArray.

Parameters
tones

The DTMF tones to send. Each element in tones should correspond to a DTMF tone.

lineType

The phone line to which the DTMF tones should be sent. The default is LineType::Cellular. See LineType::Type for the complete list of line types.

Return:

true if the tones were successfully sent to the active call, false otherwise.

Since:

BlackBerry 10.0.0

Signals

void callUpdated (

Emitted when an incoming call is received or updated, or an outgoing call initiated through this Phone object instance is updated.

Parameters
call

A Call object with updated information.

Since:

BlackBerry 10.0.0

void lineUpdated (

Emitted when a line is updated.

Parameters
line

A Line object with updated information.

Since:

BlackBerry 10.0.0

void lineRemoved (

Emitted when a line is removed.

Parameters
line

A Line object that was removed

Since:

BlackBerry 10.0.0