00001 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). 00002 // All rights reserved. 00003 // This component and the accompanying materials are made available 00004 // under the terms of "Eclipse Public License v1.0" 00005 // which accompanies this distribution, and is available 00006 // at the URL "http://www.eclipse.org/legal/epl-v10.html". 00007 // 00008 // Initial Contributors: 00009 // Nokia Corporation - initial contribution. 00010 // 00011 // Contributors: 00012 // 00013 // Description: 00014 // 00015 00016 #include "CDialCall.h" 00017 00025 CDialCall* CDialCall::NewL(MExecAsync* aController) 00026 { 00027 CDialCall* self = new(ELeave) CDialCall(aController); 00028 CleanupStack::PushL(self); 00029 self->ConstructL(); 00030 CleanupStack::Pop(self); 00031 return self; 00032 } 00033 00037 CDialCall::~CDialCall() 00038 { 00039 Cancel(); 00040 } 00041 00047 void CDialCall::DoStartRequestL(const TDesC& aNumber) 00048 { 00049 CTelephony::TCallParamsV1 callParams; 00050 callParams.iIdRestrict = CTelephony::ESendMyId; 00051 CTelephony::TCallParamsV1Pckg callParamsPckg(callParams); 00052 00053 iConsole->Printf(_L("Dialling ")); 00054 00055 // Print the number to dial 00056 iConsole->Printf(aNumber); 00057 iConsole->Printf(KNewLine); 00058 00059 // Dial a new call to specified phone number 00060 iTelephony->DialNewCall(iStatus, callParamsPckg, aNumber, iCallId); 00061 SetActive(); 00062 } 00063 00069 CDialCall::CDialCall(MExecAsync* aController) 00070 : CISVAPIAsync(aController, KDialCall) 00071 { 00072 // Empty method 00073 } 00074 00078 void CDialCall::ConstructL() 00079 { 00080 // Empty method 00081 } 00082 00087 void CDialCall::RunL() 00088 { 00089 if(iStatus != KErrNone) 00090 { 00091 // Return error 00092 iConsole->Printf(KError); 00093 00094 // Print error status code 00095 iConsole->Printf(_L("%d\n"), iStatus.Int()); 00096 } 00097 else 00098 { 00099 // Print 'Dialling' if there is no error 00100 iConsole->Printf(_L("Dialling...\n")); 00101 ExampleComplete(); 00102 } 00103 } 00104 00108 void CDialCall::DoCancel() 00109 { 00110 // Cancels an outstanding asynchronous request. 00111 iTelephony->CancelAsync(CTelephony::EDialNewCallCancel); 00112 }
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.