Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions codeless banner

QPhoneCallManager Class Reference
[QtTelephonyModule]

The QPhoneCallManager class provides access to the phone's call list. More...

    #include <QPhoneCallManager>

Inherits QObject.

Public Functions

Signals

Additional Inherited Members


Detailed Description

The QPhoneCallManager class provides access to the phone's call list.

The current list of calls in the system can be inspected with QPhoneCallManager, and new outgoing calls can be created with create().

The calls() method returns a list of all active calls in the system. Active calls are those that are dialing, incoming, connected, or on hold. Idle and dropped calls are not included in the list.

New calls are added to the call list whenever a client application creates a call with create(), or when an incoming call is detected by the back-end telephony services. The newCall() signal is emitted when either of these conditions occurs.

As calls change state, the statesChanged() signal is emitted, providing a list of all calls affected by the state change. More than one call may be affected by a state change in cases where an entire group of calls are hung up, put on hold, or swapped with an active call group.

State changes on individual calls can be tracked using QPhoneCall::connectStateChanged(), but this does not allow group operations to be tracked atomically. The statesChanged() signal allows atomic tracking of group operations.

The methods callTypes() and services() can be used to find the telephony handlers in the system, so that higher-level applications can choose the most appropriate type of call.

For an example that demonstrates the use of QPhoneCallManager, see Making Phone Calls. Also see the documentation for QPhoneCall.

See also QPhoneCall.


Member Function Documentation

QPhoneCallManager::QPhoneCallManager ( QObject * parent = 0 )

Creates a new phone call manager and attaches it to parent.

QPhoneCallManager::~QPhoneCallManager ()

Destroys this phone call manager.

QStringList QPhoneCallManager::callTypes () const

Returns a list of all call types that are supported by the system at present. The returned list will contain strings such as Voice, VoIP, Data, etc, indicating the valid call types that can be created with create(). For example, the following can be used to determine if VoIP calls are possible:

    QPhoneCallManager mgr;
    if (mgr.callTypes().contains("VoIP"))
        ...

Call types are added to this list whenever new telephony services are registered with the system, and removed when the telephony services are deregistered. The callTypesChanged() signal can be used to track changes to the call type list.

See also create(), callTypesChanged(), and services().

QStringList QPhoneCallManager::callTypes ( const QString & service ) const

This is an overloaded member function, provided for convenience.

Returns a list of all call types that are supported by service. The returned list will contain strings such as Voice, VoIP, Data, etc, indicating the valid call types that can be created with create() when service is supplied as its second parameter.

For example, the following can be used to determine if the modem service can create Data calls, irrespective of whether other services can create Data calls:

    QPhoneCallManager mgr;
    if (mgr.callTypes("modem").contains("Data"))
        ...

Call types are added to this list when the specified telephony service is registered, and removed when the specified telephony service is deregistered and there are no other services that provide the same call type. The callTypesChanged() signal can be used to track changes to the call type list.

See also create(), callTypesChanged(), and services().

void QPhoneCallManager::callTypesChanged ()   [signal]

Signal that is emitted when the list of call types that are supported by the system changes, or if the services that implement the call types changes. This is usually an indication that a new telephony handler has been created, or an existing telephony handler has shut down.

See also callTypes() and services().

QList<QPhoneCall> QPhoneCallManager::calls () const

Returns a list of all active calls in the system. Active calls are those that are dialing, incoming, connected, or on hold. Idle and dropped calls are not included in this list.

New calls will be added to this list whenever a client application creates a call with create(), or when an incoming call is detected by the back-end telephony services. The newCall() signal is emitted when either of these conditions occurs.

As calls change state, the statesChanged() signal is emitted, providing a list of all calls affected by the state change.

See also create(), newCall(), and statesChanged().

QPhoneCall QPhoneCallManager::create ( const QString & type )

Creates a call with the specified call type. If there is more than one service that supports the type, this method will choose the first that it finds. Returns a null QPhoneCall if no services support type.

The type is usually one of Voice, VoIP, Data, Fax, Video, etc. Use callTypes() to get a complete list of all call types that are supported by the system.

The new call will initially be in the Idle state, ready to dial. It will not appear in the calls() list until it is actually dialed.

See also callTypes().

QPhoneCall QPhoneCallManager::create ( const QString & type, const QString & service )

This is an overloaded member function, provided for convenience.

Create a call with the specified call type on service. Returns a null QPhoneCall if the combination of type and service is invalid.

The type is usually one of Voice, VoIP, Data, Fax, Video, etc. Use callTypes() to get a complete list of call types that are supported by the system.

The service is a telephony service name such as modem or voip. Use services() to get a complete list of service names that are supported by the system.

The new call will initially be in the "idle" state, ready to dial. It will not appear in the calls() list until it is actually dialed.

See also QTelephonyService, callTypes(), and services().

QPhoneCall QPhoneCallManager::fromModemIdentifier ( int id ) const

Returns the phone call associated with modem identifier id. Returns a null QPhoneCall object if there are no phone calls currently associated with that modem identifier.

This function is intended for use with GSM-style key sequences such as 1x SEND and 2x SEND, which affect a specific call.

See also QPhoneCall::modemIdentifier().

void QPhoneCallManager::newCall ( const QPhoneCall & call )   [signal]

Provides notification that a new call has been added to the calls() list. New calls are added to the call list whenever a client application creates a call with create(), or when an incoming call is detected by the back-end telephony services.

See also calls(), create(), and statesChanged().

QStringList QPhoneCallManager::services () const

Returns a list of all services that provide phone call functionality within the system. The returned list will contain strings such as modem, voip, etc, indicating the name of the associated telephony service.

See also QTelephonyService and callTypes().

QStringList QPhoneCallManager::services ( const QString & type ) const

This is an overloaded member function, provided for convenience.

Returns a list of all services that provide phone call functionality for calls of type within the system.

See also QTelephonyService and callTypes().

void QPhoneCallManager::statesChanged ( const QList<QPhoneCall> & calls )   [signal]

Signal that is emitted when the states within calls change at once during an atomic operation; e.g. swapping held and active calls. State changes that affect only a single call will also be reported via this signal.

This signal will be sent after the individual state changes have been reported via newCall() and QPhoneCall::connectStateChanged().

See also QPhoneCall::connectStateChanged() and newCall().


Copyright © 2009 Trolltech Trademarks
Qt Extended 4.4.3