|
1 /* |
|
2 * Copyright (c) 2004 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 asynchronous eventhandler for MMF/Mcc events |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef MCCTESTEVENTHANDLER_H |
|
21 #define MCCTESTEVENTHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <mmf/common/mmfcontrollerframework.h> |
|
26 #include "rtpapi.h" |
|
27 #include "mmccevents.h" |
|
28 #include "mccinternaldef.h" |
|
29 |
|
30 class MMccEventHandler; |
|
31 |
|
32 // CONSTANTS |
|
33 |
|
34 // MACROS |
|
35 |
|
36 // DATA TYPES |
|
37 /** |
|
38 * Eventhandling state |
|
39 */ |
|
40 enum TMccEventHandlerState |
|
41 { |
|
42 EStateIdle = 0, |
|
43 EStateHandleMmfEvent, |
|
44 EStateHandleSinkEvent, |
|
45 EStateHandleSourceEvent, |
|
46 EStateHandleJitterEvent, |
|
47 EStateHandleSourceInactivityEvent, |
|
48 EStateHandleSourceActivityEvent, |
|
49 EStateCompleteClientReq, |
|
50 EStateHandleDtmfSig, |
|
51 EStateHandleAmrEvent |
|
52 }; |
|
53 |
|
54 // FUNCTION PROTOTYPES |
|
55 |
|
56 // FORWARD DECLARATIONS |
|
57 |
|
58 // CLASS DECLARATION |
|
59 |
|
60 /** |
|
61 * Mcc Asynchronous eventhandler for async MMF/Mcc event handling |
|
62 * |
|
63 * @lib Mccsubthreads.lib |
|
64 * @since Series 60 3.0 |
|
65 */ |
|
66 NONSHARABLE_CLASS( CMccTestEventHandler ): |
|
67 public CBase, public MAsyncEventHandler, public MMccEventHandler, public MRtpErrNotify |
|
68 { |
|
69 public: // Constructors and destructor |
|
70 |
|
71 /** |
|
72 * Two-phased constructor. |
|
73 */ |
|
74 static CMccTestEventHandler* NewL(); |
|
75 |
|
76 /** |
|
77 * Destructor. |
|
78 */ |
|
79 virtual ~CMccTestEventHandler(); |
|
80 |
|
81 |
|
82 public: // Functions from base classes |
|
83 |
|
84 /** |
|
85 * From MAsyncEventHandler |
|
86 */ |
|
87 |
|
88 TInt SendEventToClient( const TMMFEvent& aEvent ); |
|
89 |
|
90 public: // Functions from base classes |
|
91 |
|
92 TInt SendMccEventToClient( TMccEvent& aEvent ); |
|
93 |
|
94 void StateChange( TInt aState, TUint32 aLink ); |
|
95 |
|
96 void ErrorOccured( TInt aError, TUint32 aSessionId, TUint32 aLink, |
|
97 TUint32 aStreamId, TUint32 aEndpointId ); |
|
98 |
|
99 public: // From MRtpErrNotify |
|
100 |
|
101 void ErrorNotify( TInt aErrCode ); |
|
102 |
|
103 private: // New functions |
|
104 |
|
105 /** |
|
106 * Changes the state of the eventhandler |
|
107 * @since Series 60 3.0 |
|
108 * @param aState New state to take |
|
109 * @return void |
|
110 */ |
|
111 void ChangeState( const TMccEventHandlerState& aState ); |
|
112 |
|
113 |
|
114 /** |
|
115 * Completes the client request if active if a client needs to be |
|
116 * informed about subthread events. |
|
117 * @since Series 60 3.0 |
|
118 * @param None |
|
119 * @return void |
|
120 */ |
|
121 void CompleteClientRequest(); |
|
122 |
|
123 /** |
|
124 * Handles a AMR payload formatter CMR event |
|
125 * @since Series 60 3.0 |
|
126 * @param None |
|
127 * @return void |
|
128 */ |
|
129 void HandleAmrEvent(); |
|
130 |
|
131 private: // Constructors and destructor |
|
132 |
|
133 /** |
|
134 * C++ default constructor. |
|
135 */ |
|
136 CMccTestEventHandler(); |
|
137 |
|
138 /** |
|
139 * By default Symbian 2nd phase constructor is private. |
|
140 */ |
|
141 void ConstructL(); |
|
142 |
|
143 public: |
|
144 |
|
145 TMccEvent iLastEvent; |
|
146 |
|
147 |
|
148 }; |
|
149 |
|
150 #endif // MCCTESTEVENTHANDLER_H |
|
151 |
|
152 // End of File |