sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: #ifndef __MMFCONTROLLERFRAMEWORKBASE_H__ sl@0: #define __MMFCONTROLLERFRAMEWORKBASE_H__ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Constant that can be passed into the client API OpenURL() interfaces (as the aIapId parameter) sl@0: to request that the default Internet Access Point be used. sl@0: */ sl@0: const TInt KUseDefaultIap = -1; sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: General purpose class to describe an event. sl@0: sl@0: Contains a UID to define the actual event type, and an integer to define the event code. sl@0: sl@0: Controller plugins can define their own event types, but should use sl@0: KMMFErrorCategoryControllerGeneralError for any errors that can be described by sl@0: the standard system-wide error codes. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class TMMFEvent sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Constructor. sl@0: sl@0: @param aEventType sl@0: A UID to define the type of event. sl@0: @param aErrorCode sl@0: The error code associated with the event. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TMMFEvent(TUid aEventType, TInt aErrorCode); sl@0: sl@0: /** sl@0: Default constructor. sl@0: sl@0: Provided so this class can be packaged in a TPckgBuf<>. sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TMMFEvent(); sl@0: sl@0: /** sl@0: A UID to define the event type. sl@0: */ sl@0: TUid iEventType; sl@0: sl@0: /** sl@0: The error code associated with the event. sl@0: */ sl@0: TInt iErrorCode; sl@0: private: sl@0: /** sl@0: This member is internal and not intended for use. sl@0: */ sl@0: TInt iReserved1; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Package buffer for TMMFEvent sl@0: */ sl@0: typedef TPckgBuf TMMFEventPckg; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Package buffer for TUid sl@0: */ sl@0: typedef TPckgBuf TMMFUidPckg; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Package buffer for TTimeIntervalMicroSeconds sl@0: */ sl@0: typedef TPckgBuf TMMFTimeIntervalMicroSecondsPckg; sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: A piece of meta data. sl@0: sl@0: Meta data is often contained in the header of multimedia clips and is used to define sl@0: attributes such as the author and copyright details. sl@0: sl@0: Each piece of meta data has a name, or category, and a value. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class CMMFMetaDataEntry : public CBase sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Constructs a new meta data object using a name and value. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: An example of a name might be: sl@0: @code sl@0: For example, sl@0: @endcode sl@0: sl@0: An example of a value might be: sl@0: @code sl@0: sl@0: @endcode sl@0: sl@0: @param aName sl@0: The name, or category, to be given to this piece of meta data. sl@0: @param aValue sl@0: The value of this piece of meta data. sl@0: sl@0: @return The newly created meta data object. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFMetaDataEntry* NewL(const TDesC& aName, const TDesC& aValue); sl@0: sl@0: /** sl@0: Copy constructor. Returns a replica of the meta data passed in. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @param aOther sl@0: The meta data to be copied. sl@0: sl@0: @return The newly created meta data object. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFMetaDataEntry* NewL(const CMMFMetaDataEntry& aOther); sl@0: sl@0: /** sl@0: Default constructor. Returns a blank meta data object. To be used when internalizing sl@0: data into the object. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @return The newly created meta data object. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFMetaDataEntry* NewL(); sl@0: sl@0: /** sl@0: Destructor. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C ~CMMFMetaDataEntry(); sl@0: sl@0: /** sl@0: Returns the name, or category, of the meta data. sl@0: sl@0: @return The name of the meta data object. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const TDesC& Name() const; sl@0: sl@0: /** sl@0: Returns the value field of the meta data. sl@0: sl@0: @return The value field of the meta data object. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const TDesC& Value() const; sl@0: sl@0: /** sl@0: Sets the name, or category, of the meta data. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @param aName sl@0: The new name of the meta data object sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetNameL(const TDesC& aName); sl@0: sl@0: /** sl@0: Sets the value field of the meta data. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @param aValue sl@0: The new value field of the meta data object sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void SetValueL(const TDesC& aValue); sl@0: sl@0: /** sl@0: Writes the data contained within the object to a stream so it can be copied sl@0: over IPC or written to a file. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @param aStream sl@0: The stream to be written to. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void ExternalizeL(RWriteStream& aStream) const; sl@0: sl@0: /** sl@0: Reads data from a stream and copies it into this object. Used when copying sl@0: a meta data object over IPC or reading it from a file. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @param aStream sl@0: The stream to be read. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void InternalizeL(RReadStream& aStream); sl@0: private: sl@0: sl@0: /** sl@0: Constructor. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: CMMFMetaDataEntry(); sl@0: sl@0: /** sl@0: Second phase constructor. sl@0: sl@0: An example of aName might be: sl@0: @code sl@0: sl@0: @endcode sl@0: sl@0: An example of aValue might be: sl@0: @code sl@0: sl@0: @endcode sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @param aName sl@0: The name, or category, to be given to this piece of meta data. sl@0: @param aValue sl@0: The value of this piece of meta data. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: void ConstructL(const TDesC& aName, const TDesC& aValue); sl@0: private: sl@0: /** sl@0: The name, or category, of the meta data. sl@0: */ sl@0: HBufC* iName; sl@0: sl@0: /** sl@0: The value of the meta data. sl@0: */ sl@0: HBufC* iValue; sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Class to be used to configure a URL source or sink. sl@0: sl@0: Contains a variable length string to represent the URL, and whether to use a specified sl@0: Internet Access Point or use the default. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: class CMMFUrlParams : public CBase sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: Factory function to create a CMMFUrlParams object. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @param aUrl sl@0: The url, for example http://www.symbian.com/clip.mpg sl@0: @param aIAPId sl@0: The Inernet Access Point to be used. This should be a valid IAP ID sl@0: retrieved from CommDB. A special value of KUseDefaultIap can be used sl@0: to signify that the plugin should just use the default IAP. sl@0: sl@0: @return A pointer to the newly created object. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFUrlParams* NewL(const TDesC& aUrl, TInt aIAPId=KUseDefaultIap); sl@0: sl@0: /** sl@0: Factory function to create a CMMFUrlParams object. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @param aUrl sl@0: The url, for example http://www.symbian.com/clip.mpg sl@0: @param aIAPId sl@0: The Inernet Access Point to be used. This should be a valid IAP ID sl@0: retrieved from CommDB. A special value of KUseDefaultIap can be used sl@0: to signify that the plugin should just use the default IAP. sl@0: @return A pointer to the newly created object. The object will be left on the cleanup stack. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFUrlParams* NewLC(const TDesC& aUrl, TInt aIAPId=KUseDefaultIap); sl@0: sl@0: /** sl@0: Factory function to create a CMMFUrlParams object by internalizing data from a stream. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @param aStream sl@0: The stream from which the object should be internalized. sl@0: sl@0: @return The newly created object. The object will be left on the cleanup stack. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C static CMMFUrlParams* NewLC(RReadStream& aStream); sl@0: sl@0: /** sl@0: Externalize this object to a stream. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @param aStream sl@0: The stream to which the object will be externalized. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C void ExternalizeL(RWriteStream& aStream) const; sl@0: sl@0: /** sl@0: Externalize this object into a newly created CBufFlat buffer. sl@0: sl@0: This method can leave with one of the standard system-wide error codes. sl@0: sl@0: @return The newly created buffer containing the externalized data. The CBufFlat object will be sl@0: left on the cleanup stack. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C CBufFlat* ExternalizeToCBufFlatLC() const; sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: ~CMMFUrlParams(); sl@0: sl@0: sl@0: /** sl@0: Returns the URL string, for example http://www.symbian.com/clip/mpg. sl@0: sl@0: @return The URL string. sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C const TDesC& Url() const; sl@0: sl@0: /** sl@0: Returns the Internet Access Point ID. sl@0: sl@0: @return IAP ID. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TInt IAPId() const; sl@0: sl@0: /** sl@0: Signifies whether the IAP ID should be used. This is determined internally by comparing sl@0: the IAP ID with KUseDefaultIap. sl@0: sl@0: @return A boolean indicating if the IAP ID should be used. ETrue if the supplied IAPId should sl@0: be used, EFalse if not. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: IMPORT_C TBool UseIAPId() const; sl@0: private: sl@0: CMMFUrlParams(); sl@0: void ConstructL(const TDesC& aUrl, TInt aIAPId); sl@0: void ConstructL(RReadStream& aStream); sl@0: private: sl@0: HBufC* iUrl; sl@0: TInt iIAPId; sl@0: }; sl@0: sl@0: sl@0: #endif