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