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 the License "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: Common recording engine message queue observer* |
|
15 */ |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CCRMSGQUEUEOBSERVER_H |
|
21 #define CCRMSGQUEUEOBSERVER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <e32msgqueue.h> |
|
26 #include <ipvideo/MCREngineObserver.h> |
|
27 #include <ipvideo/CRTypeDefs.h> |
|
28 |
|
29 // CONSTANTS |
|
30 // None |
|
31 |
|
32 // MACROS |
|
33 // None |
|
34 |
|
35 // DATA TYPES |
|
36 // None |
|
37 |
|
38 // FORWARD DECLARATIONS |
|
39 class MCREngineObserver; |
|
40 |
|
41 // CLASS DECLARATION |
|
42 |
|
43 /** |
|
44 * Common recording engine message queue observer. |
|
45 * Uses Symbian OS class RMsgQueue. |
|
46 * |
|
47 * @lib CommonRecordingEngine.lib |
|
48 * @since Series 60 3.0 |
|
49 */ |
|
50 NONSHARABLE_CLASS( CCRMsgQueueObserver ) : public CActive |
|
51 { |
|
52 |
|
53 public: // Constructors and destructor |
|
54 |
|
55 /** |
|
56 * Two-phased constructor. |
|
57 */ |
|
58 static CCRMsgQueueObserver* NewL( ); |
|
59 |
|
60 /** |
|
61 * Virtual destructor. |
|
62 */ |
|
63 virtual ~CCRMsgQueueObserver(); |
|
64 |
|
65 public: // New methods |
|
66 |
|
67 /** |
|
68 * Method that adds a view to message queue's observer list. |
|
69 * @since Series 60 3.0 |
|
70 * @param aObserver is the object that will be notified |
|
71 * @return none. |
|
72 */ |
|
73 void AddMsgQueueObserverL( MCREngineObserver* aObserver ); |
|
74 |
|
75 /** |
|
76 * Sets session id to listen to. |
|
77 * @since Series 60 3.0 |
|
78 * @param aSessionId session id |
|
79 * @return none. |
|
80 */ |
|
81 void SetSessionId( TInt aSessionId ); |
|
82 |
|
83 private: // Constructors |
|
84 |
|
85 /** |
|
86 * C++ default constructor. |
|
87 */ |
|
88 CCRMsgQueueObserver( ); |
|
89 |
|
90 /** |
|
91 * By default Symbian 2nd phase constructor is private. |
|
92 */ |
|
93 void ConstructL(); |
|
94 |
|
95 private: // Methods from base classes |
|
96 |
|
97 /** |
|
98 * From CActive. |
|
99 * Handles an active object’s request completion event. |
|
100 * @since Series 60 3.0 |
|
101 * @param none. |
|
102 * @return none. |
|
103 */ |
|
104 void RunL(); |
|
105 |
|
106 /** |
|
107 * From CActive. |
|
108 * Called when outstanding request is cancelled. |
|
109 * This function is called as part of the active object’s Cancel(). |
|
110 * @since Series 60 3.0 |
|
111 * @param none. |
|
112 * @return none. |
|
113 */ |
|
114 void DoCancel(); |
|
115 |
|
116 /** |
|
117 * From CActive. |
|
118 * Handles a leave occurring in the request completion event handler RunL(). |
|
119 * @since Series 60 3.0 |
|
120 * @param aError Error code. |
|
121 * @return none. |
|
122 */ |
|
123 TInt RunError( TInt aError ); |
|
124 |
|
125 private: // Data |
|
126 |
|
127 /** |
|
128 * Actual message queue. Or handle to kernel-side object. |
|
129 */ |
|
130 RMsgQueue<SCRQueueEntry> iQueue; |
|
131 |
|
132 /** |
|
133 * This is data-area for the message received from kernel side. |
|
134 */ |
|
135 SCRQueueEntry iReceivedMessage; |
|
136 |
|
137 /** |
|
138 * Observers are views. |
|
139 */ |
|
140 RPointerArray<MCREngineObserver> iObservers; |
|
141 |
|
142 /** |
|
143 * Session id to listen to |
|
144 */ |
|
145 TInt iSessionId; |
|
146 |
|
147 }; |
|
148 |
|
149 #endif // CCRMSGQUEUEOBSERVER_H |
|
150 |
|
151 // End of File |
|