networkcontrol/ipcpr/inc/ipcprfactory.h
branchRCL_3
changeset 58 8d540f55e491
parent 57 abbed5a4b42a
child 59 e36178c55292
child 63 425d8f4f7fa5
equal deleted inserted replaced
57:abbed5a4b42a 58:8d540f55e491
     1 /**
       
     2 * Copyright (c) 2005-2009 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 
       
    20 /**
       
    21  @file IPCPRFACTORY.H
       
    22  @internalComponent
       
    23 */
       
    24 
       
    25 #if !defined(__IPCPRFACTORY_H__)
       
    26 #define __IPCPRFACTORY_H__
       
    27 
       
    28 #include <ss_connprov.h> // CConnectionProviderFactoryBase, MCommsFactoryQuery
       
    29 #include <in_sock.h> // KAfInet
       
    30 #include <agentdialog.h> // RGenConAgentDialogServer
       
    31 #include <commsdebugutility.h> // __FLOG_DECLARATION_MEMBER
       
    32 
       
    33 const TUint KIPConnectionProviderFactoryId = KAfInet;
       
    34 
       
    35 class XConnectionIPFactoryQuery : public MCommsFactoryQuery
       
    36 	{
       
    37 public:
       
    38 	XConnectionIPFactoryQuery( CConnectionProviderBase* aConnectionProviderBase ) :
       
    39 		iConnectionProviderBase( aConnectionProviderBase )
       
    40 		{
       
    41 		}
       
    42 
       
    43 protected:
       
    44 	CConnectionProviderBase* iConnectionProviderBase;
       
    45 
       
    46 public:
       
    47 	virtual TMatchResult Match( TFactoryObjectInfo& aConnectionInfo );
       
    48 	};
       
    49 
       
    50 class CIPNetworkProviderFactory : public CConnectionProviderFactoryBase
       
    51 	{
       
    52 public:
       
    53 	static CIPNetworkProviderFactory* NewL(TAny* aParentContainer);
       
    54 
       
    55 protected:   
       
    56 	CIPNetworkProviderFactory(TUint aFactoryId, CConnectionFactoryContainer& aParentContainer);
       
    57 	virtual CConnectionProviderBase* DoCreateProviderL();
       
    58 	virtual MProviderSelector* DoSelectProvider( Meta::SMetaData& aPreferences, ISelectionNotify& aSelectionNotify, const RMessagePtr2* aMessage );
       
    59 	virtual MProviderSelector* DoSelectNextLayerProvider( Meta::SMetaData& aPreferences, ISelectionNotify& aSelectionNotify, const RMessagePtr2* aMessage );
       
    60 	virtual void DoEnumerateConnectionsL(RPointerArray<TConnectionInfo>& aConnectionInfoPtrArray);
       
    61 	};
       
    62 
       
    63 class TCommIdList;
       
    64 namespace ESock
       
    65 	{
       
    66 	class CConnStart;
       
    67 	}
       
    68 namespace  CommsDat
       
    69 	{
       
    70 	class CMDBSession;
       
    71 	class CCDGlobalSettingsRecord;
       
    72     class CCDIAPPrioritySelectionPolicyRecord;
       
    73 	}
       
    74 
       
    75 class CIPConnectionSelector : public CActive, public MProviderSelector
       
    76 /** IP-layer connection selector. IP level factory creates
       
    77 these to intercept and complete the Shim layer selection
       
    78 it triggers.
       
    79 
       
    80 @internalComponent
       
    81 @released Since 9.1
       
    82 */
       
    83 	{
       
    84 public:
       
    85 	TInt Select(Meta::SMetaData& aPreferences, const RMessagePtr2* aMessage);
       
    86 	void SelectComplete(CConnectionProviderBase* aConnProvider, TInt aError);
       
    87 	void ProgressNotification(TInt aStage, TInt aError);
       
    88 	void LayerUp(TInt aError);
       
    89 	void ServiceChangeNotification(TUint32 aId, const TDesC& aType);
       
    90 	void SubConnectionEvent(CSubConnectionProviderBase* aSubConnNextLayerProvider, const TSubConnectionEvent& aSubConnectionEvent);
       
    91 	void Detach();
       
    92 	
       
    93 	virtual TInt Cancel();
       
    94 	virtual TInt Cancel(TInt aReason, const RMessage2* aMessage);
       
    95 
       
    96 	//Only my own factory can create me but the constructor may be public because noone can link against it anyway.
       
    97 	//My factory could be my friend and the constructor priate but then my factory could mistakenly delete me!
       
    98 	CIPConnectionSelector(ISelectionNotify& aNotify, CIPNetworkProviderFactory& aFactory);
       
    99 
       
   100 private:
       
   101 	virtual ~CIPConnectionSelector(); //Nobody should delete me! Only I can delete myself.
       
   102 
       
   103 	// From CActive
       
   104 	virtual void DoCancel();
       
   105 	virtual void RunL();
       
   106 	virtual TInt RunError(TInt aError);
       
   107 
       
   108     // Helper functions
       
   109 	static TInt DestroyMyself(TAny* aSelf);
       
   110 	void SelectL(Meta::SMetaData& aPreferences);
       
   111 	void SelectLinkLayerL();
       
   112 	void FillListL(CommsDat::CCDIAPPrioritySelectionPolicyRecord& aPolicy);
       
   113     CommsDat::CCDGlobalSettingsRecord* LoadGlobalSettingsRecordLC();
       
   114     CommsDat::CCDIAPPrioritySelectionPolicyRecord* LoadPolicyRecordLC(TInt aAccessPoint);
       
   115 
       
   116 private:
       
   117     //ISelectionNotify must be stored by value, cos' it's just a short-lived wrapper class.
       
   118     //It doesn't exist as a someone that waits for the completion, but stores refereneces
       
   119     //to the one that does.
       
   120     ISelectionNotify iNotify;
       
   121     CIPNetworkProviderFactory& iFactory;
       
   122     MProviderSelector* iNextLayerSelector;
       
   123 	RGenConAgentDialogServer iDlgServ;
       
   124 	TUint32 iAPid;
       
   125 	RMessagePtr2 iSelectMessage;
       
   126 	CAsyncCallBack iAsyncDestructor;
       
   127 	CommsDat::CMDBSession* iDbs;
       
   128 	ESock::CConnStart* iConnStart;
       
   129 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
   130 	TSecureId iAppSecureId;
       
   131 #endif 
       
   132 	__FLOG_DECLARATION_MEMBER;
       
   133 	TConnPref* iPrefs;
       
   134 	};
       
   135 
       
   136 #endif // __IPCPRFACTORY_H__