sl@0: // Copyright (c) 2001-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 __MMFURL_H_ sl@0: #define __MMFURL_H_ sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Concrete implementation of a URL data source. sl@0: sl@0: This class is used only to pass information regarding the URL and IAP into the sl@0: controller plugin. IT CANNOT BE USED TO READ DATA FROM A URL. Each of the MDataSource sl@0: APIs are implemented as either returning or leaving with KErrNotSupported as appropriate. sl@0: sl@0: The configuration data for this class is an externalized CMMFUrlParams object. sl@0: sl@0: @see CMMFUrlParams sl@0: */ sl@0: class CMMFUrlSource : public CBase, public MDataSource sl@0: { sl@0: public: sl@0: static MDataSource* NewSourceL(); sl@0: sl@0: /** sl@0: Destructor. sl@0: */ sl@0: virtual ~CMMFUrlSource(); sl@0: sl@0: /** sl@0: Returns the URL string. sl@0: sl@0: For example: sl@0: @code sl@0: http://www.symbian.com/clip/mpg sl@0: @endcode sl@0: sl@0: @return The URL string. sl@0: @since 7.0s sl@0: */ sl@0: const TDesC& Url() const {return *iUrl;} sl@0: sl@0: /** sl@0: Indicates whether the IAP ID should be used. sl@0: sl@0: @return A boolean indicating if the supplied IAPId should be used. ETrue if the supplied IAPId sl@0: should be used. EFalse if the default IAPId should be used. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: TBool UseIAPId() const {return iUseIAPId;} sl@0: sl@0: /** sl@0: Returns the Internet Access Point ID. sl@0: sl@0: @return The IAP ID. sl@0: @since 7.0s sl@0: */ sl@0: TInt IAPId() const {return iIAPId;} sl@0: sl@0: TFourCC SourceDataTypeCode(TMediaId aMediaId); sl@0: TInt SetSourceDataTypeCode(TFourCC /*aSourceFourCC*/, TMediaId /*aMediaId*/); sl@0: void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer,TMediaId /*aMediaId*/); sl@0: void BufferEmptiedL(CMMFBuffer* aBuffer); sl@0: TBool CanCreateSourceBuffer(); sl@0: CMMFBuffer* CreateSourceBufferL(TMediaId /*aMediaId*/, TBool &aReference); sl@0: CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, CMMFBuffer& /*aSinkBuffer*/, TBool &aReference); sl@0: TInt SourceThreadLogon(MAsyncEventHandler& /*aEventHandler*/); sl@0: void SourceThreadLogoff(); sl@0: void NegotiateSourceL(MDataSink& /* aDataSink*/); sl@0: TBool SourceSampleConvert(); sl@0: void SourcePrimeL(); sl@0: void SourcePlayL(); sl@0: void SourcePauseL(); sl@0: void SourceStopL(); sl@0: void SetSourcePrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/); sl@0: void SourceCustomCommand(TMMFMessage& aMessage); sl@0: sl@0: private: sl@0: CMMFUrlSource(); sl@0: void ConstructSourceL(const TDesC8& aInitData); sl@0: private: sl@0: HBufC* iUrl; sl@0: TBool iUseIAPId; sl@0: TInt iIAPId; sl@0: }; sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Concrete implementation of a URL data sink. sl@0: sl@0: This class is used only to pass information regarding the URL and IAP into the sl@0: controller plugin. IT CANNOT BE USED TO WRITE DATA TO A URL. Each of the MDataSink sl@0: APIs are implemented as either returning or leaving with KErrNotSupported as appropriate. sl@0: sl@0: The configuration data for this class is an externalized CMMFUrlParams object. sl@0: sl@0: @see CMMFUrlParams sl@0: */ sl@0: class CMMFUrlSink : public CBase, public MDataSink sl@0: { sl@0: public: sl@0: static MDataSink* NewSinkL(); sl@0: virtual ~CMMFUrlSink(); sl@0: sl@0: /** sl@0: Returns the URL string. sl@0: sl@0: For example: sl@0: @code sl@0: http://www.symbian.com/clip/mpg sl@0: @endcode sl@0: sl@0: @return The URL string. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: const TDesC& Url() const {return *iUrl;} sl@0: sl@0: /** sl@0: Indicates whether the IAP ID should be used. sl@0: sl@0: @return A boolean indicating if the supplied IAP ID should be used. ETrue if the supplied ID sl@0: should be used, EFalse if the default IAP ID should be used. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: TBool UseIAPId() const {return iUseIAPId;} sl@0: sl@0: /** sl@0: Returns the Internet Access Point ID. sl@0: sl@0: @return The IAP ID. sl@0: sl@0: @since 7.0s sl@0: */ sl@0: TInt IAPId() const {return iIAPId;} sl@0: sl@0: TFourCC SinkDataTypeCode(TMediaId /*aMediaId*/); sl@0: TInt SetSinkDataTypeCode(TFourCC /*aSinkFourCC*/, TMediaId /*aMediaId*/); sl@0: void EmptyBufferL(CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId /*aMediaId*/); sl@0: void BufferFilledL(CMMFBuffer* aBuffer); sl@0: TBool CanCreateSinkBuffer(); sl@0: CMMFBuffer* CreateSinkBufferL(TMediaId /*aMediaId*/, TBool &aReference); sl@0: TInt SinkThreadLogon(MAsyncEventHandler& /*aEventHandler*/); sl@0: void SinkThreadLogoff(); sl@0: void NegotiateL(MDataSource& /* aDataSource*/); sl@0: void SinkPrimeL(); sl@0: void SinkPlayL(); sl@0: void SinkPauseL(); sl@0: void SinkStopL(); sl@0: void SetSinkPrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/); sl@0: void SinkCustomCommand(TMMFMessage& aMessage); sl@0: sl@0: private: sl@0: CMMFUrlSink(); sl@0: void ConstructSinkL(const TDesC8& aInitData); sl@0: private: sl@0: HBufC* iUrl; sl@0: TBool iUseIAPId; sl@0: TInt iIAPId; sl@0: }; sl@0: sl@0: sl@0: sl@0: #endif