cbsref/telephonyrefplugins/atltsy/atcommand/callcontrol/src/athangupcommandrecords.cpp
branchRCL_3
changeset 65 630d2f34d719
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
       
     1 // Copyright (c) 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 // Record the infomation related to hangup commands
       
    15 
       
    16 //system include
       
    17 
       
    18 //user include
       
    19 #include "athangupcommandrecords.h"
       
    20 #include "mslogger.h"
       
    21 
       
    22 TATHanupCommandInfo::TATHanupCommandInfo()
       
    23 	{
       
    24 	LOGTEXT( _L8("[Ltsy CallControl]  Starting TATHanupCommandInfo::TATHanupCommandInfo()"));	
       
    25 	iCallId = -1;
       
    26 	iHangupCause = -1;
       
    27 	}
       
    28 
       
    29 /**
       
    30  * 
       
    31  *
       
    32  */
       
    33 CATHangupCommandRecords* CATHangupCommandRecords::NewL()
       
    34 	{
       
    35 	LOGTEXT( _L8("[Ltsy CallControl]  Starting CATHangupCommandRecords::NewL()"));
       
    36 	CATHangupCommandRecords* self = CATHangupCommandRecords::NewLC();
       
    37 	CleanupStack::Pop(self);
       
    38 	return self;
       
    39 	}
       
    40 
       
    41 CATHangupCommandRecords* CATHangupCommandRecords::NewLC()
       
    42 	{
       
    43 	LOGTEXT( _L8("[Ltsy CallControl]  Starting CATHangupCommandRecords::NewLC()"));
       
    44 	CATHangupCommandRecords* self = new (ELeave) CATHangupCommandRecords;
       
    45 	CleanupStack::PushL(self);
       
    46 	self->ConstructL();
       
    47 	return self;
       
    48 	}
       
    49 
       
    50 CATHangupCommandRecords::~CATHangupCommandRecords()
       
    51 	{
       
    52 	LOGTEXT( _L8("[Ltsy CallControl]  Starting CATHangupCommandRecords::~CATHangupCommandRecords()"));
       
    53 	iHangupInfoArray.Close();
       
    54 	}
       
    55 
       
    56 CATHangupCommandRecords::CATHangupCommandRecords()
       
    57 	{
       
    58 	LOGTEXT( _L8("[Ltsy CallControl]  Starting CATHangupCommandRecords::CATHangupCommandRecords()"));
       
    59 	iHangupActive = EFalse;
       
    60 	}
       
    61 
       
    62 void CATHangupCommandRecords::ConstructL()
       
    63 	{
       
    64 	LOGTEXT( _L8("[Ltsy CallControl]  Starting CATHangupCommandRecords::ConstructL()"));
       
    65 	}
       
    66 
       
    67 TInt CATHangupCommandRecords::AddHangupCommandInfo(TInt aCallId, TInt aHangupCase)
       
    68 	{
       
    69 	LOGTEXT( _L8("[Ltsy CallControl]  Starting CATHangupCommandRecords::AddHangupCommandInfo()"));
       
    70 	TATHanupCommandInfo tInfo;
       
    71 	tInfo.iCallId = aCallId;
       
    72 	tInfo.iHangupCause = aHangupCase;
       
    73 	TInt nRes = iHangupInfoArray.Append(tInfo);
       
    74 	return nRes;
       
    75 	}
       
    76 
       
    77 TInt CATHangupCommandRecords::GetFirstHangupCommandInfoAndRemoveIt(TATHanupCommandInfo& aInfo)
       
    78 	{
       
    79 	LOGTEXT( _L8("[Ltsy CallControl]  Starting CATHangupCommandRecords::GetFirstHangupCommandInfoAndRemoveIt()"));
       
    80 	TInt nCount = iHangupInfoArray.Count();
       
    81 	LOGTEXT2( _L8("[Ltsy CallControl] Hang up command information array count = %d"), nCount);
       
    82 	
       
    83 	if (nCount > 0)
       
    84 		{
       
    85 		aInfo.iCallId = iHangupInfoArray[0].iCallId;
       
    86 		aInfo.iHangupCause = iHangupInfoArray[0].iHangupCause;
       
    87 		iHangupInfoArray.Remove(0);
       
    88 		return KErrNone;
       
    89 		}
       
    90 	return KErrNotFound;
       
    91 	}
       
    92 
       
    93 void CATHangupCommandRecords::SetHangupActiveFlag(TBool aIsActive)
       
    94 	{
       
    95 	LOGTEXT( _L8("[Ltsy CallControl]  Starting CATHangupCommandRecords::SetHangupActiveFlag()"));
       
    96 	iHangupActive = aIsActive;
       
    97 	}
       
    98 
       
    99 TBool CATHangupCommandRecords::GetHangupActiveFlag() const
       
   100 	{
       
   101 	LOGTEXT( _L8("[Ltsy CallControl]  Starting CATHangupCommandRecords::GetHangupActiveFlag()"));
       
   102 	return iHangupActive;
       
   103 	}
       
   104 
       
   105 
       
   106 TBool CATHangupCommandRecords::IsHaveRecords() const
       
   107 	{
       
   108 	if (iHangupInfoArray.Count() > 0)
       
   109 		{
       
   110 		return ETrue;
       
   111 		}
       
   112 	else
       
   113 		{
       
   114 		return EFalse;
       
   115 		}
       
   116 	}
       
   117 
       
   118 //End of file