examples/Telephony/ETel3rdPartyExample/IncomingCalls/CCallInfo.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 "CCallInfo.h"
00017 
00025 CCallInfo* CCallInfo::NewL(MExecAsync* aController)
00026         {
00027         CCallInfo* self = new(ELeave) CCallInfo(aController);
00028         CleanupStack::PushL(self);
00029         self->ConstructL();
00030         CleanupStack::Pop(self);
00031         return self;
00032         }
00033 
00038 CCallInfo::~CCallInfo()
00039         {
00040         Cancel();
00041         }
00042 
00047 void CCallInfo::DoStartRequestL()
00048         {
00049         CTelephony::TCallSelectionV1 callSelectionV1;
00050         CTelephony::TCallSelectionV1Pckg callSelectionV1Pckg( callSelectionV1 );
00051 
00052         callSelectionV1.iLine = CTelephony::EVoiceLine;
00053         callSelectionV1.iSelect = CTelephony::EInProgressCall;
00054         
00055         // Retrieves information about the call selected by the aCallSelect argument.
00056         iTelephony->GetCallInfo(callSelectionV1Pckg,
00057                                 iCallInfoV1Pckg,
00058                                 iRemoteInfoV1Pckg);
00059 
00060         switch(iCallInfoV1.iStatus)
00061                 {
00062         case CTelephony::EStatusRinging:
00063                 iConsole->Printf(_L("RING RING RING\n"));
00064                 break;
00065         case CTelephony::EStatusConnected:
00066                 iConsole->Printf(_L("Call Status: Connected\n"));
00067                 break;
00068         case CTelephony::EStatusConnecting:
00069                 iConsole->Printf(_L("Call Status: Connecting\n"));
00070                 break;
00071         case CTelephony::EStatusAnswering:
00072                 iConsole->Printf(_L("Call Status: Answering\n"));
00073                 break;
00074         case CTelephony::EStatusIdle:
00075                 iConsole->Printf(_L("Call Status: Idle\n"));
00076                 break;
00077         case CTelephony::EStatusDisconnecting:
00078                 iConsole->Printf(_L("Call Status: Disconnecting\n"));
00079                 break;
00080         default:
00081                 iConsole->Printf(_L("Call status: Changed\n"));
00082                 break;
00083                 }
00084         TDateTime time = iCallInfoV1.iStartTime;
00085         
00086         // Print the received call information
00087         iConsole->Printf(_L("Call recieved at %d:%d:%d\n"),
00088                              time.Hour(),
00089                              time.Minute(),
00090                              time.Second());
00091         iConsole->Printf(_L("on %d.%d.%d\n"),
00092                              time.Day(),
00093                              time.Month(),
00094                              time.Year());
00095 
00096         if (iRemoteInfoV1.iRemoteIdStatus == CTelephony::ERemoteIdentityAvailable)
00097                 {
00098                 iConsole->Printf(iRemoteInfoV1.iRemoteNumber.iTelNumber);
00099                 }
00100         else
00101                 {
00102                 iConsole->Printf(_L("Private Number Dialling\n"));
00103                 }
00104         ExampleComplete();
00105         }
00106 
00113 CCallInfo::CCallInfo(MExecAsync* aController)
00114         : CISVAPIAsync(aController, KCallInfo),
00115           iCallInfoV1Pckg(iCallInfoV1),
00116           iRemoteInfoV1Pckg(iRemoteInfoV1)
00117         {
00118         // Empty method
00119         }
00120 
00124 void CCallInfo::ConstructL()
00125         {
00126         // Empty method
00127         }
00128 
00132 void CCallInfo::RunL()
00133         {
00134         // Empty method
00135         }
00136 
00140 void CCallInfo::DoCancel()
00141         {
00142         // Empty method
00143         }

Generated by  doxygen 1.6.2