|
1 /* |
|
2 * Copyright (c) 2004-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: Provides a comfort noise generator class |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef SENDSTATEMACHINE_H |
|
20 #define SENDSTATEMACHINE_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <e32std.h> |
|
25 #include <mmfformat.h> |
|
26 |
|
27 // DATA TYPES |
|
28 // Send states. |
|
29 |
|
30 // CLASS DECLARATION |
|
31 |
|
32 |
|
33 class MSendStateObserver |
|
34 { |
|
35 public: |
|
36 |
|
37 virtual void TimerExpiredL() = 0; |
|
38 |
|
39 }; |
|
40 |
|
41 /** |
|
42 * Sendstate machine |
|
43 */ |
|
44 class CSendStateMachine : public CBase |
|
45 { |
|
46 public: // Constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructor. |
|
50 */ |
|
51 static CSendStateMachine* NewL( MSendStateObserver* aClient ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 virtual ~CSendStateMachine() ; |
|
57 |
|
58 |
|
59 public: // New functions |
|
60 |
|
61 // Starts the timer. |
|
62 void Start (); |
|
63 |
|
64 // Cancels the timer. |
|
65 void Cancel (); |
|
66 |
|
67 void SetTimeOut(TTimeIntervalMicroSeconds32 aValue); |
|
68 |
|
69 private: // Functions from base classes |
|
70 |
|
71 static TInt IdleCallBackL (TAny* aPtr); |
|
72 |
|
73 private: |
|
74 |
|
75 /** |
|
76 * C++ default constructor. |
|
77 */ |
|
78 CSendStateMachine( MSendStateObserver* aClient ); |
|
79 |
|
80 /** |
|
81 * By default Symbian 2nd phase constructor is private. |
|
82 */ |
|
83 void ConstructL(); |
|
84 |
|
85 private: // Data |
|
86 |
|
87 // Client who uses this state machine |
|
88 MSendStateObserver* iClient; |
|
89 |
|
90 CPeriodic* iPeriodic; |
|
91 |
|
92 TTimeIntervalMicroSeconds32 iTimeOutValue; |
|
93 |
|
94 |
|
95 }; |
|
96 |
|
97 #endif // |