1.1 --- a/epoc32/include/connpref.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/connpref.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,9 +1,9 @@
1.4 // Copyright (c) 2003-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,11 +13,21 @@
1.16 // Description:
1.17 //
1.18
1.19 +/**
1.20 + @file
1.21 + @publishedAll
1.22 + @released
1.23 +*/
1.24 +
1.25 #if !(defined __CONNPREF_H__)
1.26 #define __CONNPREF_H__
1.27
1.28 #define TCommSnapPref TConnSnapPref
1.29 #include <e32std.h>
1.30 +#include <comms-infras/metadata.h>
1.31 +#include <comms-infras/metacontainer.h>
1.32 +
1.33 +using namespace Meta;
1.34
1.35 /**
1.36 @publishedAll
1.37 @@ -30,7 +40,7 @@
1.38 */
1.39 struct SConnPref
1.40 {
1.41 - TInt16 iExtensionId; ///< Extension ID
1.42 + TInt16 iExtensionId; //< Extension ID
1.43 TInt16 iSpare;
1.44 };
1.45
1.46 @@ -44,17 +54,19 @@
1.47 public:
1.48 enum
1.49 {
1.50 - EConnPrefUnknown = 0x00, ///< Unknown Connection preference
1.51 - EConnPrefCommDb = 0x01, ///< CommDb Connection preference
1.52 - EConnPrefCommDbMulti = 0x02, ///< CommDbMulti Connection preferenc
1.53 + EConnPrefUnknown = 0x00, //< Unknown Connection preference
1.54 + EConnPrefCommDb = 0x01, //< CommDb Connection preference
1.55 + EConnPrefCommDbMulti = 0x02, //< CommDbMulti Connection preferenc
1.56 EConnPrefSnap = 0x03,
1.57 EConnPrefIdList = 0x04,
1.58 - EConnPrefSip = 0x05 ///< Sip Connection preference
1.59 + EConnPrefSip = 0x05, //< Sip Connection preference
1.60 + EConnPrefProviderInfo = 0x06,
1.61 + EConnPrefEComList = 0x07
1.62 };
1.63
1.64 IMPORT_C TConnPref();
1.65 IMPORT_C TConnPref(TInt aExtensionId);
1.66 -
1.67 +
1.68 IMPORT_C TInt ExtensionId() const;
1.69 IMPORT_C TInt GetUserLen();
1.70
1.71 @@ -79,12 +91,30 @@
1.72
1.73 class TConnSnapPref : public TConnPref
1.74 /**
1.75 -An instance of the class is passed to RConnection::Start when user wants to start connection based on
1.76 -Service Network Access Point that represents a collection of AP to try out.
1.77 +An instance of the class is passed to RConnection::Start when user wants to start connection using
1.78 +a Service Network Access Point. A Service Network Access Point is an access point in the KAfInet
1.79 +tier.
1.80 +
1.81 +A list of available access points can be retrieved from CommsDat using CCDAccessPointRecord. It is
1.82 +recommended that users only attempt to start access points whose tier is KAfInet. Access points in
1.83 +the KAfInet can use multiple access points on lower tiers to access the internet.
1.84 +
1.85 +@code
1.86 +RConnection conn;
1.87 +User::LeaveIfError(conn.Open(sockSvr));
1.88 +CleanupClosePushL(conn);
1.89 +
1.90 +TCommSnapPref pref(52);
1.91 +
1.92 +TInt error = conn.Start(pref);
1.93 +@endcode
1.94 +
1.95 +@see CommsDat::CCDAccessPointRecord
1.96 +@see RConnection::Start
1.97 +@see TConnAPPref
1.98
1.99 @publishedAll
1.100 @released since v9.1
1.101 -@see RConnection::Start
1.102 */
1.103 {
1.104 public:
1.105 @@ -95,4 +125,59 @@
1.106 IMPORT_C TUint32 Snap() const;
1.107 };
1.108
1.109 +class TConnPrefList : public TConnPref
1.110 +/**
1.111 +This class is used to send a collection of connection preferences expressed
1.112 +as SMetaData objects between RConnection and Comms server which uses them to
1.113 +construct it stack.
1.114 +
1.115 +Each tier will look up the preferences it understands, act of them, consume them
1.116 +if applicable (see individual preferences) and pass the rest down to the next
1.117 +tier.
1.118 +
1.119 +@code
1.120 +RConnection conn;
1.121 +User::LeaveIfError(conn.Open(sockSvr));
1.122 +CleanupClosePushL(conn);
1.123 +
1.124 +TConnPrefList* prefs = TConnPrefList::NewL();
1.125 +CleanupStack::PushL(prefs);
1.126 +TConnAPPref* APPref = TConnAPPref::NewL(aPara->iAp);
1.127 +CleanupStack::PushL(APPref);
1.128 +prefs->AppendL(APPref);
1.129 +
1.130 +error = conn.Start(pref);
1.131 +@endcode
1.132 +
1.133 +@see TConnAPPref
1.134 +@see TConnAutoStartPref
1.135 +@see TConnSnapPref
1.136 +@see RConnection::Start
1.137 +
1.138 +@publishedAll
1.139 +@released
1.140 +*/
1.141 + {
1.142 +public:
1.143 + IMPORT_C static TConnPrefList* NewL();
1.144 + IMPORT_C static TConnPrefList* LoadL(TDesC8& aDes);
1.145 +
1.146 + IMPORT_C TConnPrefList();
1.147 + IMPORT_C ~TConnPrefList();
1.148 +
1.149 + IMPORT_C TInt Length();
1.150 + IMPORT_C TInt Load(TDesC8& aDes);
1.151 + IMPORT_C TInt Store(TDes8& aDes);
1.152 +
1.153 + IMPORT_C void AppendL(SMetaDataECom* aFamily);
1.154 + IMPORT_C SMetaData* operator[](TInt aIndex);
1.155 + IMPORT_C void Remove(TInt aIndex);
1.156 +
1.157 + IMPORT_C TInt Count();
1.158 +
1.159 +private:
1.160 + Meta::RMetaDataEComContainer iPrefs;
1.161 + };
1.162 +
1.163 #endif // __CONNPREF_H__
1.164 +