25
|
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 "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: Bottom right outlook with 3-lines.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
#include "BMBubbleManager.h" //for enumerations
|
|
21 |
#include "BMBubbleOutlookBottomRiCnap.h"
|
|
22 |
#include "BMBubbleImageManager.h"
|
|
23 |
#include "BMResourceManager.h"
|
|
24 |
#include "BMBubbleHeader.h"
|
|
25 |
#include "BMLayout.h"
|
|
26 |
#include "BMUtils.h"
|
|
27 |
#include "BMLayout2.h"
|
|
28 |
#include "telbubblecustomelement.h"
|
|
29 |
|
|
30 |
#include <eiklabel.h>
|
|
31 |
#include <eikimage.h>
|
|
32 |
#include <eikenv.h>
|
|
33 |
#include <AknsUtils.h>
|
|
34 |
#include <AknsDrawUtils.h>
|
|
35 |
|
|
36 |
// ================= MEMBER FUNCTIONS =======================
|
|
37 |
|
|
38 |
// C++ default constructor can NOT contain any code, that
|
|
39 |
// might leave.
|
|
40 |
//
|
|
41 |
CBubbleOutlookBottomRightCnap::CBubbleOutlookBottomRightCnap
|
|
42 |
( CBubbleManager& aBubbleManager )
|
|
43 |
: CBubbleOutlookThreeLined( aBubbleManager )
|
|
44 |
{
|
|
45 |
}
|
|
46 |
|
|
47 |
// Symbian OS constructor can leave.
|
|
48 |
void CBubbleOutlookBottomRightCnap::ConstructL()
|
|
49 |
{
|
|
50 |
CBubbleOutlookThreeLined::ConstructL();
|
|
51 |
}
|
|
52 |
|
|
53 |
|
|
54 |
// Destructor
|
|
55 |
CBubbleOutlookBottomRightCnap::~CBubbleOutlookBottomRightCnap()
|
|
56 |
{
|
|
57 |
Reset();
|
|
58 |
}
|
|
59 |
|
|
60 |
|
|
61 |
// ---------------------------------------------------------------------------
|
|
62 |
// CBubbleOutlookBottomRightCnap::ReadBubbleHeader
|
|
63 |
//
|
|
64 |
//
|
|
65 |
// ---------------------------------------------------------------------------
|
|
66 |
//
|
|
67 |
void CBubbleOutlookBottomRightCnap::ReadBubbleHeader( CBubbleHeader& aHeader )
|
|
68 |
{
|
|
69 |
iHeader = &aHeader;
|
|
70 |
|
|
71 |
iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
|
|
72 |
|
|
73 |
if ( !iCallObjectDisplay )
|
|
74 |
{
|
|
75 |
GetCall1BubbleBitmaps();
|
|
76 |
}
|
|
77 |
|
|
78 |
CBubbleOutlookThreeLined::ReadBubbleHeader( aHeader );
|
|
79 |
}
|
|
80 |
|
|
81 |
// ---------------------------------------------------------------------------
|
|
82 |
// CBubbleOutlookBottomRightCnap::SizeChanged
|
|
83 |
// called by framwork when the view size is changed
|
|
84 |
//
|
|
85 |
// ---------------------------------------------------------------------------
|
|
86 |
//
|
|
87 |
void CBubbleOutlookBottomRightCnap::SizeChanged()
|
|
88 |
{
|
|
89 |
if( !iHeader )
|
|
90 |
{
|
|
91 |
return;
|
|
92 |
}
|
|
93 |
|
|
94 |
AknsUtils::RegisterControlPosition( this );
|
|
95 |
|
|
96 |
if ( !iCallObjectDisplay )
|
|
97 |
{
|
|
98 |
DoCall1Layout();
|
|
99 |
}
|
|
100 |
else
|
|
101 |
{
|
|
102 |
TRAPD( err, DoCall2LayoutL() );
|
|
103 |
if ( err )
|
|
104 |
{
|
|
105 |
iBubble->SetPicture( NULL, NULL );
|
|
106 |
|
|
107 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
108 |
AknsDrawUtils::PrepareFrame( skin,
|
|
109 |
iOuterRect,
|
|
110 |
iInnerRect,
|
|
111 |
iFrameId,
|
|
112 |
KAknsIIDDefault );
|
|
113 |
}
|
|
114 |
}
|
|
115 |
}
|
|
116 |
|
|
117 |
// ---------------------------------------------------------------------------
|
|
118 |
// CBubbleOutlookBottomRightCnap::PositionChanged
|
|
119 |
// ---------------------------------------------------------------------------
|
|
120 |
//
|
|
121 |
void CBubbleOutlookBottomRightCnap::PositionChanged()
|
|
122 |
{
|
|
123 |
AknsUtils::RegisterControlPosition( this );
|
|
124 |
}
|
|
125 |
|
|
126 |
// ---------------------------------------------------------------------------
|
|
127 |
// CBubbleOutlookBottomRightCnap::DoCall1Layout
|
|
128 |
// ---------------------------------------------------------------------------
|
|
129 |
//
|
|
130 |
void CBubbleOutlookBottomRightCnap::DoCall1Layout()
|
|
131 |
{
|
|
132 |
}
|
|
133 |
|
|
134 |
// ---------------------------------------------------------------------------
|
|
135 |
// CBubbleOutlookBottomRightCnap::DoCall2Layout
|
|
136 |
// ---------------------------------------------------------------------------
|
|
137 |
//
|
|
138 |
void CBubbleOutlookBottomRightCnap::DoCall2LayoutL()
|
|
139 |
{
|
|
140 |
iBubble->SetPictureOwnedExternally( EFalse );
|
|
141 |
iBubble->SetPicture( NULL, NULL );
|
|
142 |
|
|
143 |
const TRect rect = Rect();
|
|
144 |
CBubbleManager::TPhoneCallState callState = iHeader->CallState();
|
|
145 |
switch ( callState )
|
|
146 |
{
|
|
147 |
case CBubbleManager::EWaiting:
|
|
148 |
case CBubbleManager::EIncoming:
|
|
149 |
case CBubbleManager::EOutgoing:
|
|
150 |
case CBubbleManager::EAlerting:
|
|
151 |
case CBubbleManager::EAlertToDisconnected:
|
|
152 |
{
|
|
153 |
///////////////////////////////////////////////////////////////////
|
|
154 |
// Outgoing call layout. Three lines of text.
|
|
155 |
///////////////////////////////////////////////////////////////////
|
|
156 |
TAknLayoutRect bubbleRect;
|
|
157 |
bubbleRect.LayoutRect(
|
|
158 |
rect,
|
|
159 |
BubbleLayout2::popup_call2_audio_out_background(5) );
|
|
160 |
|
|
161 |
TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
|
|
162 |
TRect outerRect;
|
|
163 |
TRect innerRect;
|
|
164 |
BubbleLayout2::RectFrameInnerOuterRects( frameRect,
|
|
165 |
outerRect,
|
|
166 |
innerRect);
|
|
167 |
|
|
168 |
iFrameId = ( callState == CBubbleManager::EAlertToDisconnected ) ?
|
|
169 |
KAknsIIDQsnFrCall2RectDisconn :
|
|
170 |
KAknsIIDQsnFrCall2Rect;
|
|
171 |
|
|
172 |
iOuterRect = outerRect;
|
|
173 |
iOuterRect.Move( Rect().iTl );
|
|
174 |
iInnerRect = innerRect;
|
|
175 |
iInnerRect.Move( Rect().iTl );
|
|
176 |
|
|
177 |
|
|
178 |
// Call indicator
|
|
179 |
BubbleUtils::LayoutCustomElement(
|
|
180 |
iBigCallIndicator,
|
|
181 |
rect,
|
|
182 |
BubbleLayout2::popup_call2_audio_out_call_waiting_icon(5) );
|
|
183 |
|
|
184 |
// Ciphering off
|
|
185 |
BubbleUtils::LayoutControl(
|
|
186 |
iCyphOffImage,
|
|
187 |
rect,
|
|
188 |
BubbleLayout2::popup_call2_audio_out_ciphering_icon(5) );
|
|
189 |
|
|
190 |
// Number type icon
|
|
191 |
BubbleUtils::LayoutCustomElement(
|
|
192 |
iNumberType,
|
|
193 |
rect,
|
|
194 |
BubbleLayout2::popup_call2_audio_out_call_number_type_icon(4) );
|
|
195 |
|
|
196 |
// Text line 1
|
|
197 |
BubbleUtils::LayoutLabel(
|
|
198 |
iTextLine1,
|
|
199 |
rect,
|
|
200 |
BubbleLayout2::popup_call2_audio_out_call_text_1(5) );
|
|
201 |
|
|
202 |
// Smaller rect for text if brand image exists
|
|
203 |
if ( iBrandImage )
|
|
204 |
{
|
|
205 |
// Text line 2
|
|
206 |
BubbleUtils::LayoutLabel(
|
|
207 |
iTextLine2,
|
|
208 |
rect,
|
|
209 |
BubbleLayout2::popup_call2_audio_out_call_text_2(5) );
|
|
210 |
|
|
211 |
// Text line 3
|
|
212 |
BubbleUtils::LayoutLabel(
|
|
213 |
iTextLine3,
|
|
214 |
rect,
|
|
215 |
BubbleLayout2::popup_call2_audio_out_call_text_3(5) );
|
|
216 |
|
|
217 |
//Brand image
|
|
218 |
BubbleUtils::LayoutCustomElement(
|
|
219 |
iBrandImage,
|
|
220 |
rect,
|
|
221 |
BubbleLayout2::popup_call2_audio_out_brand_image(1) );
|
|
222 |
}
|
|
223 |
else
|
|
224 |
{
|
|
225 |
// Text line 2
|
|
226 |
BubbleUtils::LayoutLabel(
|
|
227 |
iTextLine2,
|
|
228 |
rect,
|
|
229 |
BubbleLayout2::popup_call2_audio_out_call_text_2(4) );
|
|
230 |
|
|
231 |
// Text line 3
|
|
232 |
BubbleUtils::LayoutLabel(
|
|
233 |
iTextLine3,
|
|
234 |
rect,
|
|
235 |
BubbleLayout2::popup_call2_audio_out_call_text_3(4) );
|
|
236 |
}
|
|
237 |
|
|
238 |
// Create call object bitmaps
|
|
239 |
iBubble->SetRect( bubbleRect.Rect() );
|
|
240 |
|
|
241 |
BubbleUtils::PrepareBubbleImageL(
|
|
242 |
iFrameId,
|
|
243 |
outerRect,
|
|
244 |
innerRect,
|
|
245 |
iBubble );
|
|
246 |
|
|
247 |
break;
|
|
248 |
}
|
|
249 |
|
|
250 |
case CBubbleManager::EActive:
|
|
251 |
case CBubbleManager::EOnHold:
|
|
252 |
case CBubbleManager::EDisconnected:
|
|
253 |
{
|
|
254 |
///////////////////////////////////////////////////////////////////
|
|
255 |
// Second call layout for single call. Three lines of text.
|
|
256 |
///////////////////////////////////////////////////////////////////
|
|
257 |
|
|
258 |
TAknLayoutRect bubbleRect;
|
|
259 |
bubbleRect.LayoutRect(
|
|
260 |
rect,
|
|
261 |
BubbleLayout2::popup_call2_audio_second_call_background(14) );
|
|
262 |
|
|
263 |
TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
|
|
264 |
TRect outerRect;
|
|
265 |
TRect innerRect;
|
|
266 |
BubbleLayout2::BubbleFrameInnerOuterRects( frameRect,
|
|
267 |
outerRect,
|
|
268 |
innerRect);
|
|
269 |
|
|
270 |
if ( callState == CBubbleManager::EOnHold )
|
|
271 |
{
|
|
272 |
iFrameId = KAknsIIDQsnFrCall2Bubble;
|
|
273 |
}
|
|
274 |
else if ( callState == CBubbleManager::EDisconnected )
|
|
275 |
{
|
|
276 |
iFrameId = KAknsIIDQsnFrCall2BubbleSecondDisconn;
|
|
277 |
}
|
|
278 |
else
|
|
279 |
{
|
|
280 |
iFrameId = KAknsIIDQsnFrCall2BubbleSecond;
|
|
281 |
}
|
|
282 |
|
|
283 |
// for possible frame draw
|
|
284 |
iOuterRect = outerRect;
|
|
285 |
iOuterRect.Move( Rect().iTl );
|
|
286 |
iInnerRect = innerRect;
|
|
287 |
iInnerRect.Move( Rect().iTl );
|
|
288 |
|
|
289 |
// Call icon
|
|
290 |
BubbleUtils::LayoutCustomElement(
|
|
291 |
iSmallCallIndication,
|
|
292 |
rect,
|
|
293 |
BubbleLayout2::popup_call2_audio_second_call_status_icon(14) );
|
|
294 |
|
|
295 |
// Ciphering off
|
|
296 |
BubbleUtils::LayoutControl(
|
|
297 |
iCyphOffImage,
|
|
298 |
rect,
|
|
299 |
BubbleLayout2::popup_call2_audio_second_call_cyphering_icon(14) );
|
|
300 |
|
|
301 |
// Call type pane
|
|
302 |
BubbleUtils::LayoutCallTypeIndicators(
|
|
303 |
rect,
|
|
304 |
BubbleLayout2::popup_call2_audio_second_call_type_icon(14),
|
|
305 |
iTypeIndication1, // Data/Fax
|
|
306 |
iTypeIndication2 ); // ALS line 2
|
|
307 |
|
|
308 |
// Text line 1
|
|
309 |
BubbleUtils::LayoutLabel(
|
|
310 |
iTextLine1,
|
|
311 |
rect,
|
|
312 |
BubbleLayout2::popup_call2_audio_second_call_cli_text(16) );
|
|
313 |
|
|
314 |
// Text line 2 - phone number
|
|
315 |
BubbleUtils::LayoutLabel(
|
|
316 |
iTextLine2,
|
|
317 |
rect,
|
|
318 |
BubbleLayout2::popup_call2_audio_second_call_number_text(16) );
|
|
319 |
|
|
320 |
// Smaller rect for text if brand image exists
|
|
321 |
if ( iBrandImage )
|
|
322 |
{
|
|
323 |
// Text line 3 - call state
|
|
324 |
BubbleUtils::LayoutLabel(
|
|
325 |
iTextLine3,
|
|
326 |
rect,
|
|
327 |
BubbleLayout2::popup_call2_audio_second_call_state_text(18) );
|
|
328 |
|
|
329 |
// Text line 3 - call timer
|
|
330 |
BubbleUtils::LayoutLabel(
|
|
331 |
iTimerCost,
|
|
332 |
rect,
|
|
333 |
BubbleLayout2::popup_call2_audio_second_call_timer_text(7) );
|
|
334 |
|
|
335 |
//Brand image
|
|
336 |
BubbleUtils::LayoutCustomElement(
|
|
337 |
iBrandImage,
|
|
338 |
rect,
|
|
339 |
BubbleLayout2::popup_call2_audio_second_brand_image(2) );
|
|
340 |
}
|
|
341 |
else
|
|
342 |
{
|
|
343 |
// Text line 3 - call state
|
|
344 |
BubbleUtils::LayoutLabel(
|
|
345 |
iTextLine3,
|
|
346 |
rect,
|
|
347 |
BubbleLayout2::popup_call2_audio_second_call_state_text(15) );
|
|
348 |
|
|
349 |
// Text line 3 - call timer
|
|
350 |
BubbleUtils::LayoutLabel(
|
|
351 |
iTimerCost,
|
|
352 |
rect,
|
|
353 |
BubbleLayout2::popup_call2_audio_second_call_timer_text(6) );
|
|
354 |
}
|
|
355 |
|
|
356 |
// Build call object bubble
|
|
357 |
iBubble->SetRect( bubbleRect.Rect() );
|
|
358 |
|
|
359 |
BubbleUtils::PrepareBubbleImageL(
|
|
360 |
iFrameId,
|
|
361 |
outerRect,
|
|
362 |
innerRect,
|
|
363 |
iBubble );
|
|
364 |
|
|
365 |
break;
|
|
366 |
}
|
|
367 |
|
|
368 |
default:
|
|
369 |
break;
|
|
370 |
}
|
|
371 |
}
|
|
372 |
|
|
373 |
// ---------------------------------------------------------------------------
|
|
374 |
// CBubbleOutlookBottomRightCnap::GetCall1BubbleBitmaps
|
|
375 |
// ---------------------------------------------------------------------------
|
|
376 |
//
|
|
377 |
void CBubbleOutlookBottomRightCnap::GetCall1BubbleBitmaps()
|
|
378 |
{
|
|
379 |
}
|
|
380 |
|
|
381 |
// End of File
|