コード例 #1
0
ファイル: dialercontrol.cpp プロジェクト: muromec/qtopia-ezx
/*!
  Accepts an incoming call.  Has no effect if there is no incoming call.
*/
void DialerControl::accept()
{
    QList<QPhoneCall> incomingCalls = findCalls( QPhoneCall::Incoming );
    if( incomingCalls.count() )
    {
        QPhoneCall incoming = incomingCalls.first();
        if ( incoming.incoming() ) {
            //put active calls on hold
            if ( incoming.callType() == "Voice" ) {   // No tr
                // GSM calls will be put on hold automatically by the accept().
                // Other call types need to be put on hold explicitly.
                if( hasActiveCalls() ) {
                    if ( activeCalls().first().callType() == "Voice" ) {  // No tr
                        incoming.accept();
                    } else {
                        hold();
                        incoming.accept();
                    }
                } else {
                    incoming.accept();
                }
            } else {
                if( hasActiveCalls() )
                    hold();
                incoming.accept();
                incoming.activate();
            }
        }
    }
}
コード例 #2
0
ファイル: dialercontrol.cpp プロジェクト: muromec/qtopia-ezx
/*!
    Activate a specific call with the modem identifier \a id.
    This will typically only work with GSM calls that set the
    QPhoneCall::modemIdentifier() value.  It is used to implement
    the GSM \c{2x SEND} key sequence where \c{x} is the identifier.
*/
void DialerControl::activateCall( int id )
{
    QPhoneCall call = callManager().fromModemIdentifier(id);
    if ( !call.isNull() )
        call.activate(QPhoneCall::CallOnly);
}