epoc32/include/mmf/server/mmfurl.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 // Copyright (c) 2001-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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 
    17 #ifndef __MMFURL_H_
    18 #define __MMFURL_H_
    19 
    20 #include <mmf/server/mmfdatasource.h>
    21 #include <mmf/server/mmfdatasink.h>
    22 #include <s32mem.h>
    23 
    24 
    25 /**
    26 @publishedAll
    27 @released
    28 
    29 Concrete implementation of a URL data source.
    30 
    31 This class is used only to pass information regarding the URL and IAP into the
    32 controller plugin. IT CANNOT BE USED TO READ DATA FROM A URL. Each of the MDataSource
    33 APIs are implemented as either returning or leaving with KErrNotSupported as appropriate.
    34 
    35 The configuration data for this class is an externalized CMMFUrlParams object.
    36 
    37 @see    CMMFUrlParams
    38 */
    39 class CMMFUrlSource : public CBase, public MDataSource
    40 	{
    41 public:
    42 	static MDataSource* NewSourceL();
    43 	
    44 	/**
    45 	Destructor.
    46 	*/
    47 	virtual ~CMMFUrlSource();
    48 
    49 	/**
    50 	Returns the URL string.
    51 
    52 	For example:
    53 	@code
    54 	http://www.symbian.com/clip/mpg
    55 	@endcode
    56 
    57 	@return The URL string.
    58 	@since	7.0s
    59 	*/
    60 	const TDesC& Url() const {return *iUrl;}
    61 
    62 	/**
    63 	Indicates whether the IAP ID should be used.
    64 
    65 	@return A boolean indicating if the supplied IAPId should be used. ETrue if the supplied IAPId
    66 	        should be used. EFalse if the default IAPId should be used.
    67 
    68 	@since	7.0s
    69 	*/
    70 	TBool UseIAPId() const {return iUseIAPId;}
    71 
    72 	/**
    73 	Returns the Internet Access Point ID.
    74 
    75 	@return The IAP ID.
    76 	@since	7.0s
    77 	*/
    78 	TInt IAPId() const {return iIAPId;}
    79 
    80 	TFourCC SourceDataTypeCode(TMediaId aMediaId);
    81 	TInt SetSourceDataTypeCode(TFourCC /*aSourceFourCC*/, TMediaId /*aMediaId*/);
    82 	void FillBufferL(CMMFBuffer* aBuffer, MDataSink* aConsumer,TMediaId /*aMediaId*/);
    83 	void BufferEmptiedL(CMMFBuffer* aBuffer);
    84 	TBool CanCreateSourceBuffer();
    85 	CMMFBuffer* CreateSourceBufferL(TMediaId /*aMediaId*/, TBool &aReference);
    86 	CMMFBuffer* CreateSourceBufferL(TMediaId aMediaId, CMMFBuffer& /*aSinkBuffer*/, TBool &aReference);
    87 	TInt SourceThreadLogon(MAsyncEventHandler& /*aEventHandler*/);
    88 	void SourceThreadLogoff();
    89 	void NegotiateSourceL(MDataSink& /* aDataSink*/);
    90 	TBool SourceSampleConvert();
    91 	void SourcePrimeL();
    92 	void SourcePlayL();
    93 	void SourcePauseL();
    94 	void SourceStopL();
    95 	void SetSourcePrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/);
    96 	void SourceCustomCommand(TMMFMessage& aMessage);
    97 
    98 private:
    99 	CMMFUrlSource();
   100 	void ConstructSourceL(const TDesC8& aInitData);
   101 private:
   102 	HBufC* iUrl;
   103 	TBool iUseIAPId;
   104 	TInt iIAPId;
   105 	};
   106 
   107 
   108 
   109 /**
   110 @publishedAll
   111 @released
   112 
   113 Concrete implementation of a URL data sink.
   114 
   115 This class is used only to pass information regarding the URL and IAP into the
   116 controller plugin.  IT CANNOT BE USED TO WRITE DATA TO A URL.  Each of the MDataSink
   117 APIs are implemented as either returning or leaving with KErrNotSupported as appropriate.
   118 
   119 The configuration data for this class is an externalized CMMFUrlParams object.
   120 
   121 @see    CMMFUrlParams
   122 */
   123 class CMMFUrlSink : public CBase, public MDataSink
   124 	{
   125 public:
   126 	static MDataSink* NewSinkL();
   127 	virtual ~CMMFUrlSink();
   128 
   129 	/**
   130 	Returns the URL string.
   131 
   132 	For example:
   133 	@code
   134 	http://www.symbian.com/clip/mpg
   135 	@endcode
   136 
   137 	@return The URL string.
   138 
   139 	@since  7.0s
   140 	*/
   141 	const TDesC& Url() const {return *iUrl;}
   142 
   143 	/**
   144 	Indicates whether the IAP ID should be used.
   145 
   146 	@return A boolean indicating if the supplied IAP ID should be used. ETrue if the supplied ID
   147 	        should be used, EFalse if the default IAP ID should be used.
   148 
   149 	@since	7.0s
   150 	*/
   151 	TBool UseIAPId() const {return iUseIAPId;}
   152 
   153 	/**
   154 	Returns the Internet Access Point ID.
   155 
   156 	@return The IAP ID.
   157 
   158 	@since  7.0s
   159 	*/
   160 	TInt IAPId() const {return iIAPId;}
   161 
   162 	TFourCC SinkDataTypeCode(TMediaId /*aMediaId*/);
   163 	TInt SetSinkDataTypeCode(TFourCC /*aSinkFourCC*/, TMediaId /*aMediaId*/);
   164 	void EmptyBufferL(CMMFBuffer* aBuffer, MDataSource* aSupplier, TMediaId /*aMediaId*/);
   165 	void BufferFilledL(CMMFBuffer* aBuffer);
   166 	TBool CanCreateSinkBuffer();
   167 	CMMFBuffer* CreateSinkBufferL(TMediaId /*aMediaId*/, TBool &aReference);
   168 	TInt SinkThreadLogon(MAsyncEventHandler& /*aEventHandler*/);
   169 	void SinkThreadLogoff();
   170 	void NegotiateL(MDataSource& /* aDataSource*/);
   171 	void SinkPrimeL();
   172 	void SinkPlayL();
   173 	void SinkPauseL();
   174 	void SinkStopL();
   175 	void SetSinkPrioritySettings(const TMMFPrioritySettings& /*aPrioritySettings*/);
   176 	void SinkCustomCommand(TMMFMessage& aMessage);
   177 
   178 private:
   179 	CMMFUrlSink();
   180 	void ConstructSinkL(const TDesC8& aInitData);
   181 private:
   182 	HBufC* iUrl;
   183 	TBool iUseIAPId;
   184 	TInt iIAPId;
   185 	};
   186 
   187 
   188 
   189 #endif