|
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 handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CVTENGDTMFHANDLER_H |
|
21 #define CVTENGDTMFHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <mvtprotocolhandler.h> |
|
26 #include "CVtEngDtmfState.h" |
|
27 #include "CVtEngOperation.h" |
|
28 #include "MVtEngDtmfHandler.h" |
|
29 |
|
30 // FORWARD DECLARATIONS |
|
31 class MVTUserInput; |
|
32 |
|
33 // CLASS DECLARATION |
|
34 |
|
35 /** |
|
36 * Base class for data types |
|
37 * |
|
38 * @lib videoteleng |
|
39 * @since 2.6 |
|
40 */ |
|
41 NONSHARABLE_CLASS( CVtEngDtmfHandler ) : public CBase, public MVtEngDtmfHandler |
|
42 { |
|
43 public: // Data structures |
|
44 enum TUIISupport |
|
45 { |
|
46 EBasicString = 2, |
|
47 EIA5String = 4, |
|
48 EGeneralString = 8, |
|
49 EDTMFString = 16 |
|
50 }; |
|
51 |
|
52 public: // constructor and destructor |
|
53 |
|
54 /** |
|
55 * Two-phased constructor. |
|
56 * @param aH324Config H324 configure interface |
|
57 * @return dtmf handler |
|
58 */ |
|
59 static CVtEngDtmfHandler* NewL( |
|
60 MVtH324ConfigCommand& aH324Config ); |
|
61 |
|
62 /** |
|
63 * Destructor |
|
64 */ |
|
65 ~CVtEngDtmfHandler(); |
|
66 |
|
67 public: // from MVtEngDtmfHandler |
|
68 |
|
69 /** |
|
70 * @see MVtEngDtmfHandler |
|
71 */ |
|
72 virtual void HandleL( CVtEngOperation& aOp ); |
|
73 |
|
74 /** |
|
75 * @see MVtEngDtmfHandler |
|
76 */ |
|
77 virtual CVtEngDtmfState& ActivateState( |
|
78 MVtEngDtmfHandler::TVtEngDtmfState aNewState ); |
|
79 |
|
80 /** |
|
81 * @see MVtEngDtmfHandler |
|
82 */ |
|
83 virtual void SendComplete( TInt aError ); |
|
84 |
|
85 /** |
|
86 * @see MVtEngDtmfHandler |
|
87 */ |
|
88 virtual MVTUserInput& ReserveProtoDtmfL( |
|
89 const TVtEngDtmfTone& aTone ); |
|
90 |
|
91 /** |
|
92 * @see MVtEngDtmfHandler |
|
93 */ |
|
94 virtual void ReleaseProtoDtmf(); |
|
95 |
|
96 /** |
|
97 * @see MVtEngDtmfHandler |
|
98 */ |
|
99 virtual TBool CheckCommandId( TInt aCheckCommandId ) const; |
|
100 |
|
101 /** |
|
102 * @see MVtEngDtmfHandler |
|
103 */ |
|
104 virtual void StoreCommandId( TInt aStoreCommandId ); |
|
105 |
|
106 |
|
107 public: // Protocol DTMF Support |
|
108 |
|
109 /** |
|
110 * Specifies the UII support |
|
111 * @param aValue the support to be used |
|
112 */ |
|
113 void SetUIISupport( TUIISupport aValue ); |
|
114 |
|
115 /** |
|
116 * Gets the current UII support |
|
117 * @return UII support |
|
118 */ |
|
119 TUIISupport GetUIISupport() const; |
|
120 |
|
121 private: // constructors |
|
122 |
|
123 /** |
|
124 * C++ constructor |
|
125 */ |
|
126 CVtEngDtmfHandler( MVtH324ConfigCommand& aH324Config ); |
|
127 |
|
128 /** |
|
129 * 2nd phase constructor |
|
130 */ |
|
131 void ConstructL(); |
|
132 |
|
133 private: // new functions |
|
134 |
|
135 /** |
|
136 * Handles completion of DTMF sending, leavable method. |
|
137 */ |
|
138 void HandleSendCompleteL( TInt aError ); |
|
139 |
|
140 /** |
|
141 * Creates a state instance |
|
142 * @param EVtDtmfStateIdle, EVtDtmfStateSending or EVtDtmfStateBuffered |
|
143 */ |
|
144 void CreateStateL( TInt aState ); |
|
145 |
|
146 private: // member data |
|
147 |
|
148 // DTMF states |
|
149 CArrayPtrFlat<CVtEngDtmfState>* iDtmfStates; |
|
150 |
|
151 // current state index |
|
152 TVtEngDtmfState iCurrentState; |
|
153 |
|
154 // protocol tone |
|
155 MVTUserInput* iProtoDtmf; |
|
156 |
|
157 // H324 interface |
|
158 MVtH324ConfigCommand& iH324Config; |
|
159 |
|
160 // Indicates supported UII type: |
|
161 // 16 DTMF |
|
162 // 8 General String |
|
163 // 4 IA5 String |
|
164 // 2 Basic string |
|
165 TUIISupport iUIISupport; |
|
166 |
|
167 // DTMF command ID returned by H324 interface for last tone |
|
168 TInt iIssuedDtmfCommandId; |
|
169 }; |
|
170 |
|
171 |
|
172 #endif CVTENGDTMFHANDLER_H |
|
173 |
|
174 // End of File |