62
|
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 outlook with 3-lines and call image.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
#include "BMBubbleManager.h" //for enumerations
|
|
21 |
#include "BMBubbleOutlookBottomImCnap.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 |
CBubbleOutlookBottomImageCnap::CBubbleOutlookBottomImageCnap
|
|
42 |
( CBubbleManager& aBubbleManager )
|
|
43 |
: CBubbleOutlookThreeLined( aBubbleManager )
|
|
44 |
{
|
|
45 |
}
|
|
46 |
|
|
47 |
// Symbian OS constructor can leave.
|
|
48 |
void CBubbleOutlookBottomImageCnap::ConstructL()
|
|
49 |
{
|
|
50 |
CBubbleOutlookThreeLined::ConstructL();
|
|
51 |
}
|
|
52 |
|
|
53 |
|
|
54 |
// Destructor
|
|
55 |
CBubbleOutlookBottomImageCnap::~CBubbleOutlookBottomImageCnap()
|
|
56 |
{
|
|
57 |
Reset();
|
|
58 |
}
|
|
59 |
|
|
60 |
|
|
61 |
// ---------------------------------------------------------------------------
|
|
62 |
// CBubbleOutlookBottomImageCnap::ReadBubbleHeader
|
|
63 |
//
|
|
64 |
//
|
|
65 |
// ---------------------------------------------------------------------------
|
|
66 |
//
|
|
67 |
void CBubbleOutlookBottomImageCnap::ReadBubbleHeader( CBubbleHeader& aHeader )
|
|
68 |
{
|
|
69 |
iHeader = &aHeader;
|
|
70 |
|
|
71 |
iBubble = iBubbleManager.ResourceManager().ReserveEikImage( ETrue );
|
|
72 |
|
|
73 |
CBubbleOutlookThreeLined::ReadBubbleHeader( aHeader );
|
|
74 |
}
|
|
75 |
|
|
76 |
// ---------------------------------------------------------------------------
|
|
77 |
// CBubbleOutlookBottomImageCnap::SizeChanged
|
|
78 |
// called by framwork when the view size is changed
|
|
79 |
//
|
|
80 |
// ---------------------------------------------------------------------------
|
|
81 |
//
|
|
82 |
void CBubbleOutlookBottomImageCnap::SizeChanged()
|
|
83 |
{
|
|
84 |
if( !iHeader )
|
|
85 |
{
|
|
86 |
return;
|
|
87 |
}
|
|
88 |
|
|
89 |
AknsUtils::RegisterControlPosition( this );
|
|
90 |
|
|
91 |
if ( !iCallObjectDisplay )
|
|
92 |
{
|
|
93 |
DoCall1Layout();
|
|
94 |
}
|
|
95 |
else
|
|
96 |
{
|
|
97 |
TRAPD( err, DoCall2LayoutL() );
|
|
98 |
if ( err )
|
|
99 |
{
|
|
100 |
iBubble->SetPicture( NULL, NULL );
|
|
101 |
|
|
102 |
MAknsSkinInstance* skin = AknsUtils::SkinInstance();
|
|
103 |
AknsDrawUtils::PrepareFrame( skin,
|
|
104 |
iOuterRect,
|
|
105 |
iInnerRect,
|
|
106 |
iFrameId,
|
|
107 |
KAknsIIDDefault );
|
|
108 |
}
|
|
109 |
}
|
|
110 |
}
|
|
111 |
|
|
112 |
// ---------------------------------------------------------------------------
|
|
113 |
// CBubbleOutlookBottomImageCnap::PositionChanged
|
|
114 |
// ---------------------------------------------------------------------------
|
|
115 |
//
|
|
116 |
void CBubbleOutlookBottomImageCnap::PositionChanged()
|
|
117 |
{
|
|
118 |
AknsUtils::RegisterControlPosition( this );
|
|
119 |
}
|
|
120 |
|
|
121 |
// ---------------------------------------------------------------------------
|
|
122 |
// CBubbleOutlookBottomImageCnap::DoCall1Layout
|
|
123 |
// ---------------------------------------------------------------------------
|
|
124 |
//
|
|
125 |
void CBubbleOutlookBottomImageCnap::DoCall1Layout()
|
|
126 |
{
|
|
127 |
}
|
|
128 |
|
|
129 |
// ---------------------------------------------------------------------------
|
|
130 |
// CBubbleOutlookBottomImageCnap::DoCall2Layout
|
|
131 |
// ---------------------------------------------------------------------------
|
|
132 |
//
|
|
133 |
void CBubbleOutlookBottomImageCnap::DoCall2LayoutL()
|
|
134 |
{
|
|
135 |
iBubble->SetPictureOwnedExternally( EFalse );
|
|
136 |
iBubble->SetPicture( NULL, NULL );
|
|
137 |
|
|
138 |
const TRect rect = Rect();
|
|
139 |
CBubbleManager::TPhoneCallState callState = iHeader->CallState();
|
|
140 |
switch ( callState )
|
|
141 |
{
|
|
142 |
case CBubbleManager::EDisconnected:
|
|
143 |
case CBubbleManager::EActive:
|
|
144 |
case CBubbleManager::EOnHold:
|
|
145 |
{
|
|
146 |
///////////////////////////////////////////////////////////////////
|
|
147 |
// First incall layout for single call. Call object image.
|
|
148 |
///////////////////////////////////////////////////////////////////
|
|
149 |
|
|
150 |
TAknLayoutRect bubbleRect;
|
|
151 |
bubbleRect.LayoutRect(
|
|
152 |
rect,
|
|
153 |
BubbleLayout2::popup_call2_audio_first_call_background(20) );
|
|
154 |
|
|
155 |
TRect frameRect( TPoint(0,0), bubbleRect.Rect().Size() );
|
|
156 |
TRect outerRect;
|
|
157 |
TRect innerRect;
|
|
158 |
BubbleLayout2::BubbleFrameInnerOuterRects( frameRect,
|
|
159 |
outerRect,
|
|
160 |
innerRect);
|
|
161 |
|
|
162 |
if ( callState == CBubbleManager::EOnHold )
|
|
163 |
{
|
|
164 |
iFrameId = KAknsIIDQsnFrCall2Bubble;
|
|
165 |
}
|
|
166 |
else if ( callState == CBubbleManager::EDisconnected )
|
|
167 |
{
|
|
168 |
iFrameId = KAknsIIDQsnFrCall2BubbleFirstDisconn;
|
|
169 |
}
|
|
170 |
else
|
|
171 |
{
|
|
172 |
iFrameId = KAknsIIDQsnFrCall2BubbleFirst;
|
|
173 |
}
|
|
174 |
|
|
175 |
iOuterRect = outerRect;
|
|
176 |
iOuterRect.Move( Rect().iTl );
|
|
177 |
iInnerRect = innerRect;
|
|
178 |
iInnerRect.Move( Rect().iTl );
|
|
179 |
|
|
180 |
// Call icon
|
|
181 |
BubbleUtils::LayoutCustomElement(
|
|
182 |
iSmallCallIndication,
|
|
183 |
rect,
|
|
184 |
BubbleLayout2::popup_call2_audio_first_call_status_icon(19) );
|
|
185 |
|
|
186 |
// Ciphering off
|
|
187 |
BubbleUtils::LayoutControl(
|
|
188 |
iCyphOffImage,
|
|
189 |
rect,
|
|
190 |
BubbleLayout2::popup_call2_audio_first_call_window_ciphering_icon(16) );
|
|
191 |
|
|
192 |
// Call type pane
|
|
193 |
BubbleUtils::LayoutCallTypeIndicators(
|
|
194 |
rect,
|
|
195 |
BubbleLayout2::popup_call2_audio_first_call_type_icon(16),
|
|
196 |
iTypeIndication1, // Data/Fax
|
|
197 |
iTypeIndication2 ); // ALS line 2
|
|
198 |
|
|
199 |
// Text line 1 - cli
|
|
200 |
BubbleUtils::LayoutLabel(
|
|
201 |
iTextLine1,
|
|
202 |
rect,
|
|
203 |
BubbleLayout2::popup_call2_audio_first_call_cli_text(22) );
|
|
204 |
|
|
205 |
// Text line 2 - phone number
|
|
206 |
BubbleUtils::LayoutLabel(
|
|
207 |
iTextLine2,
|
|
208 |
rect,
|
|
209 |
BubbleLayout2::popup_call2_audio_first_call_number_text(18) );
|
|
210 |
|
|
211 |
// Smaller rect for text if brand image exists
|
|
212 |
if ( iBrandImage )
|
|
213 |
{
|
|
214 |
// Text line 2 - call state
|
|
215 |
BubbleUtils::LayoutLabel(
|
|
216 |
iTextLine3,
|
|
217 |
rect,
|
|
218 |
BubbleLayout2::popup_call2_audio_first_call_state_text(18) );
|
|
219 |
|
|
220 |
// Text line 2 - call timer
|
|
221 |
BubbleUtils::LayoutLabel(
|
|
222 |
iTimerCost,
|
|
223 |
rect,
|
|
224 |
BubbleLayout2::popup_call2_audio_first_call_state_text(20) );
|
|
225 |
|
|
226 |
//Brand image
|
|
227 |
BubbleUtils::LayoutCustomElement(
|
|
228 |
iBrandImage,
|
|
229 |
rect,
|
|
230 |
BubbleLayout2::popup_call2_audio_first_brand_image2(22) );
|
|
231 |
}
|
|
232 |
else
|
|
233 |
{
|
|
234 |
// Text line 2 - call state
|
|
235 |
BubbleUtils::LayoutLabel(
|
|
236 |
iTextLine3,
|
|
237 |
rect,
|
|
238 |
BubbleLayout2::popup_call2_audio_first_call_state_text(18) );
|
|
239 |
|
|
240 |
// Text line 2 - call timer
|
|
241 |
BubbleUtils::LayoutLabel(
|
|
242 |
iTimerCost,
|
|
243 |
rect,
|
|
244 |
BubbleLayout2::popup_call2_audio_first_call_state_text(20) );
|
|
245 |
}
|
|
246 |
|
|
247 |
// Create call object bitmaps
|
|
248 |
iBubble->SetRect( bubbleRect.Rect() );
|
|
249 |
|
|
250 |
BubbleUtils::PrepareBubbleImageL(
|
|
251 |
iFrameId,
|
|
252 |
outerRect,
|
|
253 |
innerRect,
|
|
254 |
iBubble );
|
|
255 |
|
|
256 |
break;
|
|
257 |
}
|
|
258 |
default:
|
|
259 |
break;
|
|
260 |
}
|
|
261 |
}
|
|
262 |
|
|
263 |
// ---------------------------------------------------------------------------
|
|
264 |
// CBubbleOutlookBottomImageCnap::GetCall1BubbleBitmaps
|
|
265 |
// ---------------------------------------------------------------------------
|
|
266 |
//
|
|
267 |
void CBubbleOutlookBottomImageCnap::GetCall1BubbleBitmaps()
|
|
268 |
{
|
|
269 |
}
|
|
270 |
|
|
271 |
// End of File
|