1 // Copyright (c) 2002-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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 #ifndef __MMFCONTROLLERFRAMEWORKBASE_H__
18 #define __MMFCONTROLLERFRAMEWORKBASE_H__
28 Constant that can be passed into the client API OpenURL() interfaces (as the aIapId parameter)
29 to request that the default Internet Access Point be used.
31 const TInt KUseDefaultIap = -1;
38 General purpose class to describe an event.
40 Contains a UID to define the actual event type, and an integer to define the event code.
42 Controller plugins can define their own event types, but should use
43 KMMFErrorCategoryControllerGeneralError for any errors that can be described by
44 the standard system-wide error codes.
56 A UID to define the type of event.
58 The error code associated with the event.
62 IMPORT_C TMMFEvent(TUid aEventType, TInt aErrorCode);
67 Provided so this class can be packaged in a TPckgBuf<>.
73 A UID to define the event type.
78 The error code associated with the event.
83 This member is internal and not intended for use.
92 Package buffer for TMMFEvent
94 typedef TPckgBuf<TMMFEvent> TMMFEventPckg;
100 Package buffer for TUid
102 typedef TPckgBuf<TUid> TMMFUidPckg;
108 Package buffer for TTimeIntervalMicroSeconds
110 typedef TPckgBuf<TTimeIntervalMicroSeconds> TMMFTimeIntervalMicroSecondsPckg;
117 A piece of meta data.
119 Meta data is often contained in the header of multimedia clips and is used to define
120 attributes such as the author and copyright details.
122 Each piece of meta data has a name, or category, and a value.
126 class CMMFMetaDataEntry : public CBase
131 Constructs a new meta data object using a name and value.
133 This method can leave with one of the standard system-wide error codes.
135 An example of a name might be:
137 For example, <Copyright>
140 An example of a value might be:
146 The name, or category, to be given to this piece of meta data.
148 The value of this piece of meta data.
150 @return The newly created meta data object.
154 IMPORT_C static CMMFMetaDataEntry* NewL(const TDesC& aName, const TDesC& aValue);
157 Copy constructor. Returns a replica of the meta data passed in.
159 This method can leave with one of the standard system-wide error codes.
162 The meta data to be copied.
164 @return The newly created meta data object.
168 IMPORT_C static CMMFMetaDataEntry* NewL(const CMMFMetaDataEntry& aOther);
171 Default constructor. Returns a blank meta data object. To be used when internalizing
172 data into the object.
174 This method can leave with one of the standard system-wide error codes.
176 @return The newly created meta data object.
180 IMPORT_C static CMMFMetaDataEntry* NewL();
187 IMPORT_C ~CMMFMetaDataEntry();
190 Returns the name, or category, of the meta data.
192 @return The name of the meta data object.
196 IMPORT_C const TDesC& Name() const;
199 Returns the value field of the meta data.
201 @return The value field of the meta data object.
205 IMPORT_C const TDesC& Value() const;
208 Sets the name, or category, of the meta data.
210 This method can leave with one of the standard system-wide error codes.
213 The new name of the meta data object
217 IMPORT_C void SetNameL(const TDesC& aName);
220 Sets the value field of the meta data.
222 This method can leave with one of the standard system-wide error codes.
225 The new value field of the meta data object
229 IMPORT_C void SetValueL(const TDesC& aValue);
232 Writes the data contained within the object to a stream so it can be copied
233 over IPC or written to a file.
235 This method can leave with one of the standard system-wide error codes.
238 The stream to be written to.
242 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
245 Reads data from a stream and copies it into this object. Used when copying
246 a meta data object over IPC or reading it from a file.
248 This method can leave with one of the standard system-wide error codes.
251 The stream to be read.
255 IMPORT_C void InternalizeL(RReadStream& aStream);
266 Second phase constructor.
268 An example of aName might be:
273 An example of aValue might be:
278 This method can leave with one of the standard system-wide error codes.
281 The name, or category, to be given to this piece of meta data.
283 The value of this piece of meta data.
287 void ConstructL(const TDesC& aName, const TDesC& aValue);
290 The name, or category, of the meta data.
295 The value of the meta data.
307 Class to be used to configure a URL source or sink.
309 Contains a variable length string to represent the URL, and whether to use a specified
310 Internet Access Point or use the default.
314 class CMMFUrlParams : public CBase
319 Factory function to create a CMMFUrlParams object.
321 This method can leave with one of the standard system-wide error codes.
324 The url, for example http://www.symbian.com/clip.mpg
326 The Inernet Access Point to be used. This should be a valid IAP ID
327 retrieved from CommDB. A special value of KUseDefaultIap can be used
328 to signify that the plugin should just use the default IAP.
330 @return A pointer to the newly created object.
334 IMPORT_C static CMMFUrlParams* NewL(const TDesC& aUrl, TInt aIAPId=KUseDefaultIap);
337 Factory function to create a CMMFUrlParams object.
339 This method can leave with one of the standard system-wide error codes.
342 The url, for example http://www.symbian.com/clip.mpg
344 The Inernet Access Point to be used. This should be a valid IAP ID
345 retrieved from CommDB. A special value of KUseDefaultIap can be used
346 to signify that the plugin should just use the default IAP.
347 @return A pointer to the newly created object. The object will be left on the cleanup stack.
351 IMPORT_C static CMMFUrlParams* NewLC(const TDesC& aUrl, TInt aIAPId=KUseDefaultIap);
354 Factory function to create a CMMFUrlParams object by internalizing data from a stream.
356 This method can leave with one of the standard system-wide error codes.
359 The stream from which the object should be internalized.
361 @return The newly created object. The object will be left on the cleanup stack.
365 IMPORT_C static CMMFUrlParams* NewLC(RReadStream& aStream);
368 Externalize this object to a stream.
370 This method can leave with one of the standard system-wide error codes.
373 The stream to which the object will be externalized.
377 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
380 Externalize this object into a newly created CBufFlat buffer.
382 This method can leave with one of the standard system-wide error codes.
384 @return The newly created buffer containing the externalized data. The CBufFlat object will be
385 left on the cleanup stack.
389 IMPORT_C CBufFlat* ExternalizeToCBufFlatLC() const;
398 Returns the URL string, for example http://www.symbian.com/clip/mpg.
400 @return The URL string.
403 IMPORT_C const TDesC& Url() const;
406 Returns the Internet Access Point ID.
412 IMPORT_C TInt IAPId() const;
415 Signifies whether the IAP ID should be used. This is determined internally by comparing
416 the IAP ID with KUseDefaultIap.
418 @return A boolean indicating if the IAP ID should be used. ETrue if the supplied IAPId should
419 be used, EFalse if not.
423 IMPORT_C TBool UseIAPId() const;
426 void ConstructL(const TDesC& aUrl, TInt aIAPId);
427 void ConstructL(RReadStream& aStream);