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 00025 CHangup* CHangup::NewL(MExecAsync* aController) 00026 { 00027 CHangup* self = new(ELeave) CHangup(aController); 00028 CleanupStack::PushL(self); 00029 self->ConstructL(); 00030 CleanupStack::Pop(self); 00031 return self; 00032 } 00033 00038 CHangup::~CHangup() 00039 { 00040 Cancel(); 00041 } 00042 00048 void CHangup::DoStartRequestL(CTelephony::TCallId aCallId) 00049 { 00050 // Hangs up a call. 00051 iTelephony->Hangup(iStatus, aCallId); 00052 SetActive(); 00053 } 00054 00061 CHangup::CHangup(MExecAsync* aController) 00062 : CISVAPIAsync(aController, KHangup) 00063 { 00064 // Empty method 00065 } 00066 00070 void CHangup::ConstructL() 00071 { 00072 // Empty method 00073 } 00074 00079 void CHangup::RunL() 00080 { 00081 if(iStatus != KErrNone) 00082 { 00083 iConsole->Printf(KError); 00084 00085 // Print the error status code 00086 iConsole->Printf(_L("%d\n"), iStatus.Int()); 00087 } 00088 else 00089 { 00090 // Print the console output if there is no error 00091 iConsole->Printf(_L("CLICK\n")); 00092 ExampleComplete(); 00093 } 00094 } 00095 00099 void CHangup::DoCancel() 00100 { 00101 // Cancels an outstanding asynchronous request 00102 iTelephony->CancelAsync(CTelephony::EHangupCancel); 00103 } 00104
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.