examples/Telephony/ETel3rdPartyExample/IncomingCalls/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 
00017 #include "CHangup.h"
00018 
00026 CHangup* CHangup::NewL(MExecAsync* aController)
00027         {
00028         CHangup* self = new(ELeave) CHangup(aController);
00029         CleanupStack::PushL(self);
00030         self->ConstructL();
00031         CleanupStack::Pop(self);
00032         return self;
00033         }
00034 
00039 CHangup::~CHangup()
00040         {
00041         Cancel();
00042         }
00043 
00049 void CHangup::DoStartRequestL(CTelephony::TCallId aCallId)
00050         {
00051         // Hangs up a call
00052         iTelephony->Hangup(iStatus, aCallId);
00053     SetActive();
00054         }
00055 
00062 CHangup::CHangup(MExecAsync* aController)
00063         : CISVAPIAsync(aController, KHangup)
00064         {
00065         // Empty method
00066         }
00067 
00071 void CHangup::ConstructL()
00072         {
00073         // Empty method
00074         }
00075 
00080 void CHangup::RunL()
00081         {
00082         if(iStatus != KErrNone)
00083                 {
00084                 iConsole->Printf(KError);
00085                 
00086                 // Print the error status code
00087                 iConsole->Printf(_L("%d\n"), iStatus.Int());
00088                 }
00089         else
00090                 {
00091                 // Print the consoel output message if there is no error
00092                 iConsole->Printf(_L("CLICK\n"));
00093                 }
00094         }
00095         
00099 void CHangup::DoCancel()
00100         {
00101         // Cancels an outstanding asynchronous request.
00102         iTelephony->CancelAsync(CTelephony::EHangupCancel);
00103         }

Generated by  doxygen 1.6.2