mmsharing/mmshavailability/tsrc/ut_availability/Stubs/src/sipprofile.cpp
changeset 15 ccd8e69b5392
parent 2 b31261fd4e04
child 20 e8be2c2e049d
child 22 496ad160a278
equal deleted inserted replaced
2:b31261fd4e04 15:ccd8e69b5392
     1 /*
       
     2 * Copyright (c) 2002 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:  implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //  INCLUDE FILES
       
    20 
       
    21 #include "sipprofile.h"
       
    22 #include "CSipSseTestTls.h"
       
    23 #include "musunittesting.h"
       
    24 //#include "sipmanagedprofile.h"
       
    25 #include "sipprofileregistry.h"
       
    26 //#include "sipconcreteprofile.h"
       
    27 #include "SIPProfileTypeInfo.h"
       
    28 
       
    29 _LIT8(KSIPProfileDefAOR, "user@aa");
       
    30 
       
    31 
       
    32 // ============================ MEMBER FUNCTIONS ===============================
       
    33 
       
    34 
       
    35 // -----------------------------------------------------------------------------
       
    36 // CSIPProfile::NewL
       
    37 // Two-phased constructor.
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 CSIPProfile* CSIPProfile::NewL(CSIPProfileRegistry* aSIPRegistry)
       
    41 	{
       
    42     CSIPProfile* self = CSIPProfile::NewLC (aSIPRegistry);
       
    43     CleanupStack::Pop();
       
    44     return self;
       
    45 	}
       
    46 
       
    47 // -----------------------------------------------------------------------------
       
    48 // CSIPProfile::NewLC
       
    49 // Two-phased constructor.
       
    50 // -----------------------------------------------------------------------------
       
    51 //
       
    52 CSIPProfile* CSIPProfile::NewLC(CSIPProfileRegistry* aSIPRegistry)
       
    53 	{
       
    54 	CSIPProfile* self = new(ELeave)CSIPProfile(aSIPRegistry);
       
    55     CleanupStack::PushL (self);
       
    56     self->ConstructL ();
       
    57     return self;
       
    58 	}
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // CSIPProfile::~CSIPProfile
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 EXPORT_C CSIPProfile::~CSIPProfile()
       
    65 	{
       
    66 	delete iArray;
       
    67 	}
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CSIPProfile::GetParameter
       
    71 // -----------------------------------------------------------------------------
       
    72 //	
       
    73 EXPORT_C TInt CSIPProfile::GetParameter(TUint32 /*aParam*/, TDesC8 const *& aVal ) const
       
    74 	{
       
    75 	const TDesC8& val= KSIPProfileDefAOR;
       
    76     aVal = &val;
       
    77 	return iError;
       
    78 	}	
       
    79 
       
    80 // -----------------------------------------------------------------------------
       
    81 // CSIPProfile::GetParameter
       
    82 // -----------------------------------------------------------------------------
       
    83 //	
       
    84 EXPORT_C TInt CSIPProfile::GetParameter(TUint32 /*aParam*/, TUint32& aVal) const
       
    85 	{
       
    86 	aVal = 1;
       
    87 	   
       
    88     CSipSseTestTls* tls = CSipSseTestTls::Storage();
       
    89     if ( tls )
       
    90         {
       
    91         return tls->Error();
       
    92         }
       
    93     else
       
    94         {
       
    95        	return iError; 
       
    96         }
       
    97 	}	
       
    98 
       
    99 // -----------------------------------------------------------------------------
       
   100 // CSIPProfile::GetParameter
       
   101 // -----------------------------------------------------------------------------
       
   102 //	
       
   103 EXPORT_C TInt CSIPProfile::GetParameter(TUint32 /*aParam*/, TBool& aVal) const
       
   104 	{
       
   105 	aVal = iRegistered;
       
   106 	return iError;
       
   107 	}
       
   108 
       
   109 // -----------------------------------------------------------------------------
       
   110 // CSIPProfile::GetParameter
       
   111 // -----------------------------------------------------------------------------
       
   112 //	
       
   113 EXPORT_C TInt CSIPProfile::GetParameter(TUint32 /*aParam*/, 
       
   114 	MDesC8Array const *& aVal) const
       
   115 	{
       
   116 	if ( !iError )
       
   117 	    {
       
   118 	    aVal = iArray;
       
   119 	    }
       
   120 	return iError;
       
   121 	}
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 // CSIPProfile::Type
       
   125 // -----------------------------------------------------------------------------
       
   126 //	
       
   127 EXPORT_C const TSIPProfileTypeInfo& CSIPProfile::Type() const
       
   128 	{
       
   129 	return iSIPProfileType;
       
   130 	}	
       
   131 	
       
   132 // -----------------------------------------------------------------------------
       
   133 // CSIPProfile::CSIPProfile
       
   134 // -----------------------------------------------------------------------------
       
   135 //	
       
   136 CSIPProfile::CSIPProfile(CSIPProfileRegistryBase* aRegistry):
       
   137 	iSIPProfileRegistry(aRegistry), iEnabled(EFalse), iRegistered( ETrue ), iError(0)
       
   138 	{
       
   139 	}
       
   140 
       
   141 // -----------------------------------------------------------------------------
       
   142 // CSIPProfile::ConstructL
       
   143 // -----------------------------------------------------------------------------
       
   144 //	
       
   145 void CSIPProfile::ConstructL()
       
   146 	{
       
   147     CDesC8Array* array = new( ELeave ) CDesC8ArrayFlat( 5 );
       
   148     CleanupStack::PushL( array );
       
   149 	array->AppendL( _L8( "sip:user@domain.com" ) );
       
   150 	array->AppendL( _L8( "sip:user2@domain.com" ) ); 
       
   151 	CleanupStack::Pop( array );
       
   152 	iArray = array;    
       
   153 	}
       
   154 
       
   155 // -----------------------------------------------------------------------------
       
   156 // CSIPProfile::IsContextActive
       
   157 // -----------------------------------------------------------------------------
       
   158 //	
       
   159 TBool CSIPProfile::IsContextActive() const
       
   160 	{
       
   161 	return ETrue;
       
   162 	}
       
   163 	
       
   164 // -----------------------------------------------------------------------------
       
   165 // CSIPProfile::ContextId
       
   166 // -----------------------------------------------------------------------------
       
   167 //	
       
   168 TUint32 CSIPProfile::ContextId() const
       
   169 	{
       
   170 	return 1;
       
   171 	}
       
   172