|
1 /* |
|
2 * Copyright (c) 2007 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: Generates DTMF events in Inband DTMF |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef SVPDTMFEVENTGENERATOR_H |
|
21 #define SVPDTMFEVENTGENERATOR_H |
|
22 |
|
23 #include <e32base.h> |
|
24 #include "svputdefs.h" |
|
25 |
|
26 class MSVPDTMFEventObserver; |
|
27 |
|
28 /** |
|
29 * SVP DTMF event generator |
|
30 * Generates DTMF events when sending Inband string sequence |
|
31 * |
|
32 * @lib |
|
33 * @since S60 3.2 |
|
34 */ |
|
35 class CSVPDTMFEventGenerator : public CActive |
|
36 { |
|
37 public: |
|
38 |
|
39 /** |
|
40 * Two-phased constructor. |
|
41 */ |
|
42 static CSVPDTMFEventGenerator* CSVPDTMFEventGenerator::NewL( MSVPDTMFEventObserver& aObserver ); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 virtual ~CSVPDTMFEventGenerator(); |
|
48 |
|
49 public: // new methods |
|
50 |
|
51 /** |
|
52 * Starts sending DTMF events |
|
53 * @Since S60 3.2 |
|
54 * @return void |
|
55 */ |
|
56 void StartDtmfEvents( TInt aStringLength, TBool aPause = EFalse ); |
|
57 |
|
58 /** |
|
59 * Stops the timer. |
|
60 * @since Series 60 3.2 |
|
61 * @return |
|
62 */ |
|
63 void StopEvents(); |
|
64 |
|
65 protected: // methods from base classes |
|
66 |
|
67 /** |
|
68 * @see CActive |
|
69 */ |
|
70 void RunL(); |
|
71 |
|
72 /** |
|
73 * @see CActive |
|
74 */ |
|
75 void DoCancel(); |
|
76 |
|
77 /** |
|
78 * @see CActive |
|
79 */ |
|
80 TInt RunError( TInt aError ); |
|
81 |
|
82 private: |
|
83 |
|
84 /** |
|
85 * C++ default constructor. |
|
86 */ |
|
87 CSVPDTMFEventGenerator( MSVPDTMFEventObserver& aObserver ); |
|
88 |
|
89 /** |
|
90 * By default Symbian 2nd phase constructor is private. |
|
91 */ |
|
92 void ConstructL(); |
|
93 |
|
94 private: // data |
|
95 |
|
96 /** |
|
97 * Reference to the DTMF observer. |
|
98 */ |
|
99 MSVPDTMFEventObserver& iObserver; |
|
100 |
|
101 /** |
|
102 * Holds the length of the string to be sent |
|
103 */ |
|
104 TInt iStringLength; |
|
105 |
|
106 /** |
|
107 * Reference to RTimer |
|
108 */ |
|
109 RTimer iTimer; |
|
110 |
|
111 /** |
|
112 * Flag which determines if start event is sent |
|
113 * Needed for event sending logic when sending DMTF string |
|
114 */ |
|
115 TBool iStartSent; |
|
116 |
|
117 /** |
|
118 * Pause flag determines, whether pause should be activated |
|
119 */ |
|
120 TBool iPause; |
|
121 |
|
122 private: |
|
123 |
|
124 // For testing |
|
125 SVP_UT_DEFS |
|
126 |
|
127 }; |
|
128 |
|
129 #endif // SVPDTMFEVENTGENERATOR_H |