epoc32/include/connpref.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #if !(defined __CONNPREF_H__)
    17 #define __CONNPREF_H__
    18 
    19 #define TCommSnapPref TConnSnapPref
    20 #include <e32std.h>
    21 
    22 /**
    23 @publishedAll
    24 @released since v7.0s
    25 */
    26 const TUint KMaxConnPrefSize = 0x40;
    27 
    28 /**
    29 @internalTechnology
    30 */
    31 struct SConnPref
    32 	{
    33 	TInt16 iExtensionId; ///< Extension ID
    34 	TInt16 iSpare;
    35 	};
    36 
    37 class TConnPref : public TBuf8<KMaxConnPrefSize>
    38 /**
    39 Overrides the connection preferences.
    40 @publishedAll
    41 @released since v7.0s
    42 */
    43 	{
    44 public:
    45 	enum
    46 		{
    47 		EConnPrefUnknown = 0x00,     ///< Unknown Connection preference
    48 		EConnPrefCommDb = 0x01,      ///< CommDb Connection preference
    49 		EConnPrefCommDbMulti = 0x02, ///< CommDbMulti Connection preferenc
    50 		EConnPrefSnap = 0x03,
    51 		EConnPrefIdList = 0x04,
    52 		EConnPrefSip = 0x05          ///< Sip Connection preference
    53 		};
    54 
    55 	IMPORT_C TConnPref();
    56 	IMPORT_C TConnPref(TInt aExtensionId);
    57 	
    58 	IMPORT_C TInt ExtensionId() const;
    59 	IMPORT_C TInt GetUserLen();
    60 
    61 protected:
    62 	IMPORT_C void SetExtensionId(TInt aExtensionId);
    63 	IMPORT_C void SetUserLen(TInt aLen);
    64 	inline TUint8* UserPtr() const;
    65 
    66 private:
    67 	inline SConnPref* BasePtr() const;
    68 	};
    69 
    70 inline SConnPref* TConnPref::BasePtr() const
    71 	{
    72 	return (SConnPref*)iBuf;
    73 	}
    74 
    75 inline TUint8* TConnPref::UserPtr() const
    76 	{
    77 	return (TUint8*)(BasePtr()+1);
    78 	}
    79 
    80 class TConnSnapPref : public TConnPref
    81 /**
    82 An instance of the class is passed to RConnection::Start when user wants to start connection based on
    83 Service Network Access Point that represents a collection of AP to try out.
    84 
    85 @publishedAll
    86 @released since v9.1
    87 @see RConnection::Start
    88 */
    89 	{
    90 public:
    91 	IMPORT_C TConnSnapPref();
    92 	IMPORT_C TConnSnapPref(TUint32 aSnap);
    93 
    94 	IMPORT_C void SetSnap(TUint32 aSnap);
    95 	IMPORT_C TUint32 Snap() const;
    96 	};
    97 
    98 #endif // __CONNPREF_H__