epoc32/include/es_enum.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/es_enum.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/es_enum.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,340 @@
     1.4 -es_enum.h
     1.5 +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// 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.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +#if !defined (__ES_ENUM_H__)
    1.21 +#define __ES_ENUM_H__
    1.22 +
    1.23 +#include <e32std.h>
    1.24 +#include <nifvar.h>
    1.25 +#include <es_sock.h>
    1.26 +
    1.27 +class TConnArgBase
    1.28 +/**
    1.29 + * Base class for many arguments to RConnection functions.  Provides versioning information.
    1.30 + * @note Not intended for user instantiation
    1.31 + * @publishedAll
    1.32 + * @released since v7.0s
    1.33 + */
    1.34 +	{
    1.35 +public:
    1.36 +	inline TConnArgBase();
    1.37 +	inline TUint8 Version() const;
    1.38 +
    1.39 +protected:
    1.40 +	inline TConnArgBase(TUint8 aVersion);
    1.41 +
    1.42 +protected:
    1.43 +	TUint8 iVersion;
    1.44 +	TUint8 iReserved[3];
    1.45 +	};
    1.46 +
    1.47 +/**
    1.48 + * Versioning information for connection arguments
    1.49 + * @publishedAll
    1.50 + * @released since v7.0s
    1.51 + */
    1.52 +const TUint8 KConnArgVersion1 = 1;
    1.53 +
    1.54 +/**
    1.55 +Versioning information for connection arguments
    1.56 +
    1.57 +@publishedAll
    1.58 +@released
    1.59 +*/
    1.60 +const TUint8 KConnArgVersion2 = 2;
    1.61 +
    1.62 +class TConnectionInfo : public TConnArgBase
    1.63 +/**
    1.64 +@publishedAll
    1.65 +@released since v7.0s
    1.66 +*/
    1.67 +	{
    1.68 +public:
    1.69 +	inline TConnectionInfo();
    1.70 +	TConnectionInfo(const TDesC8& aConnectionInfo /*as passed to ::Bearer/::NoBearer*/);
    1.71 +	inline TConnectionInfo(TUint32 aIapId, TUint32 aNetId);
    1.72 +
    1.73 +	static TBool IsLocalBearer(const TDesC8& aConnectionInfo);
    1.74 +	
    1.75 +protected:
    1.76 +	inline TConnectionInfo(TUint8 aVersion, TUint32 aIapId, TUint32 aNetId);
    1.77 +
    1.78 +public:
    1.79 +	TUint32 iIapId;
    1.80 +	TUint32 iNetId;
    1.81 +	};
    1.82 +
    1.83 +/**
    1.84 +@publishedAll
    1.85 +@released since v7.0s
    1.86 +*/
    1.87 +typedef TPckgBuf<TConnectionInfo> TConnectionInfoBuf;
    1.88 +
    1.89 +class TConnectionInfoV2 : public TConnectionInfo
    1.90 +/**
    1.91 + * Connection information structure (version 2)
    1.92 + * Extends basic connection info with connection type information
    1.93 + * @publishedPartner
    1.94 + * @released since v7.0s
    1.95 + * @see TConnectionInfo
    1.96 +*/
    1.97 +	{
    1.98 +public:
    1.99 +	inline TConnectionInfoV2();
   1.100 +	inline TConnectionInfoV2(TUint32 aIapId, TUint32 aNetId, TConnectionType aConnectionType);
   1.101 +	inline TConnectionType ConnectionType();
   1.102 +
   1.103 +protected:
   1.104 +	inline TConnectionInfoV2(TUint8 aVersion, TUint32 aIapId, TUint32 aNetId, TConnectionType aConnectionType);
   1.105 +
   1.106 +private:
   1.107 +	TConnectionType iConnectionType;
   1.108 +	};
   1.109 +
   1.110 +/**
   1.111 +@publishedPartner
   1.112 +@released since v7.0s
   1.113 +*/
   1.114 +typedef TPckgBuf<TConnectionInfoV2> TConnectionInfoV2Buf;
   1.115 +
   1.116 +class TSubConnectionInfo : public TConnArgBase
   1.117 +/**
   1.118 + * Base class for information about a subconnection
   1.119 + * @publishedPartner
   1.120 + * @released since v7.0s
   1.121 + * @note Classes for information about a specific connection type should derive from this class
   1.122 + * @note Generic classes for most bearers are defined in nifconninfo.h
   1.123 + * @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.
   1.124 + */
   1.125 +	{
   1.126 +public:
   1.127 +	inline TSubConnectionInfo();
   1.128 +
   1.129 +public:
   1.130 +	TSubConnectionUniqueId iSubConnectionUniqueId;
   1.131 +	TConnectionType iConnectionType;
   1.132 +	TTime iTimeStarted;
   1.133 +	};
   1.134 +
   1.135 +/**
   1.136 +The following classes are used with RConnection::AllInterfaceNotification() to receive information
   1.137 +about interfaces coming up and going down.
   1.138 +*/
   1.139 +
   1.140 +/**
   1.141 +@publishedAll
   1.142 +@released since v7.0s
   1.143 +*/
   1.144 +enum TConnInterfaceState
   1.145 +	{
   1.146 +	EInterfaceUp,
   1.147 +	EInterfaceDown
   1.148 +	};
   1.149 +
   1.150 +class TInterfaceNotification
   1.151 +/**
   1.152 +@publishedAll
   1.153 +@released since v7.0s
   1.154 +*/
   1.155 +	{
   1.156 +public:
   1.157 +	TConnectionInfo iConnectionInfo;
   1.158 +	TConnInterfaceState iState;
   1.159 +	};
   1.160 +
   1.161 +/**
   1.162 +@internalTechnology
   1.163 +*/
   1.164 +typedef TPckgBuf<TInterfaceNotification> TInterfaceNotificationBuf;
   1.165 +
   1.166 +/**
   1.167 +Types of events that can occur on a subconnection
   1.168 +
   1.169 +@publishedAll
   1.170 +@released
   1.171 +*/
   1.172 +enum TSubConnectionEventType
   1.173 +/**
   1.174 + * Types of events that can occur on a subconnection
   1.175 + * @publishedPartner
   1.176 + * @released since v7.0s
   1.177 + */
   1.178 +	{
   1.179 +	ESubConnectionOpened,           ///< Connection values 0-9999 for agent-based events
   1.180 +	ESubConnectionClosed,           ///< Connection values 0-9999 for agent-based events
   1.181 +	ESubConnectionQoSChanged = 1000 ///< Connection values 10000-19999 for nif-based events
   1.182 +	};
   1.183 +
   1.184 +class TSubConnectionEvent
   1.185 +/**
   1.186 + * Base class for structures that provide information related to a specific subconnection event
   1.187 + * @note Classes derived from this must not exceed KMaxSubConnectionEventSize bytes in size
   1.188 + * @publishedPartner
   1.189 + * @released since v7.0s
   1.190 + */
   1.191 +	{
   1.192 +public:
   1.193 +	IMPORT_C TSubConnectionEvent* CloneL() const;
   1.194 +	IMPORT_C TUint Length() const;
   1.195 +
   1.196 +protected:
   1.197 +	IMPORT_C TSubConnectionEvent(TSubConnectionEventType aEventType, TUint aLength);
   1.198 +public:
   1.199 +	TSubConnectionUniqueId iSubConnectionUniqueId;
   1.200 +	TSubConnectionEventType iEventType;
   1.201 +protected:
   1.202 +	TUint iLength;
   1.203 +	};
   1.204 +
   1.205 +class TSubConnectionOpenedEvent : public TSubConnectionEvent
   1.206 +/**
   1.207 + * Information about a subconnection that has just been opened
   1.208 + * @publishedPartner
   1.209 + * @released since v7.0s
   1.210 + * @note This class currently not passed to clients, as it is (essentially) empty
   1.211 + */
   1.212 +	{
   1.213 +public:
   1.214 +	IMPORT_C TSubConnectionOpenedEvent();
   1.215 +	};
   1.216 +
   1.217 +class TSubConnectionClosedEvent : public TSubConnectionEvent
   1.218 +/**
   1.219 + * Information about a subconnection that has just been closed
   1.220 + * @publishedPartner
   1.221 + * @released since v7.0s
   1.222 + * @note The time closed uses universal time as a time zone
   1.223 + */
   1.224 +	{
   1.225 +public:
   1.226 +	IMPORT_C TSubConnectionClosedEvent();
   1.227 +public:
   1.228 +	TUint iTotalUplinkDataVolume;
   1.229 +	TUint iTotalDownlinkDataVolume;
   1.230 +	TTime iTimeClosed;	// universal time
   1.231 +	};
   1.232 +
   1.233 +class TSubConnectionQoSChangedEvent : public TSubConnectionEvent
   1.234 +/**
   1.235 + * 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
   1.236 + * @publishedPartner
   1.237 + * @released since v7.0s
   1.238 + * @note This will be produced by NIFs when QoS changes
   1.239 + */
   1.240 +	{
   1.241 +public:
   1.242 +	IMPORT_C TSubConnectionQoSChangedEvent();
   1.243 +	};
   1.244 +
   1.245 +/**
   1.246 +@internalTechnology
   1.247 +*/
   1.248 +typedef TPckgBuf<TInterfaceNotification> TInterfaceNotificationBuf;
   1.249 +
   1.250 +
   1.251 +/**
   1.252 +The following classes are used to enumerate clients and sockets associated with a 
   1.253 +particular connection.  RConnection::Control() is used to retrieve this information.
   1.254 +*/
   1.255 +
   1.256 +class TConnectionEnumArg : public TConnArgBase
   1.257 +/**
   1.258 +for KCoEnumerateConnectionClients and KCoEnumerateConnectionSockets
   1.259 +@publishedPartner
   1.260 +@released since v7.0s
   1.261 +*/
   1.262 +	{
   1.263 +public:
   1.264 +	inline TConnectionEnumArg();
   1.265 +public:
   1.266 +	TUint iIndex;
   1.267 +	TUint iCount;
   1.268 +	};
   1.269 +
   1.270 +/**
   1.271 +@internalComponent
   1.272 +*/
   1.273 +typedef TPckgBuf<TConnectionEnumArg> TConnEnumArgBuf;
   1.274 +
   1.275 +class TConnectionClientInfo
   1.276 +/**
   1.277 +@publishedPartner
   1.278 +@released since v7.0s
   1.279 +*/
   1.280 +	{
   1.281 +public:
   1.282 +	inline TConnectionClientInfo();
   1.283 +	inline TConnectionClientInfo(TUint aProcId, TUint aUid, TUint aThreadId);
   1.284 +public:
   1.285 +	TProcessId iProcessId;
   1.286 +	TUid iUid;
   1.287 +	TThreadId iThreadId;
   1.288 +	};
   1.289 +
   1.290 +class TConnectionGetClientInfoArg : public TConnArgBase
   1.291 +/**
   1.292 +for KCoGetConnectionClientInfo
   1.293 +@publishedPartner
   1.294 +@released since v7.0s
   1.295 +*/
   1.296 +	{
   1.297 +public:
   1.298 +	inline TConnectionGetClientInfoArg();
   1.299 +public:
   1.300 +	TUint iIndex;
   1.301 +	TConnectionClientInfo iClientInfo;
   1.302 +	};
   1.303 +
   1.304 +/**
   1.305 +@internalComponent
   1.306 +*/
   1.307 +typedef TPckgBuf<TConnectionGetClientInfoArg> TConnGetClientInfoArgBuf;
   1.308 +
   1.309 +class TConnectionSocketInfo
   1.310 +/**
   1.311 +@internalComponent
   1.312 +*/
   1.313 +	{
   1.314 +public:
   1.315 +	inline TConnectionSocketInfo();
   1.316 +public:
   1.317 +	TUint iAddressFamily;
   1.318 +	TUint iProtocol;
   1.319 +	TSockAddr iSourceAddress;
   1.320 +	TSockAddr iDestinationAddress;
   1.321 +	};
   1.322 +
   1.323 +class TConnectionGetSocketInfoArg : public TConnArgBase
   1.324 +/**
   1.325 +for KCoGetConnectionSocketInfo
   1.326 +
   1.327 +@internalComponent
   1.328 +*/
   1.329 +	{
   1.330 +public:
   1.331 +	TConnectionGetSocketInfoArg();
   1.332 +public:
   1.333 +	TUint iIndex;
   1.334 +	TConnectionSocketInfo iSocketInfo;
   1.335 +	};
   1.336 +
   1.337 +/**
   1.338 +@internalComponent
   1.339 +*/
   1.340 +typedef TPckgBuf<TConnectionGetSocketInfoArg> TConnGetSocketInfoArgBuf;
   1.341 +
   1.342 +#include <es_enum.inl>
   1.343 +
   1.344 +#endif // __ES_ENUM_H__