author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:34:55 +0300 | |
branch | RCL_3 |
changeset 49 | 8e703580edd3 |
parent 35 | 779871d1e4f4 |
permissions | -rw-r--r-- |
35 | 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 |
||
49
8e703580edd3
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
101 |
// Disable fading when using DP (eliminates nasty color error) |
8e703580edd3
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
102 |
if ( FeatureManager::FeatureSupported( KFeatureIdDisplayPost ) ) |
8e703580edd3
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
103 |
{ |
8e703580edd3
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
104 |
Window().SetNonFading( ETrue ); |
8e703580edd3
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
105 |
} |
8e703580edd3
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
35
diff
changeset
|
106 |
|
35 | 107 |
if ( iAppUi.EventMonitor() ) |
108 |
{ |
|
109 |
iAppUi.EventMonitor()->AddObserverL( this ); |
|
110 |
} |
|
111 |
||
112 |
__VTPRINTEXIT( "RemoteVideoControl.ConstructL" ) |
|
113 |
} |
|
114 |
||
115 |
RWindow& CVtUiRemoteVideoControl::GetRWindow() |
|
116 |
{ |
|
117 |
__VTPRINTENTER( "RemoteVideoControl.GetRWindow" ) |
|
118 |
__VTPRINTEXIT( "RemoteVideoControl.GetRWindow" ) |
|
119 |
return Window(); |
|
120 |
} |
|
121 |
||
122 |
// --------------------------------------------------------------------------- |
|
123 |
// CVtUiRemoteVideoControl::HandleSizeChanged |
|
124 |
// --------------------------------------------------------------------------- |
|
125 |
// |
|
126 |
void CVtUiRemoteVideoControl::HandleSizeChanged() |
|
127 |
{ |
|
128 |
__VTPRINTENTER( "RemoteVideoControl.HandleSizeChanged" ) |
|
129 |
__VTPRINTEXIT( "RemoteVideoControl.HandleSizeChanged" ) |
|
130 |
} |
|
131 |
||
132 |
// ----------------------------------------------------------------------------- |
|
133 |
// CVtUiRemoteVideoControl::SizeChanged |
|
134 |
// ----------------------------------------------------------------------------- |
|
135 |
// |
|
136 |
void CVtUiRemoteVideoControl::SizeChanged() |
|
137 |
{ |
|
138 |
__VTPRINTENTER( "RemoteVideoControl.SizeChanged" ) |
|
139 |
TPoint position = Position(); |
|
140 |
TRect rect = Rect(); |
|
141 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position x:%d", position.iX ) |
|
142 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position y:%d", position.iY ) |
|
143 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.x:%d", rect.iTl.iX ) |
|
144 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.y:%d", rect.iTl.iY ) |
|
145 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.x:%d", rect.iBr.iX ) |
|
146 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.y:%d", rect.iBr.iY ) |
|
147 |
||
148 |
__VTPRINTEXIT( "RemoteVideoControl.SizeChanged" ) |
|
149 |
} |
|
150 |
||
151 |
// ----------------------------------------------------------------------------- |
|
152 |
// CVtUiRemoteVideoControl::PositionChanged |
|
153 |
// ----------------------------------------------------------------------------- |
|
154 |
// |
|
155 |
void CVtUiRemoteVideoControl::PositionChanged() |
|
156 |
{ |
|
157 |
__VTPRINTENTER( "RemoteVideoControl.PositionChanged" ) |
|
158 |
__VTPRINTEXIT( "RemoteVideoControl.PositionChanged" ) |
|
159 |
} |
|
160 |
||
161 |
// --------------------------------------------------------------------------- |
|
162 |
// CVtUiRemoteVideoControl::Draw |
|
163 |
// --------------------------------------------------------------------------- |
|
164 |
// |
|
165 |
void CVtUiRemoteVideoControl::Draw( const TRect& ) const |
|
166 |
{ |
|
167 |
__VTPRINTENTER( "RemoteVideoControl.Draw" ) |
|
168 |
//DoDraw( SystemGc() ); |
|
169 |
__VTPRINTEXIT( "RemoteVideoControl.Draw" ) |
|
170 |
} |
|
171 |
||
172 |
// --------------------------------------------------------------------------- |
|
173 |
// CVtUiRemoteVideoControl::DoDraw |
|
174 |
// --------------------------------------------------------------------------- |
|
175 |
// |
|
176 |
void CVtUiRemoteVideoControl::DoDraw( CWindowGc& aGc ) const |
|
177 |
{ |
|
178 |
__VTPRINTENTER( "RemoteVideoControl.DoDraw(gc)" ) |
|
179 |
||
180 |
aGc.SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
181 |
aGc.SetPenStyle( CGraphicsContext::ENullPen ); |
|
182 |
aGc.SetBrushColor( KRgbRed ); |
|
183 |
aGc.DrawRect( Rect() ); |
|
184 |
aGc.SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
185 |
||
186 |
TPoint position = Position(); |
|
187 |
TRect rect = Rect(); |
|
188 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position x:%d", position.iX ) |
|
189 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl position y:%d", position.iY ) |
|
190 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.x:%d", rect.iTl.iX ) |
|
191 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iTl.y:%d", rect.iTl.iY ) |
|
192 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.x:%d", rect.iBr.iX ) |
|
193 |
__VTPRINT2( DEBUG_GEN, "CVtUiRemoteVideoControl rect iBr.y:%d", rect.iBr.iY ) |
|
194 |
||
195 |
__VTPRINTEXIT( "RemoteVideoControl.DoDraw(gc)" ) |
|
196 |
} |
|
197 |
||
198 |
// ----------------------------------------------------------------------------- |
|
199 |
// CVtUiRemoteVideoControl::HandlePointerEventL |
|
200 |
// ----------------------------------------------------------------------------- |
|
201 |
// |
|
202 |
void CVtUiRemoteVideoControl::HandlePointerEventL( |
|
203 |
const TPointerEvent& aPointerEvent) |
|
204 |
{ |
|
205 |
__VTPRINTENTER( "RemoteVideoControl.HandlePointerEventL" ) |
|
206 |
||
207 |
if(iAppUi.ContextControl().RemoteVideoControl()) |
|
208 |
{ |
|
209 |
iAppUi.ContextControl().HandlePointerEventL(aPointerEvent); |
|
210 |
} |
|
211 |
||
212 |
__VTPRINTEXIT( "RemoteVideoControl.HandlePointerEventL" ) |
|
213 |
} |
|
214 |
||
215 |
// ----------------------------------------------------------------------------- |
|
216 |
// CVtUiRemoteVideoControl::HandleWsEventL |
|
217 |
// ----------------------------------------------------------------------------- |
|
218 |
// |
|
219 |
void CVtUiRemoteVideoControl::HandleWsEventL( const TWsEvent& aEvent, |
|
220 |
CCoeControl* aDestination ) |
|
221 |
{ |
|
222 |
__VTPRINTENTER( "RemoteVideoControl.HandleWsEventL" ) |
|
223 |
||
224 |
if(iAppUi.ContextControl().RemoteVideoControl()) |
|
225 |
{ |
|
226 |
iAppUi.ContextControl().HandleWsEventL( aEvent, aDestination ); |
|
227 |
} |
|
228 |
||
229 |
__VTPRINTEXIT( "RemoteVideoControl.HandleWsEventL" ) |
|
230 |
} |