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