examples/Telephony/ETel3rdPartyExample/OutgoingCalls/CResume.cpp

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 
00017 #include "CResume.h"
00018 
00026 CResume* CResume::NewL(MExecAsync* aController)
00027         {
00028         CResume* self = new(ELeave) CResume(aController);
00029         CleanupStack::PushL(self);
00030         self->ConstructL();
00031         CleanupStack::Pop(self);
00032         return self;
00033         }
00034 
00039 CResume::~CResume()
00040         {
00041         Cancel();
00042         }
00043 
00049 void CResume::DoStartRequestL(CTelephony::TCallId aCallId)
00050         {
00051         _LIT(KDummyAnswerPanic, "CResume Get Method");
00052         __ASSERT_ALWAYS(!IsActive(), User::Panic(KDummyAnswerPanic, 1));
00053    iRequestNotify = EFalse;
00054         CTelephony::TCallCapsV1 callCapsV1;
00055    CTelephony::TCallCapsV1Pckg callCapsV1Pckg(callCapsV1);
00056    
00057    // Retrieves the dynamic call capabilities for calls you dialled or answered with CTelephony.
00058    iTelephony->GetCallDynamicCaps(aCallId, callCapsV1Pckg);
00059 
00060    if( callCapsV1.iControlCaps & CTelephony::KCapsResume )
00061       {
00062       // The call represented by aCallId can be resumed.
00063       iTelephony->Resume(iStatus, aCallId);
00064       SetActive();
00065       }
00066    else
00067       {
00068       // The call cannot be resumed.
00069       }
00070         }
00071 
00078 CResume::CResume(MExecAsync* aController)
00079         : CISVAPIAsync(aController, KResume)
00080         {
00081         // Empty method
00082         }
00083 
00087 void CResume::ConstructL()
00088         {
00089         // Empty method
00090         }
00091 
00096 void CResume::RunL()
00097         {
00098         if(iStatus != KErrNone)
00099                 {
00100                 iConsole->Printf(KError);
00101                 
00102                 // Print the output to console if there is no error
00103                 iConsole->Printf(_L("%d\n"), iStatus.Int());
00104                 }
00105         else
00106                 {
00107                 ExampleComplete();
00108                 }
00109         }
00110 
00114 void CResume::DoCancel()
00115         {
00116         // Cancels an outstanding asynchronous request.
00117         iTelephony->CancelAsync(CTelephony::EResumeCancel);
00118         }
00119 

Generated by  doxygen 1.6.2