networkcontrol/ipnetworklayer/inc/IPProtoTierManagerSelector.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2006-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalTechnology
       
    19  @prototype
       
    20 */
       
    21 
       
    22 #ifndef SYMBIAN_IPPROTO_TIER_MANAGER_SELECTOR_H
       
    23 #define SYMBIAN_IPPROTO_TIER_MANAGER_SELECTOR_H
       
    24 
       
    25 //Legacy stuff
       
    26 #include <commdbconnpref.h>	//TCommDbConnPref & TCommDbConnPrefMulti
       
    27 #include <comms-infras/simpleselectorbase.h>
       
    28 
       
    29 #include <comms-infras/ss_mcprnodemessages.h>
       
    30 
       
    31 
       
    32 //
       
    33 //TIpProtoProviderSelectorFactory
       
    34 class TIpProtoProviderSelectorFactory
       
    35 /**
       
    36 @internalComponent
       
    37 @prototype
       
    38 */
       
    39 	{
       
    40 public:
       
    41 	static ESock::MProviderSelector* NewSelectorL(const Meta::SMetaData& aSelectionPreferences);
       
    42 	};
       
    43 
       
    44 //
       
    45 //CLinkPrefsSelector
       
    46 class CLinkPrefsSelector : public CSimplePromptingSelectorBase
       
    47 /** Link connection selector.
       
    48 
       
    49 	This selector may use dialog to process some or all of its preferences.
       
    50 	
       
    51 	It is declared in the header file only for legacy purposes (so that
       
    52 	it can be accessed from the IpProto tier manager by type)
       
    53 
       
    54 @internalComponent
       
    55 @prototype
       
    56 */
       
    57 	{
       
    58 public:
       
    59 	static const TUint KUid = 0x10283018;
       
    60 	
       
    61 public:
       
    62 	explicit CLinkPrefsSelector(const Meta::SMetaData& aSelectionPreferences)
       
    63 		:	CSimplePromptingSelectorBase(KUid, aSelectionPreferences),
       
    64 			iUserPromted(EFalse)
       
    65 		{
       
    66 		}
       
    67 	virtual ~CLinkPrefsSelector();
       
    68 
       
    69 	/**
       
    70 	 * utility methods to avoid confusion between IAP and AP
       
    71 	 */
       
    72 	TInt SelectedIAP() { return iSelectedAPId; }
       
    73 	void SetSelectedIAP(TInt aSelectedIAP) { iSelectedAPId = aSelectedIAP; }
       
    74 
       
    75 private:
       
    76 	virtual void SelectL(ESock::ISelectionNotify& aSelectionNotify);
       
    77 	void OverrideLegacyPrefs(TCommDbConnPref& aConnPrefs, TInt aRank);
       
    78 	void ProcessPrefsFromListL();
       
    79 	ESock::CMetaConnectionProviderBase* FindOrCreateProviderL(TUint aIapToFind, TUint aAccessPointToCreate);
       
    80 
       
    81 	// From CActive
       
    82 	virtual void RunL();
       
    83 	virtual TInt RunError(TInt aError);
       
    84 
       
    85 private:
       
    86 	RArray<TCommDbConnPref> iPrefsList;
       
    87 	TBool iUserPromted;
       
    88 
       
    89 public:
       
    90 	ESock::CMetaConnectionProviderBase* iLegacyMCpr;
       
    91 	};
       
    92 
       
    93 //
       
    94 //AIpProtoSelectorBase
       
    95 class AIpProtoSelectorBase : /*public CBase, */public CSimplePromptingSelectorBase
       
    96 	{
       
    97 public:
       
    98 	AIpProtoSelectorBase()
       
    99 	: CSimplePromptingSelectorBase()
       
   100 	, iReselection(EFalse)
       
   101 		{
       
   102 		}
       
   103 	AIpProtoSelectorBase(const TUint aTypeId, 
       
   104 						 const Meta::SMetaData& aSelectionPreferences)
       
   105 		:	CSimplePromptingSelectorBase(aTypeId, aSelectionPreferences)
       
   106 		,   iReselection(EFalse)
       
   107 			{
       
   108 			}
       
   109 	
       
   110 	explicit AIpProtoSelectorBase(const Meta::SMetaData& aSelectionPreferences)
       
   111 		:	CSimplePromptingSelectorBase(aSelectionPreferences)
       
   112 		,   iReselection(EFalse)
       
   113 			{
       
   114 			}
       
   115 	
       
   116 	ESock::CMetaConnectionProviderBase* FindOrCreateProviderL(TUint aIapToFind, TUint aAccessPointToCreate);
       
   117 
       
   118 	/**
       
   119 	 * utility methods to avoid confusion between IAP and AP
       
   120 	 */
       
   121 	TInt SelectedIAP() { return iSelectedAPId; }
       
   122 	void SetSelectedIAP(TInt aSelectedIAP) { iSelectedAPId = aSelectedIAP; }
       
   123 	
       
   124 	ESock::CMetaConnectionProviderBase* iNetworkMCpr;
       
   125 	TBool iReselection;
       
   126 	
       
   127 	};
       
   128 
       
   129 class CIpProtoProviderSelectorConnPrefList : public AIpProtoSelectorBase
       
   130 /** Ip Proto connection selector.
       
   131 
       
   132 	A selector object for the Ip proto layer which takes as input RConnPrefList
       
   133 	Used only to support post 399 selection on the Ip Proto layer.
       
   134 	
       
   135 @internalComponent
       
   136 */
       
   137 	{
       
   138 public:
       
   139 	CIpProtoProviderSelectorConnPrefList(const ESock::RConnPrefList& aSelectionPreferences);
       
   140 	
       
   141 private:
       
   142 	virtual void SelectL(ESock::ISelectionNotify& aSelectionNotify);
       
   143 	
       
   144 	// From CActive
       
   145 	virtual void RunL();
       
   146 	virtual TInt RunError(TInt aError);
       
   147 	
       
   148 	ESock::RConnPrefList iSelectionPrefList;
       
   149 	TUid iTierId;
       
   150 	TInt iLastAccessPoint;
       
   151 	};
       
   152 
       
   153 
       
   154 //
       
   155 //CIpProtoProviderSelector
       
   156 class CIpProtoProviderSelector : public AIpProtoSelectorBase
       
   157 /** Ip Proto connection selector.
       
   158 
       
   159 	Simple selector object for the Ip proto layer.
       
   160 	Used only to support post 399 selection on the Ip Proto layer.
       
   161 	Currently does not prompt but could prompt in the future.
       
   162 
       
   163 @internalComponent
       
   164 @prototype
       
   165 */
       
   166 	{
       
   167 	static const TUint KUid = 0x10283019;
       
   168 
       
   169 public:
       
   170 	explicit CIpProtoProviderSelector(const Meta::SMetaData& aSelectionPreferences)
       
   171 	:	AIpProtoSelectorBase(aSelectionPreferences)
       
   172 		{
       
   173 		}
       
   174 
       
   175 private:
       
   176 	virtual void SelectL(ESock::ISelectionNotify& aSelectionNotify);
       
   177 	
       
   178 	// From CActive
       
   179 	virtual void RunL();
       
   180 	virtual TInt RunError(TInt aError);
       
   181 	
       
   182 	void InvokeDialogL(ESock::ISelectionNotify& aSelectionNotify,
       
   183 			           TUint aCprConfig);
       
   184 	};
       
   185 
       
   186 #endif //SYMBIAN_IPPROTO_TIER_MANAGER_SELECTOR_H