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