epoc32/include/mmf/common/mmfcontrollerframeworkbase.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
child 4 837f303aceeb
     1.1 --- a/epoc32/include/mmf/common/mmfcontrollerframeworkbase.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/mmf/common/mmfcontrollerframeworkbase.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,434 @@
     1.4 -mmfcontrollerframeworkbase.h
     1.5 +// Copyright (c) 2002-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 +
    1.21 +#ifndef __MMFCONTROLLERFRAMEWORKBASE_H__
    1.22 +#define __MMFCONTROLLERFRAMEWORKBASE_H__
    1.23 +
    1.24 +#include <e32base.h>
    1.25 +#include <e32std.h>
    1.26 +#include <s32mem.h>
    1.27 +
    1.28 +/**
    1.29 +@publishedAll
    1.30 +@released
    1.31 +
    1.32 +Constant that can be passed into the client API OpenURL() interfaces (as the aIapId parameter)
    1.33 +to request that the default Internet Access Point be used.
    1.34 +*/
    1.35 +const TInt KUseDefaultIap = -1;
    1.36 +
    1.37 +
    1.38 +/**
    1.39 +@publishedAll
    1.40 +@released
    1.41 +
    1.42 +General purpose class to describe an event.
    1.43 +
    1.44 +Contains a UID to define the actual event type, and an integer to define the event code.
    1.45 +
    1.46 +Controller plugins can define their own event types, but should use
    1.47 +KMMFErrorCategoryControllerGeneralError for any errors that can be described by
    1.48 +the standard system-wide error codes.
    1.49 +
    1.50 +@since 7.0s
    1.51 +*/
    1.52 +class TMMFEvent
    1.53 +	{
    1.54 +public:
    1.55 +
    1.56 +	/**
    1.57 +	Constructor.
    1.58 +	
    1.59 +	@param  aEventType
    1.60 +	        A UID to define the type of event.
    1.61 +	@param  aErrorCode
    1.62 +	        The error code associated with the event.
    1.63 +
    1.64 +	@since 7.0s
    1.65 +	*/
    1.66 +	IMPORT_C TMMFEvent(TUid aEventType, TInt aErrorCode);
    1.67 +
    1.68 +	/**
    1.69 +	Default constructor.
    1.70 +	
    1.71 +	Provided so this class can be packaged in a TPckgBuf<>.
    1.72 +	@since 7.0s
    1.73 +	*/
    1.74 +	IMPORT_C TMMFEvent();
    1.75 +
    1.76 +	/**
    1.77 +	A UID to define the event type.
    1.78 +	*/
    1.79 +	TUid iEventType;
    1.80 +
    1.81 +	/**
    1.82 +	The error code associated with the event.
    1.83 +	*/
    1.84 +	TInt iErrorCode;
    1.85 +private:
    1.86 +	/**
    1.87 +	This member is internal and not intended for use.
    1.88 +	*/
    1.89 +	TInt iReserved1;
    1.90 +	};
    1.91 +
    1.92 +/**
    1.93 +@publishedAll
    1.94 +@released
    1.95 +
    1.96 +Package buffer for TMMFEvent
    1.97 +*/
    1.98 +typedef TPckgBuf<TMMFEvent> TMMFEventPckg;
    1.99 +
   1.100 +/**
   1.101 +@publishedAll
   1.102 +@released
   1.103 +
   1.104 +Package buffer for TUid
   1.105 +*/
   1.106 +typedef TPckgBuf<TUid> TMMFUidPckg;
   1.107 +
   1.108 +/**
   1.109 +@publishedAll
   1.110 +@released
   1.111 +
   1.112 +Package buffer for TTimeIntervalMicroSeconds
   1.113 +*/
   1.114 +typedef TPckgBuf<TTimeIntervalMicroSeconds> TMMFTimeIntervalMicroSecondsPckg;
   1.115 +
   1.116 +
   1.117 +/**
   1.118 +@publishedAll
   1.119 +@released
   1.120 +
   1.121 +A piece of meta data.
   1.122 +
   1.123 +Meta data is often contained in the header of multimedia clips and is used to define
   1.124 +attributes such as the author and copyright details.
   1.125 +
   1.126 +Each piece of meta data has a name, or category, and a value.
   1.127 +
   1.128 +@since 7.0s
   1.129 +*/
   1.130 +class CMMFMetaDataEntry : public CBase
   1.131 +	{
   1.132 +public:
   1.133 +
   1.134 +	/**
   1.135 +	Constructs a new meta data object using a name and value.
   1.136 +
   1.137 +	This method can leave with one of the standard system-wide error codes.
   1.138 +
   1.139 +	An example of a name might be:
   1.140 +	@code
   1.141 +	For example, <Copyright>
   1.142 +	@endcode
   1.143 +
   1.144 +	An example of a value might be:
   1.145 +	@code
   1.146 +	<Symbian (c) 2002>
   1.147 +	@endcode
   1.148 +
   1.149 +	@param	aName
   1.150 +	        The name, or category, to be given to this piece of meta data.
   1.151 +	@param  aValue
   1.152 +	        The value of this piece of meta data.
   1.153 +
   1.154 +	@return The newly created meta data object.
   1.155 +
   1.156 +	@since	7.0s
   1.157 +	*/
   1.158 +	IMPORT_C static CMMFMetaDataEntry* NewL(const TDesC& aName, const TDesC& aValue);
   1.159 +
   1.160 +	/**
   1.161 +	Copy constructor. Returns a replica of the meta data passed in.
   1.162 +
   1.163 +	This method can leave with one of the standard system-wide error codes.
   1.164 +
   1.165 +	@param  aOther
   1.166 +	        The meta data to be copied.
   1.167 +
   1.168 +	@return The newly created meta data object.
   1.169 +
   1.170 +	@since	7.0s
   1.171 +	*/
   1.172 +	IMPORT_C static CMMFMetaDataEntry* NewL(const CMMFMetaDataEntry& aOther);
   1.173 +
   1.174 +	/**
   1.175 +	Default constructor. Returns a blank meta data object. To be used when internalizing
   1.176 +	data into the object.
   1.177 +
   1.178 +	This method can leave with one of the standard system-wide error codes.
   1.179 +
   1.180 +	@return  The newly created meta data object.
   1.181 +
   1.182 +	@since	7.0s
   1.183 +	*/
   1.184 +	IMPORT_C static CMMFMetaDataEntry* NewL();
   1.185 +
   1.186 +	/**
   1.187 +	Destructor.
   1.188 +
   1.189 +	@since	7.0s
   1.190 +	*/
   1.191 +	IMPORT_C ~CMMFMetaDataEntry();
   1.192 +
   1.193 +	/**
   1.194 +	Returns the name, or category, of the meta data.
   1.195 +
   1.196 +	@return The name of the meta data object.
   1.197 +
   1.198 +	@since	7.0s
   1.199 +	*/
   1.200 +	IMPORT_C const TDesC& Name() const;
   1.201 +
   1.202 +	/**
   1.203 +	Returns the value field of the meta data.
   1.204 +
   1.205 +	@return The value field of the meta data object.
   1.206 +
   1.207 +	@since  7.0s
   1.208 +	*/
   1.209 +	IMPORT_C const TDesC& Value() const;
   1.210 +
   1.211 +	/**
   1.212 +	Sets the name, or category, of the meta data.
   1.213 +
   1.214 +	This method can leave with one of the standard system-wide error codes.
   1.215 +
   1.216 +	@param  aName
   1.217 +	        The new name of the meta data object
   1.218 +
   1.219 +	@since	7.0s
   1.220 +	*/
   1.221 +	IMPORT_C void SetNameL(const TDesC& aName);
   1.222 +
   1.223 +	/**
   1.224 +	Sets the value field of the meta data.
   1.225 +
   1.226 +	This method can leave with one of the standard system-wide error codes.
   1.227 +
   1.228 +	@param  aValue
   1.229 +	        The new value field of the meta data object
   1.230 +
   1.231 +	@since	7.0s
   1.232 +	*/
   1.233 +	IMPORT_C void SetValueL(const TDesC& aValue);
   1.234 +
   1.235 +	/**
   1.236 +	Writes the data contained within the object to a stream so it can be copied
   1.237 +	over IPC or written to a file.
   1.238 +	
   1.239 +	This method can leave with one of the standard system-wide error codes.
   1.240 +
   1.241 +	@param  aStream
   1.242 +	        The stream to be written to.
   1.243 +
   1.244 +	@since	7.0s
   1.245 +	*/
   1.246 +	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
   1.247 +
   1.248 +	/**
   1.249 +	Reads data from a stream and copies it into this object.  Used when copying
   1.250 +	a meta data object over IPC or reading it from a file.
   1.251 +
   1.252 +	This method can leave with one of the standard system-wide error codes.
   1.253 +
   1.254 +	@param  aStream
   1.255 +	        The stream to be read.
   1.256 +
   1.257 +	@since	7.0s
   1.258 +	*/
   1.259 +	IMPORT_C void InternalizeL(RReadStream& aStream);
   1.260 +private:
   1.261 +
   1.262 +	/**
   1.263 +	Constructor.
   1.264 +
   1.265 +	@since 7.0s
   1.266 +	*/
   1.267 +	CMMFMetaDataEntry();
   1.268 +
   1.269 +	/**
   1.270 +	Second phase constructor.
   1.271 +
   1.272 +	An example of aName might be:
   1.273 +	@code
   1.274 +	<Copyright>
   1.275 +	@endcode
   1.276 +
   1.277 +	An example of aValue might be:
   1.278 +	@code
   1.279 +	<Symbian (c) 2002>
   1.280 +	@endcode
   1.281 +
   1.282 +	This method can leave with one of the standard system-wide error codes.
   1.283 +
   1.284 +	@param  aName
   1.285 +	        The name, or category, to be given to this piece of meta data.
   1.286 +	@param  aValue
   1.287 +	        The value of this piece of meta data.
   1.288 +
   1.289 +	@since	7.0s
   1.290 +	*/
   1.291 +	void ConstructL(const TDesC& aName, const TDesC& aValue);
   1.292 +private:
   1.293 +	/**
   1.294 +	The name, or category, of the meta data.
   1.295 +	*/
   1.296 +	HBufC* iName;
   1.297 +
   1.298 +	/**
   1.299 +	The value of the meta data.
   1.300 +	*/
   1.301 +	HBufC* iValue;
   1.302 +	};
   1.303 +
   1.304 +
   1.305 +
   1.306 +
   1.307 +/**
   1.308 +@publishedAll
   1.309 +@released
   1.310 +
   1.311 +Class to be used to configure a URL source or sink.
   1.312 +
   1.313 +Contains a variable length string to represent the URL, and whether to use a specified
   1.314 +Internet Access Point or use the default.
   1.315 +
   1.316 +@since 7.0s
   1.317 +*/
   1.318 +class CMMFUrlParams : public CBase
   1.319 +	{
   1.320 +public:
   1.321 +
   1.322 +	/**
   1.323 +	Factory function to create a CMMFUrlParams object.
   1.324 +
   1.325 +	This method can leave with one of the standard system-wide error codes.
   1.326 +
   1.327 +	@param  aUrl
   1.328 +	        The url, for example http://www.symbian.com/clip.mpg
   1.329 +	@param  aIAPId
   1.330 +	        The Inernet Access Point to be used.  This should be a valid IAP ID
   1.331 +	        retrieved from CommDB.  A special value of KUseDefaultIap can be used
   1.332 +	        to signify that the plugin should just use the default IAP.
   1.333 +
   1.334 +	@return A pointer to the newly created object.
   1.335 +
   1.336 +	@since	7.0s
   1.337 +	*/
   1.338 +	IMPORT_C static CMMFUrlParams* NewL(const TDesC& aUrl, TInt aIAPId=KUseDefaultIap);
   1.339 +
   1.340 +	/**
   1.341 +	Factory function to create a CMMFUrlParams object.
   1.342 +
   1.343 +	This method can leave with one of the standard system-wide error codes.
   1.344 +
   1.345 +	@param  aUrl
   1.346 +	        The url, for example http://www.symbian.com/clip.mpg
   1.347 +	@param  aIAPId
   1.348 +	        The Inernet Access Point to be used.  This should be a valid IAP ID
   1.349 +	        retrieved from CommDB.  A special value of KUseDefaultIap can be used
   1.350 +	        to signify that the plugin should just use the default IAP.
   1.351 +	@return A pointer to the newly created object. The object will be left on the cleanup stack.
   1.352 +
   1.353 +	@since	7.0s
   1.354 +	*/
   1.355 +	IMPORT_C static CMMFUrlParams* NewLC(const TDesC& aUrl, TInt aIAPId=KUseDefaultIap);
   1.356 +
   1.357 +	/**
   1.358 +	Factory function to create a CMMFUrlParams object by internalizing data from a stream.
   1.359 +
   1.360 +	This method can leave with one of the standard system-wide error codes.
   1.361 +
   1.362 +	@param  aStream
   1.363 +	        The stream from which the object should be internalized.
   1.364 +
   1.365 +	@return The newly created object. The object will be left on the cleanup stack.
   1.366 +
   1.367 +	@since	7.0s
   1.368 +	*/
   1.369 +	IMPORT_C static CMMFUrlParams* NewLC(RReadStream& aStream);
   1.370 +
   1.371 +	/**
   1.372 +	Externalize this object to a stream.
   1.373 +
   1.374 +	This method can leave with one of the standard system-wide error codes.
   1.375 +
   1.376 +	@param  aStream
   1.377 +	        The stream to which the object will be externalized.
   1.378 +
   1.379 +	@since	7.0s
   1.380 +	*/
   1.381 +	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
   1.382 +
   1.383 +	/**
   1.384 +	Externalize this object into a newly created CBufFlat buffer.
   1.385 +	
   1.386 +	This method can leave with one of the standard system-wide error codes.
   1.387 +
   1.388 +	@return The newly created buffer containing the externalized data. The CBufFlat object will be
   1.389 +	        left on the cleanup stack.
   1.390 +
   1.391 +	@since	7.0s
   1.392 +	*/
   1.393 +	IMPORT_C CBufFlat* ExternalizeToCBufFlatLC() const;
   1.394 +
   1.395 +	/**
   1.396 +	Destructor.
   1.397 +	*/
   1.398 +	~CMMFUrlParams();
   1.399 +
   1.400 +
   1.401 +	/**
   1.402 +	Returns the URL string, for example http://www.symbian.com/clip/mpg.
   1.403 +
   1.404 +	@return The URL string.
   1.405 +	@since	7.0s
   1.406 +	*/
   1.407 +	IMPORT_C const TDesC& Url() const;
   1.408 +
   1.409 +	/**
   1.410 +	Returns the Internet Access Point ID.
   1.411 +	
   1.412 +	@return IAP ID.
   1.413 +
   1.414 +	@since	7.0s
   1.415 +	*/
   1.416 +	IMPORT_C TInt IAPId() const;
   1.417 +
   1.418 +	/**
   1.419 +	Signifies whether the IAP ID should be used. This is determined internally by comparing
   1.420 +	the IAP ID with KUseDefaultIap.
   1.421 +
   1.422 +	@return A boolean indicating if the IAP ID should be used. ETrue if the supplied IAPId should
   1.423 +	        be used, EFalse if not.
   1.424 +
   1.425 +	@since  7.0s
   1.426 +	*/
   1.427 +	IMPORT_C TBool UseIAPId() const;
   1.428 +private:
   1.429 +	CMMFUrlParams();
   1.430 +	void ConstructL(const TDesC& aUrl, TInt aIAPId);
   1.431 +	void ConstructL(RReadStream& aStream);
   1.432 +private:
   1.433 +	HBufC* iUrl;
   1.434 +	TInt iIAPId;
   1.435 +	};
   1.436 +
   1.437 +
   1.438 +#endif