|
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: Implementation of the CVtUiRemoteVideoControl |
|
15 * control class. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include <cvtlogger.h> |
|
22 #include <eikdef.h> |
|
23 #include <AknIncallBubbleNotify.h> |
|
24 #include <AknsLayeredBackgroundControlContext.h> |
|
25 #include <AknUtils.h> |
|
26 #include <aknnavi.h> |
|
27 #include <akntitle.h> |
|
28 #include <AknDlgShut.h> |
|
29 #include <aknnotedialog.h> |
|
30 #include <aknnotewrappers.h> |
|
31 #include <akncontext.h> |
|
32 #include <eikspane.h> |
|
33 #include <eikmenup.h> |
|
34 #include <eikmenub.h> |
|
35 #include <apgcli.h> |
|
36 #include <featmgr.h> |
|
37 #include <videotelui.rsg> |
|
38 #include <hlplch.h> |
|
39 #include <apgwgnam.h> |
|
40 #include <StringLoader.h> |
|
41 #include <AknDef.h> |
|
42 #include <aknconsts.h> |
|
43 #include "CVtUiRemoteVideoControl.h" |
|
44 #include "CVtUiAppUi.h" |
|
45 #include "CVtUiContextControl.h" |
|
46 |
|
47 |
|
48 // Implementation of CVtUiRemoteVideoControl |
|
49 |
|
50 // ----------------------------------------------------------------------------- |
|
51 // CVtUiRemoteVideoControl::NewL |
|
52 // ----------------------------------------------------------------------------- |
|
53 |
|
54 CVtUiRemoteVideoControl* CVtUiRemoteVideoControl::NewL( CVtUiAppUi& aAppUi) |
|
55 { |
|
56 __VTPRINTENTER( "RemoteVideoControl.NewL" ) |
|
57 CVtUiRemoteVideoControl* self = new ( ELeave ) CVtUiRemoteVideoControl(aAppUi); |
|
58 CleanupStack::PushL( self ); |
|
59 self->ConstructL(); |
|
60 CleanupStack::Pop(); // self |
|
61 __VTPRINTEXIT( "RemoteVideoControl.NewL" ) |
|
62 return self; |
|
63 |
|
64 } |
|
65 // --------------------------------------------------------------------------- |
|
66 // CVtUiRemoteVideoControl::~CVtUiRemoteVideoControl |
|
67 // --------------------------------------------------------------------------- |
|
68 // |
|
69 CVtUiRemoteVideoControl::~CVtUiRemoteVideoControl() |
|
70 { |
|
71 if ( iAppUi.EventMonitor() ) |
|
72 { |
|
73 iAppUi.EventMonitor()->RemoveObserver( this ); |
|
74 } |
|
75 __VTPRINTENTER( "RemoteVideoControl.~" ) |
|
76 __VTPRINTEXIT( "RemoteVideoControl.~" ) |
|
77 } |
|
78 |
|
79 // --------------------------------------------------------------------------- |
|
80 // CVtUiRemoteVideoControl::CVtUiVideoControlBase |
|
81 // --------------------------------------------------------------------------- |
|
82 // |
|
83 CVtUiRemoteVideoControl::CVtUiRemoteVideoControl( CVtUiAppUi& aAppUi): |
|
84 iAppUi(aAppUi) |
|
85 { |
|
86 __VTPRINTENTER( "RemoteVideoControl.ctor" ) |
|
87 __VTPRINTEXIT( "RemoteVideoControl.ctor" ) |
|
88 } |
|
89 |
|
90 // --------------------------------------------------------------------------- |
|
91 // CVtUiRemoteVideoControl::BaseConstructL |
|
92 // --------------------------------------------------------------------------- |
|
93 // |
|
94 void CVtUiRemoteVideoControl::ConstructL() |
|
95 { |
|
96 __VTPRINTENTER( "RemoteVideoControl.ConstructL" ) |
|
97 CreateWindowL(); |
|
98 SetExtent( TPoint(), TSize() ); |
|
99 ActivateL(); |
|
100 |
|
101 if ( iAppUi.EventMonitor() ) |
|
102 { |
|
103 iAppUi.EventMonitor()->AddObserverL( this ); |
|
104 } |
|
105 |
|
106 __VTPRINTEXIT( "RemoteVideoControl.ConstructL" ) |
|
107 } |
|
108 |
|
109 RWindow& CVtUiRemoteVideoControl::GetRWindow() |
|
110 { |
|
111 __VTPRINTENTER( "RemoteVideoControl.GetRWindow" ) |
|
112 __VTPRINTEXIT( "RemoteVideoControl.GetRWindow" ) |
|
113 return Window(); |
|
114 } |
|
115 |
|
116 // --------------------------------------------------------------------------- |
|
117 // CVtUiRemoteVideoControl::HandleSizeChanged |
|
118 // --------------------------------------------------------------------------- |
|
119 // |
|
120 void CVtUiRemoteVideoControl::HandleSizeChanged() |
|
121 { |
|
122 __VTPRINTENTER( "RemoteVideoControl.HandleSizeChanged" ) |
|
123 __VTPRINTEXIT( "RemoteVideoControl.HandleSizeChanged" ) |
|
124 } |
|
125 |
|
126 // ----------------------------------------------------------------------------- |
|
127 // CVtUiRemoteVideoControl::SizeChanged |
|
128 // ----------------------------------------------------------------------------- |
|
129 // |
|
130 void CVtUiRemoteVideoControl::SizeChanged() |
|
131 { |
|
132 __VTPRINTENTER( "RemoteVideoControl.SizeChanged" ) |
|
133 TPoint position = Position(); |
|
134 TRect rect = Rect(); |
|
135 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position x:%d", position.iX ) |
|
136 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position y:%d", position.iY ) |
|
137 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.x:%d", rect.iTl.iX ) |
|
138 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.y:%d", rect.iTl.iY ) |
|
139 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.x:%d", rect.iBr.iX ) |
|
140 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.y:%d", rect.iBr.iY ) |
|
141 |
|
142 __VTPRINTEXIT( "RemoteVideoControl.SizeChanged" ) |
|
143 } |
|
144 |
|
145 // ----------------------------------------------------------------------------- |
|
146 // CVtUiRemoteVideoControl::PositionChanged |
|
147 // ----------------------------------------------------------------------------- |
|
148 // |
|
149 void CVtUiRemoteVideoControl::PositionChanged() |
|
150 { |
|
151 __VTPRINTENTER( "RemoteVideoControl.PositionChanged" ) |
|
152 __VTPRINTEXIT( "RemoteVideoControl.PositionChanged" ) |
|
153 } |
|
154 |
|
155 // --------------------------------------------------------------------------- |
|
156 // CVtUiRemoteVideoControl::Draw |
|
157 // --------------------------------------------------------------------------- |
|
158 // |
|
159 void CVtUiRemoteVideoControl::Draw( const TRect& ) const |
|
160 { |
|
161 __VTPRINTENTER( "RemoteVideoControl.Draw" ) |
|
162 //DoDraw( SystemGc() ); |
|
163 __VTPRINTEXIT( "RemoteVideoControl.Draw" ) |
|
164 } |
|
165 |
|
166 // --------------------------------------------------------------------------- |
|
167 // CVtUiRemoteVideoControl::DoDraw |
|
168 // --------------------------------------------------------------------------- |
|
169 // |
|
170 void CVtUiRemoteVideoControl::DoDraw( CWindowGc& aGc ) const |
|
171 { |
|
172 __VTPRINTENTER( "RemoteVideoControl.DoDraw(gc)" ) |
|
173 |
|
174 aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
175 aGc.SetPenStyle( CGraphicsContext::ENullPen ); |
|
176 aGc.SetBrushColor( KRgbRed ); |
|
177 aGc.DrawRect( Rect() ); |
|
178 aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
179 |
|
180 TPoint position = Position(); |
|
181 TRect rect = Rect(); |
|
182 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position x:%d", position.iX ) |
|
183 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position y:%d", position.iY ) |
|
184 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.x:%d", rect.iTl.iX ) |
|
185 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.y:%d", rect.iTl.iY ) |
|
186 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.x:%d", rect.iBr.iX ) |
|
187 __VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.y:%d", rect.iBr.iY ) |
|
188 |
|
189 __VTPRINTEXIT( "RemoteVideoControl.DoDraw(gc)" ) |
|
190 } |
|
191 |
|
192 // ----------------------------------------------------------------------------- |
|
193 // CVtUiRemoteVideoControl::HandlePointerEventL |
|
194 // ----------------------------------------------------------------------------- |
|
195 // |
|
196 void CVtUiRemoteVideoControl::HandlePointerEventL( |
|
197 const TPointerEvent& aPointerEvent) |
|
198 { |
|
199 __VTPRINTENTER( "RemoteVideoControl.HandlePointerEventL" ) |
|
200 |
|
201 if(iAppUi.ContextControl().RemoteVideoControl()) |
|
202 { |
|
203 iAppUi.ContextControl().HandlePointerEventL(aPointerEvent); |
|
204 } |
|
205 |
|
206 __VTPRINTEXIT( "RemoteVideoControl.HandlePointerEventL" ) |
|
207 } |
|
208 |
|
209 // ----------------------------------------------------------------------------- |
|
210 // CVtUiRemoteVideoControl::HandleWsEventL |
|
211 // ----------------------------------------------------------------------------- |
|
212 // |
|
213 void CVtUiRemoteVideoControl::HandleWsEventL( const TWsEvent& aEvent, |
|
214 CCoeControl* aDestination ) |
|
215 { |
|
216 __VTPRINTENTER( "RemoteVideoControl.HandleWsEventL" ) |
|
217 |
|
218 if(iAppUi.ContextControl().RemoteVideoControl()) |
|
219 { |
|
220 iAppUi.ContextControl().HandleWsEventL( aEvent, aDestination ); |
|
221 } |
|
222 |
|
223 __VTPRINTEXIT( "RemoteVideoControl.HandleWsEventL" ) |
|
224 } |