baseconnectionproviders/refscpr/src/ReferenceSCPR_defaultSubconnProv.cpp
branchRCL_3
changeset 25 9d7ce34704c8
equal deleted inserted replaced
24:00c6709d25aa 25:9d7ce34704c8
       
     1 // Copyright (c) 2005-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 // Implementation file for the Default Reference SubConnection Provider
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #include "ReferenceSCPR_defaultSubconnProv.h"
       
    24 
       
    25 	
       
    26 //-=========================================================
       
    27 // Custom methods
       
    28 //-=========================================================	
       
    29 CReferenceDefaultSubConnectionProvider::CReferenceDefaultSubConnectionProvider(
       
    30                                  CSubConnectionProviderFactoryBase& aFactory, 
       
    31 	                             CConnectionProviderBase& aConnProvider)
       
    32 :CSubConnectionProviderBase(aFactory, aConnProvider)
       
    33 /** 
       
    34 
       
    35 @param aFactory CSubConnectionProviderFactoryBase that should own the reference to 'this'
       
    36 @param aConnProvider a connection that 'this' subconnection belongs to
       
    37 */
       
    38 	{
       
    39 	__FLOG_OPEN(KReferenceLogTag1, KReferenceLogTag2);
       
    40 	}
       
    41 	
       
    42 
       
    43 /** NewL for the two stage construction. Calls the CReferenceDefaultSubConnectionProvider constructor
       
    44  and ConstructL on the constructed instance.
       
    45 
       
    46 @param aFactory      - the subconnection provider factory the new CReferenceDefaultSubConnectionProvider 
       
    47                        will belong to and is to be instantiated by.
       
    48 @param aConnProvider - the connection (represented by a connection provieder) the new 
       
    49                        CReferenceSubConnectionProvider will belong to.
       
    50 @return              - a new, constructed instance of CReferenceDefaultSubConnectionProvider.
       
    51 */
       
    52 CReferenceDefaultSubConnectionProvider* CReferenceDefaultSubConnectionProvider::NewL(
       
    53 										CSubConnectionProviderFactoryBase& aFactory, 
       
    54 	                                    CConnectionProviderBase& aConnProvider)
       
    55 	{
       
    56     CReferenceDefaultSubConnectionProvider* provider = 
       
    57     		new(ELeave)CReferenceDefaultSubConnectionProvider(aFactory, aConnProvider);
       
    58 	CleanupStack::PushL(provider);
       
    59     provider->ConstructL();
       
    60     CleanupStack::Pop();
       
    61     return provider;
       
    62     }
       
    63     
       
    64 	                             
       
    65 /** ConstructL for the two stage construction
       
    66 */
       
    67 void CReferenceDefaultSubConnectionProvider::ConstructL()
       
    68 	{
       
    69 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::ConstructL()"), this);	
       
    70 	//TODO: perform 2nd stage construction, if needed.
       
    71 	}
       
    72 
       
    73 
       
    74 CReferenceDefaultSubConnectionProvider::~CReferenceDefaultSubConnectionProvider()
       
    75 /** 
       
    76 Destroys 'this'
       
    77 */
       
    78     {
       
    79     __FLOG_CLOSE;
       
    80     }
       
    81 
       
    82 
       
    83 
       
    84 //-=========================================================
       
    85 // MConnectionDataClient methods
       
    86 //-=========================================================	
       
    87 
       
    88 /** Called by the connection provider, of which 'this' is a data client and to which
       
    89  'this' belongs. The connection provider will call this method to notify its data clients.
       
    90 
       
    91 @param aNotifyType   - one of MConnectionDataClient::TNotify enums indicating the notification type.
       
    92 @param aConnProvider - the connection provider originating this notification.
       
    93 @param aError        - the error indication
       
    94 @param aConNotificationEvent - the actual event. 
       
    95 */
       
    96 void CReferenceDefaultSubConnectionProvider::Notify(MConnectionDataClient::TNotify /*aNotifyType*/,  CConnectionProviderBase* /*aConnProvider*/, TInt /*aError*/, const CConNotificationEvent* /*aConNotificationEvent*/)
       
    97 	{
       
    98 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::Notify()"), this);
       
    99 	//TODO:		
       
   100 	}
       
   101 
       
   102 
       
   103 /** Called to associate 'this' with a lower layer subconnection provider. 
       
   104 
       
   105 @param aSubConnProvider to be the lower layer for 'this'
       
   106 */
       
   107 void CReferenceDefaultSubConnectionProvider::AttachToNext(CSubConnectionProviderBase* /*aSubConnProvider*/)
       
   108 	{
       
   109 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::AttachToNext()"), this);
       
   110 	//TODO:		
       
   111 	}
       
   112 
       
   113 
       
   114 
       
   115 /** Called to inform 'this' that the connection, to which 'this' belongs, is going down.
       
   116 
       
   117 @param aConnProvider - the connection going down.
       
   118 */
       
   119 void CReferenceDefaultSubConnectionProvider::ConnectionGoingDown(CConnectionProviderBase& /*aConnProvider*/)
       
   120 	{
       
   121 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::ConnectionGoingDown()"), this);
       
   122 	//TODO:		
       
   123 	}
       
   124 
       
   125 /** Called to inform 'this' about a generic connection error.
       
   126 
       
   127 @param aStage - stage at which the error has occured (currently as specified by NIFVAR.H)
       
   128 @param aError - the error indication.
       
   129 */
       
   130 void CReferenceDefaultSubConnectionProvider::ConnectionError(TInt /*aStage*/, TInt /*aError*/)
       
   131 	{
       
   132 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::ConnectionError()"), this);
       
   133 	//TODO:		
       
   134 	}
       
   135 
       
   136 
       
   137 
       
   138 
       
   139 
       
   140 
       
   141 
       
   142 //-=========================================================
       
   143 // CSubConnectionProviderBase methods
       
   144 //-=========================================================
       
   145 
       
   146 
       
   147 
       
   148 /** Override this if you observe data clients joining the sub-connection
       
   149     provider. This method is called before the data client is added to
       
   150 	the lists, so if you wish to stop it being added, leave with an
       
   151 	appropriate System wide error
       
   152 
       
   153 @param aDataClient Data client wishing to join the sub-connection provider
       
   154 @exception If the specific sub-connection provider does not want the data client to join
       
   155 */
       
   156 void CReferenceDefaultSubConnectionProvider::DoDataClientJoiningL(MSubConnectionDataClient& /*aDataClient*/)
       
   157 	{
       
   158 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoDataClientJoiningL()"), this);
       
   159 	//TODO:		
       
   160 	}
       
   161 	
       
   162 	
       
   163 	
       
   164 /** Override this if you observe data clients leaving the sub-connection
       
   165     provider. This method is called before the data client leaves the
       
   166 	the. Please note that it is not possible to to stop a data client
       
   167 	from leaving.
       
   168 
       
   169 @param aDataClient Data client about to leave the sub-connection provider
       
   170 */
       
   171 void CReferenceDefaultSubConnectionProvider::DoDataClientLeaving(MSubConnectionDataClient& /*aDataClient*/)
       
   172 	{
       
   173 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoDataClientLeaving()"), this);
       
   174 	//TODO:		
       
   175 	}
       
   176 	
       
   177 	
       
   178 	
       
   179 /** Override this if you observe control clients leaving the sub-connection
       
   180     provider. This method is called before the control client leaves the
       
   181 	the. Please note that it is not possible to to stop a control client
       
   182 	from leaving.
       
   183 
       
   184 @param aDataClient Data client about to leave the sub-connection provider
       
   185 */
       
   186 void CReferenceDefaultSubConnectionProvider::DoControlClientJoiningL(MSubConnectionControlClient& /*aControlClient*/)
       
   187 	{
       
   188 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoControlClientJoiningL()"), this);
       
   189 	//TODO:		
       
   190 	}
       
   191 	
       
   192 	
       
   193 	
       
   194 	
       
   195 /** Override this if you observe control clients leaving the sub-connection
       
   196     provider. This method is called before the control client leaves the
       
   197 	the. Please note that it is not possible to to stop a control client
       
   198 	from leaving.
       
   199 
       
   200 @param aDataClient Data client about to leave the sub-connection provider
       
   201 */
       
   202 void CReferenceDefaultSubConnectionProvider::DoControlClientLeaving(MSubConnectionControlClient& /*aControlClient*/)
       
   203 	{
       
   204 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoControlClientLeaving()"), this);
       
   205 	//TODO:		
       
   206 	}
       
   207 	
       
   208 	
       
   209 	
       
   210 	
       
   211 /** Override this if you observe a data client receiving a new source
       
   212     address.
       
   213 
       
   214 @param aDataClient Data client about to leave the sub-connection provider
       
   215 @param aSource New source address
       
   216 */
       
   217 void CReferenceDefaultSubConnectionProvider::DoSourceAddressUpdate(MSubConnectionDataClient& /*aDataClient*/, const TSockAddr& /*aSource*/)
       
   218 	{
       
   219 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoSourceAddressUpdate()"), this);
       
   220 	//TODO:		
       
   221 	}
       
   222 	
       
   223 	
       
   224 	
       
   225 	
       
   226 /** Override this if you observe a data client receiving a new destination
       
   227     address.
       
   228 
       
   229 @param aDataClient Data client about to leave the sub-connection provider
       
   230 @param aDestination New destination address
       
   231 */
       
   232 void CReferenceDefaultSubConnectionProvider::DoDestinationAddressUpdate(MSubConnectionDataClient& /*aDataClient*/, const TSockAddr& /*aDestination*/)
       
   233 	{
       
   234 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoDestinationAddressUpdate()"), this);
       
   235 	//TODO:		
       
   236 	}
       
   237 	
       
   238 	
       
   239 	
       
   240 	
       
   241 /** Override this if you observe a data client receiving all its address
       
   242     address information.
       
   243 
       
   244 @param aDataClient Data client about to leave the sub-connection provider
       
   245 @param aSource New source address
       
   246 @param aDestination New destination address
       
   247 @param aConnectionInfo Connection Information (including IAP)
       
   248 */
       
   249 void CReferenceDefaultSubConnectionProvider::DoDataClientRouted(MSubConnectionDataClient& /*aDataClient*/, const TSockAddr& /*aSource*/, const TSockAddr& /*aDestination*/, const TDesC8& /*aConnectionInfo*/)
       
   250 	{
       
   251 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoDataClientRouted()"), this);
       
   252 	//TODO:		
       
   253 	}
       
   254 	
       
   255 	
       
   256 	
       
   257 	
       
   258 /** Override this if you observe a data client about to receive new paramaters.
       
   259     This method is called before the parameters are associated with the sub-connection
       
   260 	provider, so it is possible to abort this by leaving from this method with
       
   261 	an appropriate system wide error code.
       
   262 
       
   263 @param aParameterBundle Parameters received from the control client
       
   264 @exception If the specific sub-connection provider does not want the parameters to be set
       
   265 */
       
   266 void CReferenceDefaultSubConnectionProvider::DoParametersAboutToBeSetL(CSubConParameterBundle& /*aParameterBundle*/)
       
   267 	{
       
   268 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoParametersAboutToBeSetL()"), this);
       
   269 	//TODO:		
       
   270 	}
       
   271 	
       
   272 	
       
   273 	
       
   274 	
       
   275 /** Override this to implement specific control behaviour request by the client
       
   276 
       
   277 @param aOptionLevel Control Option level
       
   278 @param aOptionName Control Option name
       
   279 @param aOption Control Option value
       
   280 @return KErrNone if successful, otherwise system error code
       
   281 */
       
   282 TInt CReferenceDefaultSubConnectionProvider::DoControl(TUint /*aOptionLevel*/, TUint /*aOptionName*/, TDes8& /*aOption*/)
       
   283 	{
       
   284 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoControl()"), this);
       
   285 	//TODO:
       
   286 	
       
   287 	return KErrNotSupported;
       
   288 	}
       
   289 	
       
   290 	
       
   291 	
       
   292 	
       
   293 /** DoDataTransferL
       
   294 */
       
   295 CConnDataTransfer& CReferenceDefaultSubConnectionProvider::DoDataTransferL()
       
   296 	{
       
   297 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoDataTransferL()"), this);
       
   298 	//TODO: 
       
   299 	User::Leave(KErrNotSupported);
       
   300 	CConnDataTransfer* null = NULL;
       
   301 	return *static_cast<CConnDataTransfer*>(null);
       
   302 	}
       
   303 	
       
   304 	
       
   305 	
       
   306 	
       
   307 /** DoSelfConnectionDataClient
       
   308 */
       
   309 MConnectionDataClient* CReferenceDefaultSubConnectionProvider::DoSelfConnectionDataClient()
       
   310 	{
       
   311 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoSelfConnectionDataClient()"), this);
       
   312 	//CReferenceDefaultSubConnectionProvider is a MConnectionDataClient, hence returning 'this'
       
   313 	return this;
       
   314 	}
       
   315 	
       
   316 
       
   317 	
       
   318 /** Called to start 'this'.
       
   319 	   
       
   320 */
       
   321 void CReferenceDefaultSubConnectionProvider::DoStartL()
       
   322 	{
       
   323 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoStartL()"), this);
       
   324 	//TODO:		
       
   325 	}
       
   326 	
       
   327 	
       
   328 /** Called to stop 'this'.
       
   329    
       
   330 */
       
   331 void CReferenceDefaultSubConnectionProvider::DoStop()
       
   332 	{
       
   333 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoStop()"), this);
       
   334 	//TODO:		
       
   335 	}
       
   336 	
       
   337 	
       
   338 /** Called to retrieve the lower subconnection provider of 'this'
       
   339   
       
   340  @return the subconnection provider below 'this'
       
   341 */	
       
   342 CSubConnectionProviderBase* CReferenceDefaultSubConnectionProvider::DoNextLayer()
       
   343 	{
       
   344 	__FLOG_1(_L("CReferenceDefaultSubConnectionProvider[%x]::DoNextLayer()"), this);
       
   345 	return iNextLayer;
       
   346 	}
       
   347