phoneengine/engineinfo/src/cpeclientinformationimpl.cpp
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2008-2008 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Phone client information for a single call
       
    15 *
       
    16 */
       
    17 
       
    18 #include <talogger.h>
       
    19 #include "cpeclientinformationimpl.h"
       
    20 
       
    21 // ---------------------------------------------------------------------------
       
    22 // Two-phased constructor.
       
    23 // ---------------------------------------------------------------------------
       
    24 //
       
    25 CPEClientInformationImpl* CPEClientInformationImpl::NewL()
       
    26     {
       
    27     CPEClientInformationImpl* self = new ( ELeave ) CPEClientInformationImpl;
       
    28     CleanupStack::PushL( self );
       
    29     self->ConstructL();
       
    30     CleanupStack::Pop( self );
       
    31     return self;
       
    32     }
       
    33 
       
    34 // ---------------------------------------------------------------------------
       
    35 // Constructor.
       
    36 // ---------------------------------------------------------------------------
       
    37 //
       
    38 CPEClientInformationImpl::CPEClientInformationImpl()
       
    39     {
       
    40     Reset();
       
    41     }
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // Second-phase constructor.
       
    45 // ---------------------------------------------------------------------------
       
    46 //
       
    47 void CPEClientInformationImpl::ConstructL()
       
    48     {
       
    49     }
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // Destructor.
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 CPEClientInformationImpl::~CPEClientInformationImpl()
       
    56     {
       
    57     iContactLink.Close();
       
    58     }
       
    59 
       
    60 // ---------------------------------------------------------------------------
       
    61 // Resets the state of this client information.
       
    62 // ---------------------------------------------------------------------------
       
    63 //
       
    64 void CPEClientInformationImpl::Reset()
       
    65     {
       
    66     TEFLOGSTRING( KTAINT,"PE CPEClientInformationImpl::Reset" );
       
    67     iContactLink.Close();
       
    68     iName = KNullDesC;
       
    69     iNumber = KNullDesC;
       
    70     iCallType = EPECallTypeUninitialized;
       
    71     iAllowMatch = ETrue;    
       
    72     iShowNumber = EFalse;
       
    73     iEndOtherCalls = EFalse;    
       
    74     }
       
    75 
       
    76 // ---------------------------------------------------------------------------
       
    77 // From class MPEClientInformation.
       
    78 // ---------------------------------------------------------------------------
       
    79 //
       
    80 void CPEClientInformationImpl::Set( const MPEClientInformation& aSource )
       
    81     {
       
    82     SetContactLink( aSource.ContactLink() );
       
    83     iName = aSource.Name();
       
    84     iNumber = aSource.Number();
       
    85     iCallType = aSource.CallType();
       
    86     iAllowMatch = aSource.AllowMatch();
       
    87     TEFLOGSTRING2( KTAINT,"PE CPEClientInformationImpl::Set, iAllowMatch: %d", iAllowMatch );    
       
    88     iShowNumber = aSource.ShowNumber();
       
    89     TEFLOGSTRING2( KTAINT,"PE CPEClientInformationImpl::Set, iShowNumber: %d", iShowNumber );
       
    90     iEndOtherCalls = aSource.EndOtherCalls();
       
    91     TEFLOGSTRING2( KTAINT,"PE CPEClientInformationImpl::Set, iEndOtherCalls: %d", iEndOtherCalls );    
       
    92     }
       
    93 
       
    94 // ---------------------------------------------------------------------------
       
    95 // From class MPEClientInformation.
       
    96 // ---------------------------------------------------------------------------
       
    97 //
       
    98 void CPEClientInformationImpl::SetContactLink( const TDesC8& aLink )
       
    99     {
       
   100     iContactLink.Close();
       
   101     HBufC8* contactLink = aLink.Alloc(); // No leaving allowed here due to emergency call cases.
       
   102     if ( contactLink )
       
   103         {
       
   104         iContactLink.Assign( contactLink );
       
   105         }
       
   106     }
       
   107 
       
   108 // ---------------------------------------------------------------------------
       
   109 // From class MPEClientInformation.
       
   110 // ---------------------------------------------------------------------------
       
   111 //
       
   112 const TDesC8& CPEClientInformationImpl::ContactLink() const
       
   113     {
       
   114     return iContactLink;
       
   115     }
       
   116 
       
   117 // ---------------------------------------------------------------------------
       
   118 // From class MPEClientInformation.
       
   119 // ---------------------------------------------------------------------------
       
   120 //
       
   121 void CPEClientInformationImpl::SetName( const TName& aName )
       
   122     {
       
   123     iName = aName;
       
   124     }
       
   125 
       
   126 // ---------------------------------------------------------------------------
       
   127 // From class MPEClientInformation.
       
   128 // ---------------------------------------------------------------------------
       
   129 //
       
   130 const TName& CPEClientInformationImpl::Name() const
       
   131     {
       
   132     return iName;
       
   133     }
       
   134 
       
   135 // ---------------------------------------------------------------------------
       
   136 // From class MPEClientInformation.
       
   137 // ---------------------------------------------------------------------------
       
   138 //
       
   139 void CPEClientInformationImpl::SetNumber( const TPEPhoneNumber& aNumber )
       
   140     {
       
   141     iNumber = aNumber;
       
   142     }
       
   143 
       
   144 // ---------------------------------------------------------------------------
       
   145 // From class MPEClientInformation.
       
   146 // ---------------------------------------------------------------------------
       
   147 //
       
   148 const TPEPhoneNumber& CPEClientInformationImpl::Number() const
       
   149     {
       
   150     return iNumber;
       
   151     }
       
   152 
       
   153 // ---------------------------------------------------------------------------
       
   154 // From class MPEClientInformation.
       
   155 // ---------------------------------------------------------------------------
       
   156 //
       
   157 void CPEClientInformationImpl::SetCallType( TPECallType aType )
       
   158     {
       
   159     iCallType = aType;
       
   160     }
       
   161 
       
   162 // ---------------------------------------------------------------------------
       
   163 // From class MPEClientInformation.
       
   164 // ---------------------------------------------------------------------------
       
   165 //
       
   166 TPECallType CPEClientInformationImpl::CallType() const
       
   167     {
       
   168     return iCallType;
       
   169     }
       
   170 
       
   171 // ---------------------------------------------------------------------------
       
   172 // From class MPEClientInformation.
       
   173 // ---------------------------------------------------------------------------
       
   174 //
       
   175 void CPEClientInformationImpl::SetAllowMatch( TBool aAllow )
       
   176     {
       
   177     iAllowMatch = aAllow;
       
   178     TEFLOGSTRING2( KTAINT,
       
   179         "PE CPEClientInformationImpl::SetAllowMatch, iAllowMatch: %d", iAllowMatch );
       
   180     }
       
   181 
       
   182 // ---------------------------------------------------------------------------
       
   183 // From class MPEClientInformation.
       
   184 // ---------------------------------------------------------------------------
       
   185 //
       
   186 TBool CPEClientInformationImpl::AllowMatch() const
       
   187     {
       
   188     TEFLOGSTRING2( KTAINT,
       
   189         "PE CPEClientInformationImpl::AllowMatch, iAllowMatch: %d", iAllowMatch );
       
   190     return iAllowMatch;
       
   191     }
       
   192 
       
   193 // ---------------------------------------------------------------------------
       
   194 // From class MPEClientInformation.
       
   195 // ---------------------------------------------------------------------------
       
   196 //
       
   197 void CPEClientInformationImpl::SetShowNumber( TBool aShow )
       
   198     {
       
   199     iShowNumber = aShow;
       
   200     }
       
   201 
       
   202 // ---------------------------------------------------------------------------
       
   203 // From class MPEClientInformation.
       
   204 // ---------------------------------------------------------------------------
       
   205 //
       
   206 TBool CPEClientInformationImpl::ShowNumber() const
       
   207     {
       
   208     return iShowNumber;
       
   209     }
       
   210 
       
   211 // ---------------------------------------------------------------------------
       
   212 // From class MPEClientInformation.
       
   213 // ---------------------------------------------------------------------------
       
   214 //
       
   215 void CPEClientInformationImpl::SetEndOtherCalls( TBool aEndOtherCalls )
       
   216     {
       
   217     iEndOtherCalls = aEndOtherCalls;
       
   218     TEFLOGSTRING2( KTAINT,
       
   219         "PE CPEClientInformationImpl::SetEndOtherCalls, iEndOtherCalls: %d", 
       
   220         iEndOtherCalls );
       
   221     }
       
   222 
       
   223 // ---------------------------------------------------------------------------
       
   224 // From class MPEClientInformation.
       
   225 // ---------------------------------------------------------------------------
       
   226 //
       
   227 TBool CPEClientInformationImpl::EndOtherCalls() const
       
   228     {
       
   229     TEFLOGSTRING2( KTAINT,
       
   230         "PE CPEClientInformationImpl::EndOtherCalls, iEndOtherCalls: %d", 
       
   231         iEndOtherCalls );
       
   232     return iEndOtherCalls;
       
   233     }