1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mmf/server/mmfurl.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,189 @@
1.4 +// Copyright (c) 2001-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 __MMFURL_H_
1.21 +#define __MMFURL_H_
1.22 +
1.23 +#include <mmf/server/mmfdatasource.h>
1.24 +#include <mmf/server/mmfdatasink.h>
1.25 +#include <s32mem.h>
1.26 +
1.27 +
1.28 +/**
1.29 +@publishedAll
1.30 +@released
1.31 +
1.32 +Concrete implementation of a URL data source.
1.33 +
1.34 +This class is used only to pass information regarding the URL and IAP into the
1.35 +controller plugin. IT CANNOT BE USED TO READ DATA FROM A URL. Each of the MDataSource
1.36 +APIs are implemented as either returning or leaving with KErrNotSupported as appropriate.
1.37 +
1.38 +The configuration data for this class is an externalized CMMFUrlParams object.
1.39 +
1.40 +@see CMMFUrlParams
1.41 +*/
1.42 +class CMMFUrlSource : public CBase, public MDataSource
1.43 + {
1.44 +public:
1.45 + static MDataSource* NewSourceL();
1.46 +
1.47 + /**
1.48 + Destructor.
1.49 + */
1.50 + virtual ~CMMFUrlSource();
1.51 +
1.52 + /**
1.53 + Returns the URL string.
1.54 +
1.55 + For example:
1.56 + @code
1.57 + http://www.symbian.com/clip/mpg
1.58 + @endcode
1.59 +
1.60 + @return The URL string.
1.61 + @since 7.0s
1.62 + */
1.63 + const TDesC& Url() const {return *iUrl;}
1.64 +
1.65 + /**
1.66 + Indicates whether the IAP ID should be used.
1.67 +
1.68 + @return A boolean indicating if the supplied IAPId should be used. ETrue if the supplied IAPId
1.69 + should be used. EFalse if the default IAPId should be used.
1.70 +
1.71 + @since 7.0s
1.72 + */
1.73 + TBool UseIAPId() const {return iUseIAPId;}
1.74 +
1.75 + /**
1.76 + Returns the Internet Access Point ID.
1.77 +
1.78 + @return The IAP ID.
1.79 + @since 7.0s
1.80 + */
1.81 + TInt IAPId() const {return iIAPId;}
1.82 +
1.83 + TFourCC SourceDataTypeCode(TMediaId aMediaId);
1.84 + TInt SetSourceDataTypeCode(TFourCC /*aSourceFourCC*/, TMediaId /*aMediaId*/);
1.85 + void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer,TMediaId /*aMediaId*/);
1.86 + void BufferEmptiedL(CMMFBuffer* aBuffer);
1.87 + TBool CanCreateSourceBuffer();
1.88 + CMMFBuffer* CreateSourceBufferL(TMediaId /*aMediaId*/, TBool &aReference);
1.89 + CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, CMMFBuffer& /*aSinkBuffer*/, TBool &aReference);
1.90 + TInt SourceThreadLogon(MAsyncEventHandler& /*aEventHandler*/);
1.91 + void SourceThreadLogoff();
1.92 + void NegotiateSourceL(MDataSink& /* aDataSink*/);
1.93 + TBool SourceSampleConvert();
1.94 + void SourcePrimeL();
1.95 + void SourcePlayL();
1.96 + void SourcePauseL();
1.97 + void SourceStopL();
1.98 + void SetSourcePrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/);
1.99 + void SourceCustomCommand(TMMFMessage& aMessage);
1.100 +
1.101 +private:
1.102 + CMMFUrlSource();
1.103 + void ConstructSourceL(const TDesC8& aInitData);
1.104 +private:
1.105 + HBufC* iUrl;
1.106 + TBool iUseIAPId;
1.107 + TInt iIAPId;
1.108 + };
1.109 +
1.110 +
1.111 +
1.112 +/**
1.113 +@publishedAll
1.114 +@released
1.115 +
1.116 +Concrete implementation of a URL data sink.
1.117 +
1.118 +This class is used only to pass information regarding the URL and IAP into the
1.119 +controller plugin. IT CANNOT BE USED TO WRITE DATA TO A URL. Each of the MDataSink
1.120 +APIs are implemented as either returning or leaving with KErrNotSupported as appropriate.
1.121 +
1.122 +The configuration data for this class is an externalized CMMFUrlParams object.
1.123 +
1.124 +@see CMMFUrlParams
1.125 +*/
1.126 +class CMMFUrlSink : public CBase, public MDataSink
1.127 + {
1.128 +public:
1.129 + static MDataSink* NewSinkL();
1.130 + virtual ~CMMFUrlSink();
1.131 +
1.132 + /**
1.133 + Returns the URL string.
1.134 +
1.135 + For example:
1.136 + @code
1.137 + http://www.symbian.com/clip/mpg
1.138 + @endcode
1.139 +
1.140 + @return The URL string.
1.141 +
1.142 + @since 7.0s
1.143 + */
1.144 + const TDesC& Url() const {return *iUrl;}
1.145 +
1.146 + /**
1.147 + Indicates whether the IAP ID should be used.
1.148 +
1.149 + @return A boolean indicating if the supplied IAP ID should be used. ETrue if the supplied ID
1.150 + should be used, EFalse if the default IAP ID should be used.
1.151 +
1.152 + @since 7.0s
1.153 + */
1.154 + TBool UseIAPId() const {return iUseIAPId;}
1.155 +
1.156 + /**
1.157 + Returns the Internet Access Point ID.
1.158 +
1.159 + @return The IAP ID.
1.160 +
1.161 + @since 7.0s
1.162 + */
1.163 + TInt IAPId() const {return iIAPId;}
1.164 +
1.165 + TFourCC SinkDataTypeCode(TMediaId /*aMediaId*/);
1.166 + TInt SetSinkDataTypeCode(TFourCC /*aSinkFourCC*/, TMediaId /*aMediaId*/);
1.167 + void EmptyBufferL(CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId /*aMediaId*/);
1.168 + void BufferFilledL(CMMFBuffer* aBuffer);
1.169 + TBool CanCreateSinkBuffer();
1.170 + CMMFBuffer* CreateSinkBufferL(TMediaId /*aMediaId*/, TBool &aReference);
1.171 + TInt SinkThreadLogon(MAsyncEventHandler& /*aEventHandler*/);
1.172 + void SinkThreadLogoff();
1.173 + void NegotiateL(MDataSource& /* aDataSource*/);
1.174 + void SinkPrimeL();
1.175 + void SinkPlayL();
1.176 + void SinkPauseL();
1.177 + void SinkStopL();
1.178 + void SetSinkPrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/);
1.179 + void SinkCustomCommand(TMMFMessage& aMessage);
1.180 +
1.181 +private:
1.182 + CMMFUrlSink();
1.183 + void ConstructSinkL(const TDesC8& aInitData);
1.184 +private:
1.185 + HBufC* iUrl;
1.186 + TBool iUseIAPId;
1.187 + TInt iIAPId;
1.188 + };
1.189 +
1.190 +
1.191 +
1.192 +#endif