epoc32/include/es_enum.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 (__ES_ENUM_H__)
    17 #define __ES_ENUM_H__
    18 
    19 #include <e32std.h>
    20 #include <nifvar.h>
    21 #include <es_sock.h>
    22 
    23 class TConnArgBase
    24 /**
    25  * Base class for many arguments to RConnection functions.  Provides versioning information.
    26  * @note Not intended for user instantiation
    27  * @publishedAll
    28  * @released since v7.0s
    29  */
    30 	{
    31 public:
    32 	inline TConnArgBase();
    33 	inline TUint8 Version() const;
    34 
    35 protected:
    36 	inline TConnArgBase(TUint8 aVersion);
    37 
    38 protected:
    39 	TUint8 iVersion;
    40 	TUint8 iReserved[3];
    41 	};
    42 
    43 /**
    44  * Versioning information for connection arguments
    45  * @publishedAll
    46  * @released since v7.0s
    47  */
    48 const TUint8 KConnArgVersion1 = 1;
    49 
    50 /**
    51 Versioning information for connection arguments
    52 
    53 @publishedAll
    54 @released
    55 */
    56 const TUint8 KConnArgVersion2 = 2;
    57 
    58 class TConnectionInfo : public TConnArgBase
    59 /**
    60 @publishedAll
    61 @released since v7.0s
    62 */
    63 	{
    64 public:
    65 	inline TConnectionInfo();
    66 	TConnectionInfo(const TDesC8& aConnectionInfo /*as passed to ::Bearer/::NoBearer*/);
    67 	inline TConnectionInfo(TUint32 aIapId, TUint32 aNetId);
    68 
    69 	static TBool IsLocalBearer(const TDesC8& aConnectionInfo);
    70 	
    71 protected:
    72 	inline TConnectionInfo(TUint8 aVersion, TUint32 aIapId, TUint32 aNetId);
    73 
    74 public:
    75 	TUint32 iIapId;
    76 	TUint32 iNetId;
    77 	};
    78 
    79 /**
    80 @publishedAll
    81 @released since v7.0s
    82 */
    83 typedef TPckgBuf<TConnectionInfo> TConnectionInfoBuf;
    84 
    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 
    99 protected:
   100 	inline TConnectionInfoV2(TUint8 aVersion, TUint32 aIapId, TUint32 aNetId, TConnectionType aConnectionType);
   101 
   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 
   131 /**
   132 The following classes are used with RConnection::AllInterfaceNotification() to receive information
   133 about interfaces coming up and going down.
   134 */
   135 
   136 /**
   137 @publishedAll
   138 @released since v7.0s
   139 */
   140 enum TConnInterfaceState
   141 	{
   142 	EInterfaceUp,
   143 	EInterfaceDown
   144 	};
   145 
   146 class TInterfaceNotification
   147 /**
   148 @publishedAll
   149 @released since v7.0s
   150 */
   151 	{
   152 public:
   153 	TConnectionInfo iConnectionInfo;
   154 	TConnInterfaceState iState;
   155 	};
   156 
   157 /**
   158 @internalTechnology
   159 */
   160 typedef TPckgBuf<TInterfaceNotification> TInterfaceNotificationBuf;
   161 
   162 /**
   163 Types of events that can occur on a subconnection
   164 
   165 @publishedAll
   166 @released
   167 */
   168 enum TSubConnectionEventType
   169 /**
   170  * Types of events that can occur on a subconnection
   171  * @publishedPartner
   172  * @released since v7.0s
   173  */
   174 	{
   175 	ESubConnectionOpened,           ///< Connection values 0-9999 for agent-based events
   176 	ESubConnectionClosed,           ///< Connection values 0-9999 for agent-based events
   177 	ESubConnectionQoSChanged = 1000 ///< Connection values 10000-19999 for nif-based events
   178 	};
   179 
   180 class TSubConnectionEvent
   181 /**
   182  * Base class for structures that provide information related to a specific subconnection event
   183  * @note Classes derived from this must not exceed KMaxSubConnectionEventSize bytes in size
   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 
   338 #include <es_enum.inl>
   339 
   340 #endif // __ES_ENUM_H__