epoc32/include/commdbconnpref.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
     1.1 --- a/epoc32/include/commdbconnpref.h	Wed Mar 31 12:27:01 2010 +0100
     1.2 +++ b/epoc32/include/commdbconnpref.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -1,9 +1,9 @@
     1.4  // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5  // All rights reserved.
     1.6  // This component and the accompanying materials are made available
     1.7 -// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     1.8 +// under the terms of "Eclipse Public License v1.0"
     1.9  // which accompanies this distribution, and is available
    1.10 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.12  //
    1.13  // Initial Contributors:
    1.14  // Nokia Corporation - initial contribution.
    1.15 @@ -13,50 +13,39 @@
    1.16  // Description:
    1.17  //
    1.18  
    1.19 -
    1.20 -
    1.21 -/**
    1.22 - @file
    1.23 - @deprecated since v9.1. Functionality is replaced with commsdat.
    1.24 -*/
    1.25 -
    1.26  #if !(defined COMMDBCONNPREF_H)
    1.27  #define COMMDBCONNPREF_H
    1.28  
    1.29  #include <connpref.h>
    1.30  #include <cdbcols.h>
    1.31  
    1.32 -/**
    1.33 -Constant for storing Major Version Number
    1.34 -@internalTechnology
    1.35 -*/
    1.36 -const TInt8 KMajorVersionNumber = 8;
    1.37 +class TCommDbConnPref : public TConnPref
    1.38 +/** Connection preferences which override the contents of the ConnectionPreferences
    1.39 +tables in CommsDat. The only mandatory field is IAP.
    1.40  
    1.41 -/**
    1.42 -Constant for storing Minor Version Number
    1.43 -*/
    1.44 -const TInt8 KMinorVersionNumber = 0;
    1.45 +An Internet Access Point(IAP) represents a IP bound bearer and a set of parameters
    1.46 +on that bearer, which the device can use to make a connection to the Internet.
    1.47  
    1.48 -/**
    1.49 -Constant for storing Build Version Number
    1.50 -*/
    1.51 -const TInt16 KBuildVersionNumber = 1;
    1.52 +A list of available IAPs and Networks can be retrieved from CommsDat using
    1.53 +CommsDat::CCDIAPRecord and CCDNetworkRecord.
    1.54  
    1.55 +@code
    1.56 +RConnection conn;
    1.57 +User::LeaveIfError(conn.Open(sockSvr));
    1.58 +CleanupClosePushL(conn);
    1.59  
    1.60 -/**
    1.61 -@internalTechnology
    1.62 -*/
    1.63 -struct SCommDbConnPref
    1.64 -	{
    1.65 -	TUint32 iIapId;
    1.66 -	TUint32 iNetId;
    1.67 -	TCommDbDialogPref iDialogPref;
    1.68 -	TCommDbConnectionDirection iDirection;
    1.69 -	TUint32 iBearerSet;
    1.70 -	};
    1.71 +TCommDbConnPref prefs;
    1.72 +prefs.SetIapId(3);
    1.73 +TInt error = conn.Start(prefs);
    1.74 +@endcode
    1.75  
    1.76 -class TCommDbConnPref : public TConnPref
    1.77 -/**
    1.78 +@see CommsDat::CCDNetworkRecord
    1.79 +@see CommsDat::CCDIAPRecord
    1.80 +@see TCommDbDialogPref
    1.81 +@see TCommDbConnectionDirection
    1.82 +@see TCommDbBearer
    1.83 +@see RConnection::Start
    1.84 +
    1.85  @publishedAll
    1.86  @released since v7.0s
    1.87  */
    1.88 @@ -87,26 +76,53 @@
    1.89  
    1.90  	inline static TCommDbConnPref& Cast(const TConnPref& aPref);
    1.91  
    1.92 -protected:
    1.93 +public:
    1.94 +    struct SCommDbConnPref
    1.95 +        {
    1.96 +        TUint32 iIapId;
    1.97 +        TUint32 iNetId;
    1.98 +        TCommDbDialogPref iDialogPref;
    1.99 +        TCommDbConnectionDirection iDirection;
   1.100 +        TUint32 iBearerSet;
   1.101 +        };
   1.102  	inline SCommDbConnPref* PrefPtr() const;
   1.103 +    const static TInt8 KMajorVersionNumber = 8;
   1.104 +    const static TInt8 KMinorVersionNumber = 0;
   1.105 +    const static TInt16 KBuildVersionNumber = 1;
   1.106  	};
   1.107  
   1.108 -/**
   1.109 -@internalTechnology
   1.110 -*/
   1.111 -const TInt KMaxMultiConnPrefCount = 2;
   1.112  
   1.113 -/**
   1.114 -@internalTechnology
   1.115 -*/
   1.116 -struct SCommDbMultiConnPref
   1.117 -	{
   1.118 -	TInt iNumAttempts;
   1.119 -	struct SCommDbConnPref iPrefs[KMaxMultiConnPrefCount];
   1.120 -	};
   1.121  
   1.122  class TCommDbMultiConnPref : public TConnPref
   1.123 -/**
   1.124 +/** A set of TCommDbConnPrefs which the device will use to attempt to connect
   1.125 +to the internet. The preferences at index 1 will be used first, and if this fails
   1.126 +the preferences at index 2 will be used, and so on until connection attempts
   1.127 +are exhausted.
   1.128 +
   1.129 +The index counts from 1. There must be as many connection preferences as there
   1.130 +are connection attempts.
   1.131 +
   1.132 +@code
   1.133 +RConnection conn;
   1.134 +User::LeaveIfError(conn.Open(sockSvr));
   1.135 +CleanupClosePushL(conn);
   1.136 +
   1.137 +TCommDbConnPref prefsA;
   1.138 +prefsA.SetIapId(3);
   1.139 +TCommDbConnPref prefsB;
   1.140 +prefsB.SetIapId(5);
   1.141 +
   1.142 +TCommDbMultiConnPref prefs;
   1.143 +prefs.SetPreference(1, prefsA);
   1.144 +prefs.SetPreference(2, prefsB);
   1.145 +prefs.SetConnectionAttempts(2);
   1.146 +
   1.147 +TInt error = conn.Start(prefs);
   1.148 +@endcode
   1.149 +
   1.150 +@see TCommDbConnPref
   1.151 +@see RConnection::Start
   1.152 +
   1.153  @publishedAll
   1.154  @released since v7.0s
   1.155  */
   1.156 @@ -123,8 +139,17 @@
   1.157  
   1.158  	inline static TCommDbMultiConnPref& Cast(const TConnPref& aPref);
   1.159  
   1.160 -protected:
   1.161 +public:
   1.162 +    const static TInt KMaxMultiConnPrefCount = 2;
   1.163 +    struct SCommDbMultiConnPref
   1.164 +        {
   1.165 +        TInt iNumAttempts;
   1.166 +        struct TCommDbConnPref::SCommDbConnPref iPrefs[KMaxMultiConnPrefCount];
   1.167 +        };
   1.168  	inline struct SCommDbMultiConnPref* PrefPtr() const;
   1.169 +    const static TInt8 KMajorVersionNumber = 8;
   1.170 +    const static TInt8 KMinorVersionNumber = 0;
   1.171 +    const static TInt16 KBuildVersionNumber = 1;
   1.172  	};
   1.173  
   1.174  #include <commdbconnpref.inl>