epoc32/include/es_enum.h
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
equal deleted inserted replaced
3:e1b950c65cb4 4:837f303aceeb
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     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
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     7 //
     8 // Initial Contributors:
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
     9 // Nokia Corporation - initial contribution.
    10 //
    10 //
    11 // Contributors:
    11 // Contributors:
    12 //
    12 //
    13 // Description:
    13 // Description:
    14 //
    14 //
    15 
    15 
       
    16 
       
    17 /**
       
    18  @file
       
    19  @publishedAll
       
    20  @released
       
    21 */
       
    22 
    16 #if !defined (__ES_ENUM_H__)
    23 #if !defined (__ES_ENUM_H__)
    17 #define __ES_ENUM_H__
    24 #define __ES_ENUM_H__
    18 
    25 
    19 #include <e32std.h>
    26 #include <e32std.h>
    20 #include <nifvar.h>
    27 #include <nifvar.h>
    21 #include <es_sock.h>
    28 #include <es_sock.h>
       
    29 
    22 
    30 
    23 class TConnArgBase
    31 class TConnArgBase
    24 /**
    32 /**
    25  * Base class for many arguments to RConnection functions.  Provides versioning information.
    33  * Base class for many arguments to RConnection functions.  Provides versioning information.
    26  * @note Not intended for user instantiation
    34  * @note Not intended for user instantiation
    28  * @released since v7.0s
    36  * @released since v7.0s
    29  */
    37  */
    30 	{
    38 	{
    31 public:
    39 public:
    32 	inline TConnArgBase();
    40 	inline TConnArgBase();
       
    41 	inline TConnArgBase(const TDesC8& aConnectionInfo)
       
    42 	:	iVersion(*((TUint8*)aConnectionInfo.Ptr()))
       
    43 		{
       
    44 		}
    33 	inline TUint8 Version() const;
    45 	inline TUint8 Version() const;
    34 
    46 
    35 protected:
    47 protected:
    36 	inline TConnArgBase(TUint8 aVersion);
    48 	inline TConnArgBase(TUint8 aVersion);
    37 
    49 
    61 @released since v7.0s
    73 @released since v7.0s
    62 */
    74 */
    63 	{
    75 	{
    64 public:
    76 public:
    65 	inline TConnectionInfo();
    77 	inline TConnectionInfo();
    66 	TConnectionInfo(const TDesC8& aConnectionInfo /*as passed to ::Bearer/::NoBearer*/);
    78 	TConnectionInfo(const TDesC8& aConnectionInfo /*as passed to ::Bearer*/);
    67 	inline TConnectionInfo(TUint32 aIapId, TUint32 aNetId);
    79 	inline TConnectionInfo(TUint32 aIapId, TUint32 aNetId);
    68 
    80 
    69 	static TBool IsLocalBearer(const TDesC8& aConnectionInfo);
    81 	static TBool IsLocalBearer(const TDesC8& aConnectionInfo);
    70 	
    82 
       
    83 	inline bool operator == (const TConnectionInfo& aRhs) const;
       
    84 
    71 protected:
    85 protected:
    72 	inline TConnectionInfo(TUint8 aVersion, TUint32 aIapId, TUint32 aNetId);
    86 	inline TConnectionInfo(TUint8 aVersion, TUint32 aIapId, TUint32 aNetId);
    73 
    87 
    74 public:
    88 public:
    75 	TUint32 iIapId;
    89 	TUint32 iIapId;
    76 	TUint32 iNetId;
    90 	TUint32 iNetId;
    77 	};
    91 	};
    78 
    92 
       
    93 const TUint8 KConnArgVersion3 = 3;
       
    94 
       
    95 
    79 /**
    96 /**
    80 @publishedAll
    97 @publishedAll
    81 @released since v7.0s
    98 @released since v7.0s
    82 */
    99 */
    83 typedef TPckgBuf<TConnectionInfo> TConnectionInfoBuf;
   100 typedef TPckgBuf<TConnectionInfo> TConnectionInfoBuf;
    84 
   101 
    85 class TConnectionInfoV2 : public TConnectionInfo
       
    86 /**
       
    87  * Connection information structure (version 2)
       
    88  * Extends basic connection info with connection type information
       
    89  * @publishedPartner
       
    90  * @released since v7.0s
       
    91  * @see TConnectionInfo
       
    92 */
       
    93 	{
       
    94 public:
       
    95 	inline TConnectionInfoV2();
       
    96 	inline TConnectionInfoV2(TUint32 aIapId, TUint32 aNetId, TConnectionType aConnectionType);
       
    97 	inline TConnectionType ConnectionType();
       
    98 
   102 
    99 protected:
       
   100 	inline TConnectionInfoV2(TUint8 aVersion, TUint32 aIapId, TUint32 aNetId, TConnectionType aConnectionType);
       
   101 
   103 
   102 private:
       
   103 	TConnectionType iConnectionType;
       
   104 	};
       
   105 
       
   106 /**
       
   107 @publishedPartner
       
   108 @released since v7.0s
       
   109 */
       
   110 typedef TPckgBuf<TConnectionInfoV2> TConnectionInfoV2Buf;
       
   111 
       
   112 class TSubConnectionInfo : public TConnArgBase
       
   113 /**
       
   114  * Base class for information about a subconnection
       
   115  * @publishedPartner
       
   116  * @released since v7.0s
       
   117  * @note Classes for information about a specific connection type should derive from this class
       
   118  * @note Generic classes for most bearers are defined in nifconninfo.h
       
   119  * @note Classes with increasingly specific parameters for a connection type should derive from the more generic class of the same connection type, as clients can assume that any less specific TSubConnectionInfo-derived classes are acceptable for use in GetSubConnectionInfo() calls.
       
   120  */
       
   121 	{
       
   122 public:
       
   123 	inline TSubConnectionInfo();
       
   124 
       
   125 public:
       
   126 	TSubConnectionUniqueId iSubConnectionUniqueId;
       
   127 	TConnectionType iConnectionType;
       
   128 	TTime iTimeStarted;
       
   129 	};
       
   130 
   104 
   131 /**
   105 /**
   132 The following classes are used with RConnection::AllInterfaceNotification() to receive information
   106 The following classes are used with RConnection::AllInterfaceNotification() to receive information
   133 about interfaces coming up and going down.
   107 about interfaces coming up and going down.
   134 */
   108 */
   152 public:
   126 public:
   153 	TConnectionInfo iConnectionInfo;
   127 	TConnectionInfo iConnectionInfo;
   154 	TConnInterfaceState iState;
   128 	TConnInterfaceState iState;
   155 	};
   129 	};
   156 
   130 
   157 /**
       
   158 @internalTechnology
       
   159 */
       
   160 typedef TPckgBuf<TInterfaceNotification> TInterfaceNotificationBuf;
       
   161 
   131 
   162 /**
   132 /**
   163 Types of events that can occur on a subconnection
   133 Types of events that can occur on a subconnection
   164 
   134 
   165 @publishedAll
   135 @publishedAll
   170  * Types of events that can occur on a subconnection
   140  * Types of events that can occur on a subconnection
   171  * @publishedPartner
   141  * @publishedPartner
   172  * @released since v7.0s
   142  * @released since v7.0s
   173  */
   143  */
   174 	{
   144 	{
   175 	ESubConnectionOpened,           ///< Connection values 0-9999 for agent-based events
   145 	ESubConnectionOpened,           //< Connection values 0-9999 for agent-based events
   176 	ESubConnectionClosed,           ///< Connection values 0-9999 for agent-based events
   146 	ESubConnectionClosed,           //< Connection values 0-9999 for agent-based events
   177 	ESubConnectionQoSChanged = 1000 ///< Connection values 10000-19999 for nif-based events
   147 	ESubConnectionQoSChanged = 1000 //< Connection values 10000-19999 for nif-based events
   178 	};
   148 	};
   179 
   149 
   180 class TSubConnectionEvent
   150 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
   181 /**
   151 #include <es_enum_partner.h>
   182  * Base class for structures that provide information related to a specific subconnection event
   152 #include <es_enum_internal.h>
   183  * @note Classes derived from this must not exceed KMaxSubConnectionEventSize bytes in size
   153 #endif
   184  * @publishedPartner
       
   185  * @released since v7.0s
       
   186  */
       
   187 	{
       
   188 public:
       
   189 	IMPORT_C TSubConnectionEvent* CloneL() const;
       
   190 	IMPORT_C TUint Length() const;
       
   191 
       
   192 protected:
       
   193 	IMPORT_C TSubConnectionEvent(TSubConnectionEventType aEventType, TUint aLength);
       
   194 public:
       
   195 	TSubConnectionUniqueId iSubConnectionUniqueId;
       
   196 	TSubConnectionEventType iEventType;
       
   197 protected:
       
   198 	TUint iLength;
       
   199 	};
       
   200 
       
   201 class TSubConnectionOpenedEvent : public TSubConnectionEvent
       
   202 /**
       
   203  * Information about a subconnection that has just been opened
       
   204  * @publishedPartner
       
   205  * @released since v7.0s
       
   206  * @note This class currently not passed to clients, as it is (essentially) empty
       
   207  */
       
   208 	{
       
   209 public:
       
   210 	IMPORT_C TSubConnectionOpenedEvent();
       
   211 	};
       
   212 
       
   213 class TSubConnectionClosedEvent : public TSubConnectionEvent
       
   214 /**
       
   215  * Information about a subconnection that has just been closed
       
   216  * @publishedPartner
       
   217  * @released since v7.0s
       
   218  * @note The time closed uses universal time as a time zone
       
   219  */
       
   220 	{
       
   221 public:
       
   222 	IMPORT_C TSubConnectionClosedEvent();
       
   223 public:
       
   224 	TUint iTotalUplinkDataVolume;
       
   225 	TUint iTotalDownlinkDataVolume;
       
   226 	TTime iTimeClosed;	// universal time
       
   227 	};
       
   228 
       
   229 class TSubConnectionQoSChangedEvent : public TSubConnectionEvent
       
   230 /**
       
   231  * Information about a subconnection on which the QoS settings have just changed. This only signals that QoS has changed. If the client wants to know what has changed should then get TSubConnectionInfo
       
   232  * @publishedPartner
       
   233  * @released since v7.0s
       
   234  * @note This will be produced by NIFs when QoS changes
       
   235  */
       
   236 	{
       
   237 public:
       
   238 	IMPORT_C TSubConnectionQoSChangedEvent();
       
   239 	};
       
   240 
       
   241 /**
       
   242 @internalTechnology
       
   243 */
       
   244 typedef TPckgBuf<TInterfaceNotification> TInterfaceNotificationBuf;
       
   245 
       
   246 
       
   247 /**
       
   248 The following classes are used to enumerate clients and sockets associated with a 
       
   249 particular connection.  RConnection::Control() is used to retrieve this information.
       
   250 */
       
   251 
       
   252 class TConnectionEnumArg : public TConnArgBase
       
   253 /**
       
   254 for KCoEnumerateConnectionClients and KCoEnumerateConnectionSockets
       
   255 @publishedPartner
       
   256 @released since v7.0s
       
   257 */
       
   258 	{
       
   259 public:
       
   260 	inline TConnectionEnumArg();
       
   261 public:
       
   262 	TUint iIndex;
       
   263 	TUint iCount;
       
   264 	};
       
   265 
       
   266 /**
       
   267 @internalComponent
       
   268 */
       
   269 typedef TPckgBuf<TConnectionEnumArg> TConnEnumArgBuf;
       
   270 
       
   271 class TConnectionClientInfo
       
   272 /**
       
   273 @publishedPartner
       
   274 @released since v7.0s
       
   275 */
       
   276 	{
       
   277 public:
       
   278 	inline TConnectionClientInfo();
       
   279 	inline TConnectionClientInfo(TUint aProcId, TUint aUid, TUint aThreadId);
       
   280 public:
       
   281 	TProcessId iProcessId;
       
   282 	TUid iUid;
       
   283 	TThreadId iThreadId;
       
   284 	};
       
   285 
       
   286 class TConnectionGetClientInfoArg : public TConnArgBase
       
   287 /**
       
   288 for KCoGetConnectionClientInfo
       
   289 @publishedPartner
       
   290 @released since v7.0s
       
   291 */
       
   292 	{
       
   293 public:
       
   294 	inline TConnectionGetClientInfoArg();
       
   295 public:
       
   296 	TUint iIndex;
       
   297 	TConnectionClientInfo iClientInfo;
       
   298 	};
       
   299 
       
   300 /**
       
   301 @internalComponent
       
   302 */
       
   303 typedef TPckgBuf<TConnectionGetClientInfoArg> TConnGetClientInfoArgBuf;
       
   304 
       
   305 class TConnectionSocketInfo
       
   306 /**
       
   307 @internalComponent
       
   308 */
       
   309 	{
       
   310 public:
       
   311 	inline TConnectionSocketInfo();
       
   312 public:
       
   313 	TUint iAddressFamily;
       
   314 	TUint iProtocol;
       
   315 	TSockAddr iSourceAddress;
       
   316 	TSockAddr iDestinationAddress;
       
   317 	};
       
   318 
       
   319 class TConnectionGetSocketInfoArg : public TConnArgBase
       
   320 /**
       
   321 for KCoGetConnectionSocketInfo
       
   322 
       
   323 @internalComponent
       
   324 */
       
   325 	{
       
   326 public:
       
   327 	TConnectionGetSocketInfoArg();
       
   328 public:
       
   329 	TUint iIndex;
       
   330 	TConnectionSocketInfo iSocketInfo;
       
   331 	};
       
   332 
       
   333 /**
       
   334 @internalComponent
       
   335 */
       
   336 typedef TPckgBuf<TConnectionGetSocketInfoArg> TConnGetSocketInfoArgBuf;
       
   337 
   154 
   338 #include <es_enum.inl>
   155 #include <es_enum.inl>
   339 
   156 
       
   157 
   340 #endif // __ES_ENUM_H__
   158 #endif // __ES_ENUM_H__
       
   159