sipplugins/sippsipsettingsui/tsrc/UT_sipsettingsui/src/teststubs.cpp
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 /*
       
     2 * Copyright (c) 2006 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:  
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "teststubs.h"
       
    20 #include "sipprofilestub.h"
       
    21 #include <sipmanagedprofile.h>
       
    22 #include <SIPProfileRegistryObserver.h>
       
    23 #include <sipprofileregistry.h>
       
    24 #include <sipprofileregistrybase.h>
       
    25 #include <SIPManagedProfileRegistry.h>
       
    26 #include <sipconcreteprofile.h>
       
    27 #include <sipprofiletypeinfo.h>
       
    28 #include <sipstrings.h>
       
    29 
       
    30 // -----------------------------------------------------------------------------
       
    31 // CSIPProfileRegistryObserver
       
    32 // -----------------------------------------------------------------------------
       
    33 //	
       
    34 void CSIPProfileRegistryObserver::ProfileRegistryEventOccurred
       
    35 		(TUint32 /*aProfileId*/, TEvent /*aEvent*/)
       
    36 	{
       
    37 		
       
    38 	}
       
    39 
       
    40 void CSIPProfileRegistryObserver::ProfileRegistryErrorOccurred
       
    41 		(TUint32 /*aProfileId*/, TInt /*aError*/)
       
    42 	{
       
    43 		
       
    44 	}
       
    45 
       
    46 // -----------------------------------------------------------------------------
       
    47 // CSIPManagedProfile
       
    48 // -----------------------------------------------------------------------------
       
    49 //	
       
    50 
       
    51 CSIPManagedProfile* CSIPManagedProfile::NewL
       
    52 		(CSIPManagedProfileRegistry* aSIPRegistry)
       
    53 	{
       
    54     CSIPManagedProfile* self = CSIPManagedProfile::NewLC (aSIPRegistry);
       
    55     CleanupStack::Pop(self);
       
    56     return self;
       
    57 	}
       
    58 
       
    59 CSIPManagedProfile* CSIPManagedProfile::NewLC
       
    60 		(CSIPManagedProfileRegistry* aSIPRegistry)
       
    61 	{
       
    62 	CSIPManagedProfile* self = new(ELeave)CSIPManagedProfile(aSIPRegistry);
       
    63     CleanupStack::PushL (self);
       
    64     self->ConstructL ();
       
    65     return self;
       
    66 	}
       
    67 
       
    68 CSIPManagedProfile::~CSIPManagedProfile()
       
    69 	{
       
    70 	}
       
    71 	
       
    72 CSIPManagedProfile::CSIPManagedProfile(CSIPManagedProfileRegistry* aSIPRegistry):
       
    73 	CSIPProfile(aSIPRegistry)
       
    74 	{
       
    75 	}
       
    76 	
       
    77 // -----------------------------------------------------------------------------
       
    78 // CSIPManagedProfile::SetParameterL
       
    79 // -----------------------------------------------------------------------------
       
    80 //	
       
    81 void CSIPManagedProfile::SetParameterL(TUint32 aParam, const TDesC8& aVal)
       
    82 	{
       
    83 	switch (aParam)
       
    84 		{
       
    85 		case KSIPProviderName:
       
    86 			iProviderNameValue=aVal;
       
    87 			break;
       
    88 		case KSIPUserAor:
       
    89 			iUserAorValue=aVal;
       
    90 			break;
       
    91 		case KSIPPrivateIdentity:
       
    92 		case KSIPProfileId:
       
    93 		case KSIPAccessPointId:
       
    94 		case KSIPSigComp:
       
    95 		case KSIPSecurityNegotiation:
       
    96 		case KSIPAutoRegistration:
       
    97 		case KSIPProfileRegistered:
       
    98 		case KSIPRegisteredAors:
       
    99 		case KSIPNegotiatedSecurityMechanism:
       
   100 		case KSIPDefaultProfile:
       
   101 		case KSIPContactHeaderParams:
       
   102 		case KSIPRegistrar:
       
   103 		case KSIPOutboundProxy:
       
   104 		case KSIPDigestUserName:
       
   105 		case KSIPDigestRealm:
       
   106 		case KSIPServerAddress:
       
   107 		case KSIPDigestPassword:
       
   108 		case KSIPHeaders:
       
   109 		case KSIPSoIpTOS:
       
   110 			User::Leave(KErrNotFound);
       
   111 		case KSIPContactHeaderUser:
       
   112 		    User::Leave(KErrAccessDenied);
       
   113 		default:
       
   114 			break;
       
   115 		}
       
   116 	}
       
   117 
       
   118 // -----------------------------------------------------------------------------
       
   119 // CSIPManagedProfile::SetParameterL
       
   120 // -----------------------------------------------------------------------------
       
   121 //	
       
   122 void CSIPManagedProfile::SetParameterL(TUint32 aParam, TUint32 aVal)
       
   123 	{
       
   124 	switch (aParam)
       
   125 		{
       
   126 		case KSIPAccessPointId:
       
   127 			iAccessPointIdValue=aVal;
       
   128 			break;		
       
   129 		case KSIPProfileId:
       
   130 		case KSIPProviderName:		
       
   131 		case KSIPSigComp:
       
   132 		case KSIPSecurityNegotiation:
       
   133 		case KSIPAutoRegistration:
       
   134 		case KSIPUserAor:
       
   135 		case KSIPProfileRegistered:
       
   136 		case KSIPRegisteredAors:
       
   137 		case KSIPNegotiatedSecurityMechanism:
       
   138 		case KSIPDefaultProfile:
       
   139 		case KSIPContactHeaderParams:
       
   140 		case KSIPRegistrar:
       
   141 		case KSIPOutboundProxy:
       
   142 		case KSIPDigestUserName:
       
   143 		case KSIPDigestRealm:
       
   144 		case KSIPServerAddress:
       
   145 		case KSIPPrivateIdentity:
       
   146 		case KSIPDigestPassword:
       
   147 		case KSIPHeaders:
       
   148 		case KSIPContactHeaderUser:
       
   149 			User::Leave(KErrNotFound);
       
   150 		default:
       
   151 			break;
       
   152 		}
       
   153 	}
       
   154 
       
   155 // -----------------------------------------------------------------------------
       
   156 // CSIPManagedProfile::SetParameterL
       
   157 // -----------------------------------------------------------------------------
       
   158 //	
       
   159 void CSIPManagedProfile::SetParameterL(TUint32 aParam, TBool aVal)
       
   160 	{
       
   161 	switch (aParam)
       
   162 		{
       
   163 		case KSIPSigComp:
       
   164 			iSigCompValue=aVal;
       
   165 			break;
       
   166 		case KSIPAutoRegistration:
       
   167 			iAutoRegistrationValue=aVal;
       
   168 			break;
       
   169 		case KSIPSecurityNegotiation:
       
   170 			iSecurityNegotiationValue=aVal;
       
   171 			break;		
       
   172 		case KSIPDefaultProfile:
       
   173 		case KSIPProfileId:
       
   174 		case KSIPProviderName:
       
   175 		case KSIPAccessPointId:		
       
   176 		case KSIPUserAor:
       
   177 		case KSIPProfileRegistered:
       
   178 		case KSIPRegisteredAors:
       
   179 		case KSIPNegotiatedSecurityMechanism:		
       
   180 		case KSIPContactHeaderParams:
       
   181 		case KSIPRegistrar:
       
   182 		case KSIPOutboundProxy:
       
   183 		case KSIPDigestUserName:
       
   184 		case KSIPDigestRealm:
       
   185 		case KSIPServerAddress:
       
   186 		case KSIPPrivateIdentity:
       
   187 		case KSIPDigestPassword:
       
   188 		case KSIPHeaders:
       
   189 		case KSIPContactHeaderUser:
       
   190 		case KSIPSoIpTOS:
       
   191 			User::Leave(KErrNotFound);			
       
   192 		default:
       
   193 			break;
       
   194 		}
       
   195 	}		
       
   196 
       
   197 
       
   198 // -----------------------------------------------------------------------------
       
   199 // CSIPManagedProfile::SetParameterL
       
   200 // -----------------------------------------------------------------------------
       
   201 //	
       
   202 TInt CSIPManagedProfile::SetParameter(TUint32 aServerType, TUint32 aParam, 
       
   203 										const TDesC8& aVal)
       
   204 	{
       
   205 	switch (aParam)
       
   206 		{
       
   207 		case KSIPDigestPassword:
       
   208 			if (aServerType == KSIPOutboundProxy)
       
   209 				{
       
   210 				iProxyPassword = aVal;					
       
   211 				}
       
   212 			else  // KSIPRegistrar
       
   213 				{
       
   214 				iRegistrarPassword = aVal;
       
   215 				}
       
   216 			break;
       
   217 
       
   218 		default:
       
   219 			break;
       
   220 		}		
       
   221 	return KErrNone;
       
   222 	}
       
   223 
       
   224 // -----------------------------------------------------------------------------
       
   225 // CSIPManagedProfileRegistry
       
   226 // -----------------------------------------------------------------------------
       
   227 //	
       
   228 CSIPManagedProfileRegistry* CSIPManagedProfileRegistry::NewL(
       
   229 											MSIPProfileRegistryObserver& aObserver)
       
   230 	{
       
   231     CSIPManagedProfileRegistry* self = CSIPManagedProfileRegistry::NewLC (aObserver);
       
   232     CleanupStack::Pop(self);
       
   233     return self;
       
   234 	}
       
   235 
       
   236 
       
   237 CSIPManagedProfileRegistry* CSIPManagedProfileRegistry::NewLC(
       
   238 											MSIPProfileRegistryObserver& aObserver)
       
   239 	{
       
   240 	CSIPManagedProfileRegistry* self = new(ELeave)CSIPManagedProfileRegistry(aObserver);
       
   241     CleanupStack::PushL(self);
       
   242     self->ConstructL();
       
   243     return self;
       
   244 	}
       
   245 
       
   246 
       
   247 CSIPManagedProfileRegistry::~CSIPManagedProfileRegistry()
       
   248 	{
       
   249 	}
       
   250 
       
   251 void CSIPManagedProfileRegistry::ConstructL()
       
   252 	{
       
   253 	}
       
   254 
       
   255 CSIPManagedProfileRegistry::CSIPManagedProfileRegistry(
       
   256 	MSIPProfileRegistryObserver& aObserver):
       
   257 	CSIPProfileRegistryBase(aObserver)
       
   258 	{
       
   259 	}
       
   260 
       
   261 CSIPProfile* CSIPManagedProfileRegistry::NewInstanceL()
       
   262 	{
       
   263 	return 0;
       
   264 	}
       
   265 	
       
   266 // -----------------------------------------------------------------------------
       
   267 // CSIPProfileRegistryBase
       
   268 // -----------------------------------------------------------------------------
       
   269 //	
       
   270 CSIPProfileRegistryBase::CSIPProfileRegistryBase(
       
   271 	MSIPProfileRegistryObserver& aObserver):
       
   272 	iObserver(aObserver)
       
   273 	{
       
   274 
       
   275 	}
       
   276 	
       
   277 CSIPProfileRegistryBase::~CSIPProfileRegistryBase()
       
   278 	{
       
   279 
       
   280 	}	
       
   281 	
       
   282 void CSIPProfileRegistryBase::ErrorOccurredL(TUint32 /*aProfileId*/,
       
   283 										   TInt /*aStatus*/,
       
   284 										   TInt /*aError*/)
       
   285 	{
       
   286 	}
       
   287 
       
   288 void CSIPProfileRegistryBase::UpdatedL(TUint32 /*aProfileId*/, TUint /*aSize*/)
       
   289 	{
       
   290 	}
       
   291 
       
   292 void CSIPProfileRegistryBase::AddedL(TUint32 /*aProfileId*/) 
       
   293 	{
       
   294 	}
       
   295 
       
   296 void CSIPProfileRegistryBase::RemovedL(TUint32 /*aProfileId*/)
       
   297 	{
       
   298 		
       
   299 	}
       
   300 	
       
   301 void CSIPProfileRegistryBase::RegistrationStatusChangedL(TUint32 /*aProfileId*/,
       
   302 							  TInt /*aStatus*/,
       
   303 							  TUint32 /*aStatusId*/)
       
   304 	{
       
   305 		
       
   306 	}
       
   307 
       
   308 // -----------------------------------------------------------------------------
       
   309 // CSIPStrings
       
   310 // -----------------------------------------------------------------------------
       
   311 //	
       
   312 	
       
   313 void SIPStrings::OpenL()
       
   314 	{
       
   315 		
       
   316 	}
       
   317 
       
   318 void SIPStrings::Close()
       
   319 	{
       
   320 		
       
   321 	}