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