telephonyutils/etel3rdpartyapi/ExampleApps/OutgoingCalls/CDynamicCaps.cpp
changeset 0 3553901f7fa8
child 24 6638e7f4bd8f
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #include "CDynamicCaps.h"
       
    17 
       
    18 /**
       
    19 Factory constructor.
       
    20 @param aController Pointer to MExecAsync object
       
    21 passed to constructor of CISVAPIBase
       
    22 @param aCallId Identifies the call whose capabilities will be interrogated
       
    23 @return Instance of CDynamicCaps class
       
    24 */
       
    25 CDynamicCaps* CDynamicCaps::NewL(MExecAsync* aController, CTelephony::TCallId aCallId)
       
    26 	{
       
    27 	CDynamicCaps* self = new(ELeave) CDynamicCaps(aController, aCallId);
       
    28 	CleanupStack::PushL(self);
       
    29 	self->ConstructL();
       
    30 	CleanupStack::Pop(self);
       
    31 	return self;
       
    32 	}
       
    33 
       
    34 /**
       
    35 Destructor.
       
    36 Cancels outstanding requests
       
    37 */
       
    38 CDynamicCaps::~CDynamicCaps()
       
    39 	{
       
    40 	Cancel();
       
    41 	}
       
    42 
       
    43 /**
       
    44 Gets the dynamic call capabilities of the call identified by iCallId
       
    45 and stores the results in the iCallCapsV1Pckg package.
       
    46 */
       
    47 void CDynamicCaps::StartRequestL()
       
    48 	{
       
    49 	_LIT(KDummyAnswerPanic, "CDynamicCaps Get Method");
       
    50 	__ASSERT_ALWAYS(!IsActive(), User::Panic(KDummyAnswerPanic, 1));
       
    51 	iRequestNotify = EFalse;
       
    52 	iTelephony->GetCallDynamicCaps(iCallId, iCallCapsV1Pckg);
       
    53 	if( iCallCapsV1.iControlCaps & CTelephony::KCapsHold )
       
    54 		{
       
    55 		gConsole->Printf(_L("Call can be put on hold\n"));
       
    56 		ExampleNotify();
       
    57 		}
       
    58 	else
       
    59 		{
       
    60 		gConsole->Printf(_L("Call cannot be put on hold\n"));
       
    61 		// TODO Code in CDynamicCaps::StartRequestL() needs to be finished
       
    62 		//
       
    63 		// do some thing!
       
    64 		//
       
    65 		}
       
    66 	}
       
    67 
       
    68 /**
       
    69 Constructor.
       
    70 @param aController Pointer to an MExecAsync object passed to
       
    71 constructor of CISVAPIBase
       
    72 @param aCallId Identifies the call whose capabilities will be interrogated
       
    73 */
       
    74 CDynamicCaps::CDynamicCaps(MExecAsync* aController, CTelephony::TCallId aCallId)
       
    75 	: CISVAPIAsync(aController)
       
    76 	, iCallCapsV1Pckg(iCallCapsV1)
       
    77 	, iCallId(aCallId)
       
    78 	{
       
    79 	iExtensionId = KDynamicCaps;
       
    80 	}
       
    81 
       
    82 /**
       
    83 Second phase constructor.
       
    84 */
       
    85 void CDynamicCaps::ConstructL()
       
    86 	{
       
    87  	CActiveScheduler::Add(this);
       
    88 	}
       
    89 
       
    90 /**
       
    91 TODO Code in CDynamicCaps::RunL() needs to be written, empty method at present
       
    92 */
       
    93 void CDynamicCaps::RunL()
       
    94 	{
       
    95 
       
    96 	}
       
    97 
       
    98 /**
       
    99 TODO Code in CDynamicCaps::DoCancel() needs to be written, empty method at present
       
   100 */
       
   101 void CDynamicCaps::DoCancel()
       
   102 	{
       
   103 
       
   104 	}
       
   105