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

Generated by  doxygen 1.6.2