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");
You must also specify the access_phone permission in your bar-descriptor.xml file.
BlackBerry 10.0.0
Public Functions Index
| Phone (QObject *parent=0) | |
| virtual | ~Phone () |
| QMap< QString, Line > | lines () const |
| Line | activeLine () const |
| bool | isLineAvailable (LineType::Type type) const |
Public Slots Index
| void | requestDialpad (const QString &address, bb::system::phone::LineType::Type type=bb::system::phone::LineType::Cellular) |
| void | initiateCellularCall (const QString &phoneNumber, bool applySmartDialing=false) |
| void | initiateCall (const QString &address, bb::system::phone::LineType::Type lineType=bb::system::phone::LineType::Cellular) |
| bool | sendDTMFTones (const QByteArray &tones, bb::system::phone::LineType::Type lineType=bb::system::phone::LineType::Cellular) |
Signals Index
| void | callUpdated (const bb::system::phone::Call &call) |
| void | lineUpdated (const bb::system::phone::Line &line) |
| void | lineRemoved (const bb::system::phone::Line &line) |
Public Functions
Creates a new Phone object.
| Parameters | |
|---|---|
| parent |
If not 0, the supplied parent will be responsible for deleting this instance. |
BlackBerry 10.0.0
virtual
Destructor.
BlackBerry 10.0.0
QMap< QString, Line >
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.
A map of lines keyed on the line identifier supported on the device.
BlackBerry 10.0.0
Line
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.
The currently active line. If there is no active line, an invalid Line object is returned.
BlackBerry 10.0.0
bool
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. |
true if the given line type is available, false otherwise.
BlackBerry 10.0.0
Public Slots
void
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. |
BlackBerry 10.0.0
void
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. |
BlackBerry 10.0.0
void
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. |
BlackBerry 10.0.0
bool
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. |
true if the tones were successfully sent to the active call, false otherwise.
BlackBerry 10.0.0
Signals
void
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. |
BlackBerry 10.0.0
void
Emitted when a line is updated.
| Parameters | |
|---|---|
| line |
A Line object with updated information. |
BlackBerry 10.0.0
void
Emitted when a line is removed.
| Parameters | |
|---|---|
| line |
A Line object that was removed |
BlackBerry 10.0.0