examples/Telephony/ETel3rdPartyExample/AutoDTMFDialler/CHangup.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 "CHangup.h"
00017 
00024 CHangup* CHangup::NewL(MExecAsync* aController)
00025         {
00026         CHangup* self = new(ELeave) CHangup(aController);
00027         CleanupStack::PushL(self);
00028         self->ConstructL();
00029         CleanupStack::Pop(self);
00030         return self;
00031         }
00032 
00037 CHangup::~CHangup()
00038         {
00039         Cancel();
00040         }
00041 
00046 void CHangup::DoStartRequestL(CTelephony::TCallId aCallId)
00047         {
00048         // Hangs up a call.
00049         iTelephony->Hangup(iStatus, aCallId);
00050     SetActive();
00051         }
00052 
00057 CHangup::CHangup(MExecAsync* aController)
00058         : CISVAPIAsync(aController, KHangup)
00059         {
00060         // Empty method
00061         }
00062 
00066 void CHangup::ConstructL()
00067         {
00068         // Empty method
00069         }
00070 
00075 void CHangup::RunL()
00076         {
00077         if(iStatus != KErrNone)
00078                 {
00079                 iConsole->Printf(KError);
00080                 
00081                 // Print error status code
00082                 iConsole->Printf(_L("%d\n"), iStatus.Int());
00083                 }
00084         else
00085                 {
00086                 // Print output to console if there is no error
00087                 iConsole->Printf(_L("CLICK\n"));
00088                 ExampleComplete();
00089                 }
00090         }
00091 
00095 void CHangup::DoCancel()
00096         {
00097         // Cancels an outstanding asynchronous request.
00098         iTelephony->CancelAsync(CTelephony::EHangupCancel);
00099         }

Generated by  doxygen 1.6.2