|
1 /* |
|
2 * Copyright (c) 2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef STREAMVIEWCONTAINER_H |
|
19 #define STREAMVIEWCONTAINER_H |
|
20 |
|
21 // INCLUDES |
|
22 |
|
23 #include <aknlists.h> |
|
24 #include <coecntrl.h> |
|
25 #include <eiklbo.h> // MListBoxObserver |
|
26 //#include "UINotify.h" |
|
27 |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CAknView; |
|
31 class CMCETestUIEngine; |
|
32 class CMCETestUIEngineSession; |
|
33 class CMCETestUISessionViewModel; |
|
34 class CMCETestUIEngineAudioStream; |
|
35 class CMCETestUIEngineVideoStream; |
|
36 class CMCETestUIStreamViewModel; |
|
37 class CMCETestUIVideoStreamViewModel; |
|
38 |
|
39 |
|
40 // CLASS DECLARATION |
|
41 |
|
42 /** |
|
43 * CMCETestUISessionViewContainer container control class. |
|
44 * |
|
45 */ |
|
46 class CMCETestUIStreamViewContainer : |
|
47 public CCoeControl, public MCoeControlObserver, public MEikListBoxObserver |
|
48 { |
|
49 public: // Constructors and destructor |
|
50 |
|
51 static CMCETestUIStreamViewContainer* NewL( |
|
52 const TRect& aRect, |
|
53 CAknView& aOwningView, |
|
54 CMCETestUIEngine& aEngine, |
|
55 CMCETestUIEngineAudioStream& aStream ); |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 ~CMCETestUIStreamViewContainer(); |
|
61 |
|
62 public: // New functions |
|
63 |
|
64 void ConstructModelL(); |
|
65 |
|
66 private: // Constructors |
|
67 |
|
68 CMCETestUIStreamViewContainer( CAknView& aOwningView, |
|
69 CMCETestUIEngine& aEngine, |
|
70 CMCETestUIEngineAudioStream& aStream ); |
|
71 |
|
72 /** |
|
73 * @param aRect Frame rectangle for container. |
|
74 */ |
|
75 void ConstructL(const TRect& aRect); |
|
76 |
|
77 private: // Functions from base classes |
|
78 |
|
79 /** |
|
80 * From CoeControl. Calls SizeChangedL with TRAP. |
|
81 */ |
|
82 void SizeChanged(); |
|
83 |
|
84 /** |
|
85 * Handle change of control size |
|
86 */ |
|
87 void SizeChangedL(); |
|
88 |
|
89 /** |
|
90 * From CoeControl. |
|
91 */ |
|
92 TInt CountComponentControls() const; |
|
93 |
|
94 /** |
|
95 * From CCoeControl. |
|
96 */ |
|
97 CCoeControl* ComponentControl(TInt aIndex) const; |
|
98 |
|
99 /** |
|
100 * Event handling section, e.g Listbox events. |
|
101 */ |
|
102 void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); |
|
103 |
|
104 void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); |
|
105 |
|
106 /** |
|
107 * From CCoeControl,Draw. |
|
108 */ |
|
109 void Draw(const TRect& aRect) const; |
|
110 |
|
111 /** |
|
112 * Key event handler. Handles up and down arrow keys, so that |
|
113 * output window can be scrolled. |
|
114 */ |
|
115 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
116 |
|
117 public: // convenience functions |
|
118 |
|
119 void DoShowMenuL(); |
|
120 |
|
121 |
|
122 |
|
123 private: //data |
|
124 |
|
125 CAknDoubleStyleListBox* iListBox; // owned |
|
126 CMCETestUIStreamViewModel* iListBoxModel; // ownership is given to iListBox |
|
127 |
|
128 CAknView& iOwningView; |
|
129 CMCETestUIEngine& iEngine; |
|
130 CMCETestUIEngineAudioStream& iStream; |
|
131 |
|
132 TBool iContextMenuAlreadyShown; |
|
133 |
|
134 }; |
|
135 |
|
136 |
|
137 /** |
|
138 * CMCETestUISessionViewContainer container control class. |
|
139 * |
|
140 */ |
|
141 class CMCETestUIVideoStreamViewContainer : |
|
142 public CCoeControl, public MCoeControlObserver, public MEikListBoxObserver |
|
143 { |
|
144 public: // Constructors and destructor |
|
145 |
|
146 static CMCETestUIVideoStreamViewContainer* NewL( |
|
147 const TRect& aRect, |
|
148 CAknView& aOwningView, |
|
149 CMCETestUIEngine& aEngine, |
|
150 CMCETestUIEngineVideoStream& aStream ); |
|
151 |
|
152 /** |
|
153 * Destructor. |
|
154 */ |
|
155 ~CMCETestUIVideoStreamViewContainer(); |
|
156 |
|
157 public: // New functions |
|
158 |
|
159 void ConstructModelL(); |
|
160 |
|
161 private: // Constructors |
|
162 |
|
163 CMCETestUIVideoStreamViewContainer( CAknView& aOwningView, |
|
164 CMCETestUIEngine& aEngine, |
|
165 CMCETestUIEngineVideoStream& aStream ); |
|
166 |
|
167 /** |
|
168 * @param aRect Frame rectangle for container. |
|
169 */ |
|
170 void ConstructL(const TRect& aRect); |
|
171 |
|
172 private: // Functions from base classes |
|
173 |
|
174 /** |
|
175 * From CoeControl. Calls SizeChangedL with TRAP. |
|
176 */ |
|
177 void SizeChanged(); |
|
178 |
|
179 /** |
|
180 * Handle change of control size |
|
181 */ |
|
182 void SizeChangedL(); |
|
183 |
|
184 /** |
|
185 * From CoeControl. |
|
186 */ |
|
187 TInt CountComponentControls() const; |
|
188 |
|
189 /** |
|
190 * From CCoeControl. |
|
191 */ |
|
192 CCoeControl* ComponentControl(TInt aIndex) const; |
|
193 |
|
194 /** |
|
195 * Event handling section, e.g Listbox events. |
|
196 */ |
|
197 void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType); |
|
198 |
|
199 void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType); |
|
200 |
|
201 /** |
|
202 * From CCoeControl,Draw. |
|
203 */ |
|
204 void Draw(const TRect& aRect) const; |
|
205 |
|
206 /** |
|
207 * Key event handler. Handles up and down arrow keys, so that |
|
208 * output window can be scrolled. |
|
209 */ |
|
210 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
211 |
|
212 public: // convenience functions |
|
213 |
|
214 void DoShowMenuL(); |
|
215 |
|
216 |
|
217 |
|
218 private: //data |
|
219 |
|
220 CAknDoubleStyleListBox* iListBox; // owned |
|
221 CMCETestUIVideoStreamViewModel* iListBoxModel; // ownership is given to iListBox |
|
222 |
|
223 CAknView& iOwningView; |
|
224 CMCETestUIEngine& iEngine; |
|
225 CMCETestUIEngineVideoStream& iStream; |
|
226 |
|
227 TBool iContextMenuAlreadyShown; |
|
228 |
|
229 }; |
|
230 #endif |
|
231 |
|
232 // End of File |