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