examples/Telephony/ETel3rdPartyExample/OutgoingCalls/CCallWaitingStatus.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 "CCallWaitingStatus.h"
00018 
00026 CCallWaitingStatus* CCallWaitingStatus::NewL(MExecAsync* aController)
00027         {
00028         CCallWaitingStatus* self = new(ELeave) CCallWaitingStatus(aController);
00029         CleanupStack::PushL(self);
00030         self->ConstructL();
00031         CleanupStack::Pop(self);
00032         return self;
00033         }
00034 
00039 CCallWaitingStatus::~CCallWaitingStatus()
00040         {
00041         Cancel();
00042         }
00043 
00048 void CCallWaitingStatus::DoStartRequestL()
00049         {
00050         _LIT( KNotifyPanic, "CCallWaitingStatus Get Method" );
00051         __ASSERT_ALWAYS( !IsActive(), User::Panic( KNotifyPanic, 1 ));
00052         iRequestNotify = EFalse;
00053         
00054         // Interrogate the current status of the call waiting services
00055         iTelephony->GetCallWaitingStatus(iStatus, iCallWaitingStatusV1Pckg);
00056         SetActive();
00057         }
00058 
00065 CCallWaitingStatus::CCallWaitingStatus(MExecAsync* aController)
00066         : CISVAPIAsync(aController, KCallWaitingStatus),
00067           iCallWaitingStatusV1Pckg(iCallWaitingStatusV1)
00068         {
00069         // Empty method
00070         }
00071 
00075 void CCallWaitingStatus::ConstructL()
00076         {
00077         // Empty method
00078         }
00079 
00083 void CCallWaitingStatus::RunL()
00084         {
00085         if(iStatus != KErrNone)
00086                 {
00087                 iConsole->Printf(KError);
00088                 
00089                 // Print the error status code
00090                 iConsole->Printf(_L("%d\n"), iStatus.Int());
00091                 }
00092         else
00093                 {
00094                 // Print the console message if no error
00095                 iConsole->Printf(KCallWaitingStatusMsg);
00096                 switch(iCallWaitingStatusV1.iCallWaiting)
00097                         {
00098                 case CTelephony::EStatusActive:
00099                         ExampleComplete();
00100                         break;
00101                 case CTelephony::ENotActive:
00102                 case CTelephony::ENotProvisioned:
00103                 case CTelephony::ENotAvailable:
00104                 case CTelephony::EUnknown:
00105                         ExampleNotify();
00106                         break;
00107                         }
00108                 }
00109         }
00110 
00114 void CCallWaitingStatus::DoCancel()
00115         {
00116         // Cancels an outstanding asynchronous request.
00117         iTelephony->CancelAsync(CTelephony::EGetCallWaitingStatusCancel);
00118         }
00119 

Generated by  doxygen 1.6.2