uiservicetab/vimpstengine/tsrc/vimpstengine_ut/src/stubs/s_ximpidentity.cpp
changeset 0 5e5d6b214f4f
equal deleted inserted replaced
-1:000000000000 0:5e5d6b214f4f
       
     1 /*
       
     2 * Copyright (c) 2006, 2007 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:  Interface for identity object.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "s_ximpidentity.h"
       
    19 
       
    20 MyMXIMPIdentityStub::MyMXIMPIdentityStub()
       
    21 	{
       
    22 	}
       
    23 MyMXIMPIdentityStub::~MyMXIMPIdentityStub()
       
    24 	{
       
    25 	if(iIdentity)
       
    26 	    {
       
    27 	    delete iIdentity;
       
    28 	    }
       
    29 	}
       
    30 
       
    31 const TDesC16& MyMXIMPIdentityStub::Identity() const 
       
    32 	{
       
    33 	_LIT(Kidentity,"Identity");
       
    34     
       
    35 	return Kidentity;
       
    36 	}
       
    37 
       
    38 void MyMXIMPIdentityStub::SetIdentityL(
       
    39             const TDesC16& aIdentity ) 
       
    40 	{
       
    41 	if ( iIdentity )
       
    42 	    {
       
    43 	    iIdentity->ReAlloc( aIdentity.Length() ); 
       
    44 	    }
       
    45 	else
       
    46 	    {
       
    47 	    iIdentity = HBufC::NewL( aIdentity.Length() );
       
    48 	    }
       
    49 	
       
    50     iIdentity->Des().Copy( aIdentity );
       
    51 	
       
    52 	}
       
    53 
       
    54 
       
    55 const TAny* MyMXIMPIdentityStub::GetInterface(
       
    56                     TInt32 /*aInterfaceId*/,
       
    57                     TIfGetOps /*aOps*/ ) const
       
    58                     {
       
    59                     return this;
       
    60                     }
       
    61 
       
    62 TAny* MyMXIMPIdentityStub::GetInterface(
       
    63                     TInt32 /*aInterfaceId*/,
       
    64                     TIfGetOps /*aOps*/ )
       
    65 {
       
    66 return this;
       
    67 }
       
    68 
       
    69 TInt32 MyMXIMPIdentityStub::GetInterfaceId() const
       
    70 {
       
    71 return KErrNone;	
       
    72 }