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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #if !defined (__ES_ENUM_H__)
25 * Base class for many arguments to RConnection functions. Provides versioning information.
26 * @note Not intended for user instantiation
28 * @released since v7.0s
32 inline TConnArgBase();
33 inline TUint8 Version() const;
36 inline TConnArgBase(TUint8 aVersion);
44 * Versioning information for connection arguments
46 * @released since v7.0s
48 const TUint8 KConnArgVersion1 = 1;
51 Versioning information for connection arguments
56 const TUint8 KConnArgVersion2 = 2;
58 class TConnectionInfo : public TConnArgBase
65 inline TConnectionInfo();
66 TConnectionInfo(const TDesC8& aConnectionInfo /*as passed to ::Bearer/::NoBearer*/);
67 inline TConnectionInfo(TUint32 aIapId, TUint32 aNetId);
69 static TBool IsLocalBearer(const TDesC8& aConnectionInfo);
72 inline TConnectionInfo(TUint8 aVersion, TUint32 aIapId, TUint32 aNetId);
83 typedef TPckgBuf<TConnectionInfo> TConnectionInfoBuf;
85 class TConnectionInfoV2 : public TConnectionInfo
87 * Connection information structure (version 2)
88 * Extends basic connection info with connection type information
90 * @released since v7.0s
91 * @see TConnectionInfo
95 inline TConnectionInfoV2();
96 inline TConnectionInfoV2(TUint32 aIapId, TUint32 aNetId, TConnectionType aConnectionType);
97 inline TConnectionType ConnectionType();
100 inline TConnectionInfoV2(TUint8 aVersion, TUint32 aIapId, TUint32 aNetId, TConnectionType aConnectionType);
103 TConnectionType iConnectionType;
108 @released since v7.0s
110 typedef TPckgBuf<TConnectionInfoV2> TConnectionInfoV2Buf;
112 class TSubConnectionInfo : public TConnArgBase
114 * Base class for information about a subconnection
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.
123 inline TSubConnectionInfo();
126 TSubConnectionUniqueId iSubConnectionUniqueId;
127 TConnectionType iConnectionType;
132 The following classes are used with RConnection::AllInterfaceNotification() to receive information
133 about interfaces coming up and going down.
138 @released since v7.0s
140 enum TConnInterfaceState
146 class TInterfaceNotification
149 @released since v7.0s
153 TConnectionInfo iConnectionInfo;
154 TConnInterfaceState iState;
160 typedef TPckgBuf<TInterfaceNotification> TInterfaceNotificationBuf;
163 Types of events that can occur on a subconnection
168 enum TSubConnectionEventType
170 * Types of events that can occur on a subconnection
172 * @released since v7.0s
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
180 class TSubConnectionEvent
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
185 * @released since v7.0s
189 IMPORT_C TSubConnectionEvent* CloneL() const;
190 IMPORT_C TUint Length() const;
193 IMPORT_C TSubConnectionEvent(TSubConnectionEventType aEventType, TUint aLength);
195 TSubConnectionUniqueId iSubConnectionUniqueId;
196 TSubConnectionEventType iEventType;
201 class TSubConnectionOpenedEvent : public TSubConnectionEvent
203 * Information about a subconnection that has just been opened
205 * @released since v7.0s
206 * @note This class currently not passed to clients, as it is (essentially) empty
210 IMPORT_C TSubConnectionOpenedEvent();
213 class TSubConnectionClosedEvent : public TSubConnectionEvent
215 * Information about a subconnection that has just been closed
217 * @released since v7.0s
218 * @note The time closed uses universal time as a time zone
222 IMPORT_C TSubConnectionClosedEvent();
224 TUint iTotalUplinkDataVolume;
225 TUint iTotalDownlinkDataVolume;
226 TTime iTimeClosed; // universal time
229 class TSubConnectionQoSChangedEvent : public TSubConnectionEvent
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
233 * @released since v7.0s
234 * @note This will be produced by NIFs when QoS changes
238 IMPORT_C TSubConnectionQoSChangedEvent();
244 typedef TPckgBuf<TInterfaceNotification> TInterfaceNotificationBuf;
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.
252 class TConnectionEnumArg : public TConnArgBase
254 for KCoEnumerateConnectionClients and KCoEnumerateConnectionSockets
256 @released since v7.0s
260 inline TConnectionEnumArg();
269 typedef TPckgBuf<TConnectionEnumArg> TConnEnumArgBuf;
271 class TConnectionClientInfo
274 @released since v7.0s
278 inline TConnectionClientInfo();
279 inline TConnectionClientInfo(TUint aProcId, TUint aUid, TUint aThreadId);
281 TProcessId iProcessId;
286 class TConnectionGetClientInfoArg : public TConnArgBase
288 for KCoGetConnectionClientInfo
290 @released since v7.0s
294 inline TConnectionGetClientInfoArg();
297 TConnectionClientInfo iClientInfo;
303 typedef TPckgBuf<TConnectionGetClientInfoArg> TConnGetClientInfoArgBuf;
305 class TConnectionSocketInfo
311 inline TConnectionSocketInfo();
313 TUint iAddressFamily;
315 TSockAddr iSourceAddress;
316 TSockAddr iDestinationAddress;
319 class TConnectionGetSocketInfoArg : public TConnArgBase
321 for KCoGetConnectionSocketInfo
327 TConnectionGetSocketInfoArg();
330 TConnectionSocketInfo iSocketInfo;
336 typedef TPckgBuf<TConnectionGetSocketInfoArg> TConnGetSocketInfoArgBuf;
338 #include <es_enum.inl>
340 #endif // __ES_ENUM_H__