sipproviderplugins/sipprovider/sipconnectionplugins/inc/sipmcpr.h
changeset 0 307788aac0a8
equal deleted inserted replaced
-1:000000000000 0:307788aac0a8
       
     1 // Copyright (c) 2007-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 // SIP Meta Connection Provider class 
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef SYMBIAN_SIPMCPR_H
       
    24 #define SYMBIAN_SIPMCPR_H
       
    25 
       
    26 #include <comms-infras/coremcpr.h>
       
    27 #include <comms-infras/ss_mcprnodemessages.h>
       
    28 #include <es_connpref.h>
       
    29 
       
    30 #include <comms-infras/ss_log.h>
       
    31 #include <comms-infras/coremcpractivities.h>
       
    32 //#include <coreavailabilityactivity.h>
       
    33 #include <comms-infras/coremcprstates.h>
       
    34 #include <comms-infras/ss_corepractivities.h>
       
    35 //#include <comms-infras/ss_commsprov.h>
       
    36 
       
    37 #include "sipprovisioninfo.h"
       
    38 #include "TransitionEngineMgr.h"
       
    39 
       
    40 
       
    41 namespace SipMCprStates
       
    42 {
       
    43 class TSendProvision;
       
    44 }
       
    45 
       
    46 //
       
    47 //CNetworkMetaConnectionProvider
       
    48 NONSHARABLE_CLASS(CSipMetaConnectionProvider) : public CCoreMetaConnectionProvider
       
    49     {
       
    50     friend class SipMCprStates::TSendProvision;
       
    51 public:
       
    52 	
       
    53 	/**
       
    54 	Constructor of the class
       
    55 	*/
       
    56 	static CSipMetaConnectionProvider* NewL(ESock::CMetaConnectionProviderFactoryBase& aFactory,
       
    57 	                                            const ESock::TProviderInfo& aProviderInfo);
       
    58 	/**
       
    59 	Destructor of the class
       
    60 	*/                                         
       
    61 	virtual ~CSipMetaConnectionProvider();
       
    62 	
       
    63 	/**
       
    64 	setd the applicaiton UID. Usually it will be the UID of the test application
       
    65 	
       
    66 	@param aUid   Uid of the applicaion
       
    67 	*/
       
    68 	void SetAppUid(TUid aUid)	
       
    69 		{
       
    70 		iAppUid = aUid;
       
    71 		}
       
    72 	
       
    73 	/**
       
    74 	returns the application UID	
       
    75     */
       
    76 	TUid AppUid()
       
    77 		{
       
    78 		return iAppUid;
       
    79 		}
       
    80 	
       
    81 	/**
       
    82 	Sets the profile ID
       
    83 	
       
    84 	@param aProfileId, an ID of the SIP profile. This will be used by the SIP CPR and SIP SCPR 		
       
    85 	*/	
       
    86 	void SetProfileId(TUint32 aProfileId)
       
    87 		{
       
    88 		iProfileId = aProfileId;
       
    89 		}
       
    90 	/**
       
    91 	Returns the profile ID
       
    92 	*/	
       
    93 	TUint32 ProfileId()
       
    94 		{
       
    95 		return iProfileId;
       
    96 		}
       
    97 		
       
    98 	/**
       
    99 	Sets the SIP Transition engine manager
       
   100 	
       
   101 	@param aMgr, a Transition engine manager which is used to find or create the transition engine
       
   102 	*/	
       
   103 	void SetTransitionEngineManager(CTransitionEngineMgr* aMgr)
       
   104 		{
       
   105 		iTransitionEngineMgr = aMgr;
       
   106 		}
       
   107 	
       
   108 protected:
       
   109     CSipMetaConnectionProvider(ESock::CMetaConnectionProviderFactoryBase& aFactory,
       
   110                                    const ESock::TProviderInfo& aProviderInfo,
       
   111                                    const MeshMachine::TNodeActivityMap& aActivityMap);
       
   112     /**
       
   113     This funtion receives the comms messages and passes it for further processing
       
   114     */
       
   115     virtual void ReceivedL(const Messages::TRuntimeCtxId& aSender, const Messages::TNodeId& aRecipient, Messages::TSignatureBase& aMessage);
       
   116     
       
   117     /**
       
   118     This function constructs and appends the SIP MCPR provision info that is
       
   119     being sent in ECFProvisionConfig message to the SIP CPR
       
   120     */
       
   121     void SetConfigL();
       
   122     
       
   123     void ConstructL(const ESock::TProviderInfo& aProviderInfo);
       
   124 	
       
   125 	
       
   126 	TUint32	iProfileId;
       
   127 	TUid	iAppUid;
       
   128 	CTransitionEngineMgr	*iTransitionEngineMgr; // we dont own it, TierMgr does
       
   129     
       
   130     };
       
   131     
       
   132 //-=========================================================
       
   133 //
       
   134 // States
       
   135 //
       
   136 //-=========================================================
       
   137 namespace SipMCprStates
       
   138 {
       
   139 typedef MeshMachine::TNodeContext<CSipMetaConnectionProvider, MCprStates::TContext> TContext;
       
   140 
       
   141 DECLARE_SMELEMENT_HEADER( TSendProvision, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext )
       
   142 	virtual void DoL();
       
   143 DECLARE_SMELEMENT_FOOTER( TSendProvision )
       
   144 
       
   145 /**
       
   146 This will be used by the MCPR binder activity. SendProvision is overridev to send the 
       
   147 SIP MCPR provisioninfo in the provisionConfig message to SIP CPR
       
   148 */
       
   149 DECLARE_AGGREGATED_TRANSITION3(
       
   150    TProcessCprCreation,
       
   151    CoreNetStates::TAddDataClient,
       
   152    SipMCprStates::TSendProvision,
       
   153    PRActivities::CCommsBinderActivity::TStorePendingBinder
       
   154    )
       
   155 }
       
   156 
       
   157 namespace SipMcpr
       
   158 {
       
   159 DECLARE_EXPORT_ACTIVITY_MAP(SipMcprActivities)
       
   160 }
       
   161 #endif //SYMBIAN_SIPMCPR_H