datacommsserver/esockserver/esock_params/inc/esock_params.h
changeset 0 dfb7c4ff071f
equal deleted inserted replaced
-1:000000000000 0:dfb7c4ff071f
       
     1 // Copyright (c) 2003-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 #ifndef ESOCK_PARAMS_H
       
    17 #define ESOCK_PARAMS_H
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <e32std.h>	
       
    21 
       
    22 #include <comms-infras/metadata.h>
       
    23 #include <es_prot.h>
       
    24 
       
    25 class TConnAPPref : public Meta::SMetaDataECom
       
    26 /**
       
    27 Connection preference to specify an access point to start. 
       
    28 
       
    29 However, this preference cannot be used with RConnection::Start as a TConnPref. It
       
    30 must be part of a TConnPrefList.
       
    31 
       
    32 TConnAPPref can be added to the list to chose the top level access point. For the
       
    33 KAfInet tier this type behaves in the same way as TConnSnapPref.
       
    34 
       
    35 It is recommended that at most one TConnAPPref from each tier is added to the
       
    36 TConnPrefList.
       
    37 
       
    38 If no TConnAPPref is specified, then the default access point for the KAfInet
       
    39 tier will be used for selection.
       
    40 
       
    41 @see TConnSnapPref
       
    42 @see TConnPrefList
       
    43 @see RConnection::Start
       
    44 
       
    45 @publishedAll
       
    46 @released since 9.5
       
    47 */
       
    48 	{
       
    49 public:
       
    50 	inline static TConnAPPref* NewL();
       
    51 	inline static TConnAPPref* NewL(TUint aAP);
       
    52 		
       
    53 	enum
       
    54 	{
       
    55 		EUid = 0x10285E27,
       
    56 		ETypeId = 2
       
    57 	};
       
    58 
       
    59 	inline void SetAP(TUint aAP);
       
    60 	inline TInt GetAP();
       
    61 	
       
    62 protected:
       
    63 	DATA_VTABLE
       
    64 	
       
    65 	TUint iAP;
       
    66 	};
       
    67 
       
    68 
       
    69 class TConnAutoStartPref : public Meta::SMetaDataECom
       
    70 /** The connection preference requires that the connection waits until its selected access point is available
       
    71 before starting. The start request does not complete until the connection is fully up.
       
    72 
       
    73 Without this preference(e.g in the TConnPrefList), if the selected access point is unavailable due to contention or
       
    74 lack of coverage, the RConnection::Start is errored immediately.
       
    75 
       
    76 TConnAutoStartPref does not aid access point selection. When specified without any other preference in the
       
    77 TConnPrefList, the default access point in the KAfInet tier will be selected.
       
    78 
       
    79 @code
       
    80 RConnection conn;
       
    81 User::LeaveIfError(conn.Open(sockSvr));
       
    82 CleanupClosePushL(conn);
       
    83 
       
    84 TConnPrefList* prefs = TConnPrefList::NewL();
       
    85 CleanupStack::PushL(prefs);
       
    86 TConnAPPref* APPref = TConnAPPref::NewL(aPara->iAp);
       
    87 CleanupStack::PushL(APPref);
       
    88 TConnAutoStartPref autoPref = TConnAutoStartPref::NewL();
       
    89 CleanupStack::PushL(autoPref);
       
    90 
       
    91 prefs->AppendL(autoPref);
       
    92 prefs->AppendL(APPref);
       
    93 
       
    94 error = conn.Start(pref);
       
    95 @endcode
       
    96 
       
    97 @see RConnection::Start
       
    98 @see TConnPrefList
       
    99 
       
   100 @publishedAll
       
   101 @released since 9.5
       
   102 */
       
   103 	{
       
   104 public:
       
   105 	inline static TConnAutoStartPref* NewL();
       
   106 	enum
       
   107 	{
       
   108 		EUid = 0x10285E27,
       
   109 		ETypeId = 3
       
   110 	};
       
   111 
       
   112 protected:
       
   113 	DATA_VTABLE
       
   114 	};
       
   115 
       
   116 
       
   117 #include <comms-infras/esock_params.inl>
       
   118 
       
   119 class CESockParamaterFactory : public CBase
       
   120 /** Connection generic parameter set factory.
       
   121 
       
   122 @internalComponent
       
   123 */
       
   124 	{
       
   125 public:
       
   126 	static Meta::SMetaDataECom* NewL(TAny* aConstructionParameters);
       
   127 	};
       
   128 
       
   129 #endif
       
   130