|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: DTMF state classes. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CVTENGDTMFSTATE_H |
|
21 #define CVTENGDTMFSTATE_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <mvtprotocolhandler.h> |
|
26 #include "TVtEngDtmfTone.h" |
|
27 #include "MVtEngDtmfHandler.h" |
|
28 |
|
29 |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Base class for DTMF states. |
|
35 * |
|
36 * @lib videoteleng |
|
37 * @since 2.6 |
|
38 */ |
|
39 NONSHARABLE_CLASS( CVtEngDtmfState ) : public CBase |
|
40 { |
|
41 public: |
|
42 /** |
|
43 * C++ constructor. |
|
44 * @param aDtmfHandler |
|
45 * @param aH324Config H324 configure interface |
|
46 */ |
|
47 CVtEngDtmfState( |
|
48 MVtEngDtmfHandler& aDtmfHandler, |
|
49 MVtH324ConfigCommand& aH324Config ); |
|
50 |
|
51 public: // new methods |
|
52 |
|
53 /** |
|
54 * Sends a DTMF tone. Derived classes implement this |
|
55 * and each vary in behavior. |
|
56 * @param aTone tone to send |
|
57 */ |
|
58 virtual void SendDtmfL( const TVtEngDtmfTone& aTone ) = 0; |
|
59 |
|
60 /** |
|
61 * Handles callback about DTMF sending. Releases pv2way dtmf instance. |
|
62 * @param aError Symbian OS error code |
|
63 */ |
|
64 virtual void DtmfSendCompleteL( TInt aError ); |
|
65 |
|
66 protected: // new methods |
|
67 /** |
|
68 * Sends tone and changes state |
|
69 * @param aDtmf tone to send |
|
70 * @param aNewState new DTMF state |
|
71 */ |
|
72 void DoSendAndActivateStateL( |
|
73 const TVtEngDtmfTone& aDtmf, |
|
74 MVtEngDtmfHandler::TVtEngDtmfState aNewState ); |
|
75 |
|
76 protected: // member data |
|
77 |
|
78 // DTMF handler |
|
79 MVtEngDtmfHandler& iDtmfHandler; |
|
80 |
|
81 // H324 configure interface |
|
82 MVtH324ConfigCommand& iH324Config; |
|
83 }; |
|
84 |
|
85 /** |
|
86 * Idle DTMF state class |
|
87 * |
|
88 * @lib videoteleng |
|
89 * @since 2.6 |
|
90 */ |
|
91 NONSHARABLE_CLASS( CVtEngDtmfIdle ) : public CVtEngDtmfState |
|
92 { |
|
93 public: // Constructors and destructor |
|
94 |
|
95 /** |
|
96 * Two-phased constructor. |
|
97 * @param aDtmfHandler |
|
98 * @param aH324Config H324 configure interface |
|
99 */ |
|
100 static CVtEngDtmfState* NewL( |
|
101 MVtEngDtmfHandler& aDtmfHandler, |
|
102 MVtH324ConfigCommand& aH324Config ); |
|
103 |
|
104 /** |
|
105 * Destructor. |
|
106 */ |
|
107 virtual ~CVtEngDtmfIdle(); |
|
108 |
|
109 public: // From CVtEngStateBase |
|
110 |
|
111 /** |
|
112 * Sends DTMF tone and changes state to "sending". |
|
113 * @param aTone tone to send |
|
114 */ |
|
115 virtual void SendDtmfL( const TVtEngDtmfTone& aTone ); |
|
116 |
|
117 /** |
|
118 * @see CVtEngDtmfState |
|
119 */ |
|
120 virtual void DtmfSendCompleteL( TInt aError ); |
|
121 |
|
122 private: // constructors |
|
123 |
|
124 /** |
|
125 * C++ constructor. |
|
126 * @param aDtmfHandler |
|
127 * @param aH324Config H324 configure interface |
|
128 */ |
|
129 CVtEngDtmfIdle( |
|
130 MVtEngDtmfHandler& aDtmfHandler, |
|
131 MVtH324ConfigCommand& aH324Config ); |
|
132 }; |
|
133 |
|
134 /** |
|
135 * Sending DTMF state class |
|
136 * |
|
137 * @lib videoteleng |
|
138 * @since 2.6 |
|
139 */ |
|
140 NONSHARABLE_CLASS( CVtEngDtmfSending ) : public CVtEngDtmfState |
|
141 { |
|
142 public: // Constructors and destructor |
|
143 |
|
144 /** |
|
145 * Two-phased constructor. |
|
146 * @param aDtmfHandler |
|
147 * @param aH324Config H324 configure interface |
|
148 */ |
|
149 static CVtEngDtmfState* NewL( |
|
150 MVtEngDtmfHandler& aDtmfHandler, |
|
151 MVtH324ConfigCommand& aH324Config ); |
|
152 |
|
153 /** |
|
154 * Destructor. |
|
155 */ |
|
156 virtual ~CVtEngDtmfSending(); |
|
157 |
|
158 public: // From CVtEngStateBase |
|
159 |
|
160 /** |
|
161 * Changes state to "buffered". |
|
162 * @param aTone tone to send |
|
163 */ |
|
164 virtual void SendDtmfL( const TVtEngDtmfTone& aTone ); |
|
165 |
|
166 /** |
|
167 * @see CVtEngDtmfState |
|
168 */ |
|
169 virtual void DtmfSendCompleteL( TInt aError ); |
|
170 |
|
171 private: // constructor |
|
172 |
|
173 /** |
|
174 * C++ constructor. |
|
175 * @param aDtmfHandler |
|
176 * @param aH324Config |
|
177 */ |
|
178 CVtEngDtmfSending( |
|
179 MVtEngDtmfHandler& aDtmfHandler, |
|
180 MVtH324ConfigCommand& aH324Config ); |
|
181 |
|
182 }; |
|
183 |
|
184 /** |
|
185 * Buffered DTMF state class |
|
186 * |
|
187 * @lib videoteleng |
|
188 * @since 2.6 |
|
189 */ |
|
190 NONSHARABLE_CLASS( CVtEngDtmfBuffered ) : public CVtEngDtmfState |
|
191 { |
|
192 public: // Constructors and destructor |
|
193 |
|
194 /** |
|
195 * Two-phased constructor. |
|
196 * @param aDtmfHandler |
|
197 * @param aH324Config H324 configure interface |
|
198 */ |
|
199 static CVtEngDtmfState* NewL( |
|
200 MVtEngDtmfHandler& aDtmfHandler, |
|
201 MVtH324ConfigCommand& aH324Config ); |
|
202 |
|
203 /** |
|
204 * Destructor. |
|
205 */ |
|
206 virtual ~CVtEngDtmfBuffered(); |
|
207 |
|
208 public: // From CVtEngStateBase |
|
209 |
|
210 /** |
|
211 * Buffers DTMF tone that is sent when previous |
|
212 * tones in buffer are sent. |
|
213 * @param aTone tone that is added to the buffer |
|
214 */ |
|
215 virtual void SendDtmfL( const TVtEngDtmfTone& aTone ); |
|
216 |
|
217 /** |
|
218 * @see CVtEngDtmfState |
|
219 */ |
|
220 virtual void DtmfSendCompleteL( TInt aError ); |
|
221 |
|
222 private: // constructors |
|
223 |
|
224 /** |
|
225 * C++ constructor. |
|
226 * @param aDtmfHandler |
|
227 * @param aH324Config |
|
228 */ |
|
229 CVtEngDtmfBuffered( |
|
230 MVtEngDtmfHandler& aDtmfHandler, |
|
231 MVtH324ConfigCommand& aH324Config ); |
|
232 |
|
233 /** |
|
234 * By default Symbian 2nd phase constructor is private. |
|
235 */ |
|
236 void ConstructL(); |
|
237 |
|
238 private: // Member data |
|
239 |
|
240 // Buffered DTMF tones. |
|
241 CArrayFixFlat<TVtEngDtmfTone>* iTones; |
|
242 }; |
|
243 |
|
244 #endif // CVTENGDTMFSTATE_H |
|
245 |
|
246 // End of File |