115 void CAknTabGroupGraphics::SetTabGroupBackgroundParent( TRect aParent ) |
185 void CAknTabGroupGraphics::SetTabGroupBackgroundParent( TRect aParent ) |
116 { |
186 { |
117 iTabGroupBackgroundParent = aParent; |
187 iTabGroupBackgroundParent = aParent; |
118 } |
188 } |
119 |
189 |
120 #if 0 |
|
121 |
|
122 CAknTabGroupGraphics::SAknTabGroupBackground CAknTabGroupGraphics::CreateTabGroupBackgroundL( TInt aAvkonBitmapId) |
|
123 { |
|
124 CAknTabGroupGraphics::SAknTabGroupBackground emptyTabGroupBackGround; |
|
125 |
|
126 if ( !TabGroupBackgroundAvailable() ) |
|
127 { |
|
128 return emptyTabGroupBackGround; |
|
129 } |
|
130 |
|
131 TBool longTabs = EFalse; |
|
132 TInt numberOfTabs = 0; |
|
133 TInt activeTab = 0; |
|
134 |
|
135 switch ( aAvkonBitmapId ) |
|
136 { |
|
137 case EMbmAvkonQgn_graf_tab_21: |
|
138 { |
|
139 longTabs = EFalse; |
|
140 numberOfTabs = 2; |
|
141 activeTab = 1; |
|
142 break; |
|
143 } |
|
144 case EMbmAvkonQgn_graf_tab_22: |
|
145 { |
|
146 longTabs = EFalse; |
|
147 numberOfTabs = 2; |
|
148 activeTab = 2; |
|
149 break; |
|
150 } |
|
151 case EMbmAvkonQgn_graf_tab_31: |
|
152 { |
|
153 longTabs = EFalse; |
|
154 numberOfTabs = 3; |
|
155 activeTab = 1; |
|
156 break; |
|
157 } |
|
158 case EMbmAvkonQgn_graf_tab_32: |
|
159 { |
|
160 longTabs = EFalse; |
|
161 numberOfTabs = 3; |
|
162 activeTab = 2; |
|
163 break; |
|
164 } |
|
165 case EMbmAvkonQgn_graf_tab_33: |
|
166 { |
|
167 longTabs = EFalse; |
|
168 numberOfTabs = 3; |
|
169 activeTab = 3; |
|
170 break; |
|
171 } |
|
172 case EMbmAvkonQgn_graf_tab_41: |
|
173 { |
|
174 longTabs = EFalse; |
|
175 numberOfTabs = 4; |
|
176 activeTab = 1; |
|
177 break; |
|
178 } |
|
179 case EMbmAvkonQgn_graf_tab_42: |
|
180 { |
|
181 longTabs = EFalse; |
|
182 numberOfTabs = 4; |
|
183 activeTab = 2; |
|
184 break; |
|
185 } |
|
186 case EMbmAvkonQgn_graf_tab_43: |
|
187 { |
|
188 longTabs = EFalse; |
|
189 numberOfTabs = 4; |
|
190 activeTab = 3; |
|
191 break; |
|
192 } |
|
193 case EMbmAvkonQgn_graf_tab_44: |
|
194 { |
|
195 longTabs = EFalse; |
|
196 numberOfTabs = 4; |
|
197 activeTab = 4; |
|
198 break; |
|
199 } |
|
200 case EMbmAvkonQgn_graf_tab_long_21: |
|
201 { |
|
202 longTabs = ETrue; |
|
203 numberOfTabs = 2; |
|
204 activeTab = 1; |
|
205 break; |
|
206 } |
|
207 case EMbmAvkonQgn_graf_tab_long_22: |
|
208 { |
|
209 longTabs = ETrue; |
|
210 numberOfTabs = 2; |
|
211 activeTab = 2; |
|
212 break; |
|
213 } |
|
214 case EMbmAvkonQgn_graf_tab_long_31: |
|
215 { |
|
216 longTabs = ETrue; |
|
217 numberOfTabs = 3; |
|
218 activeTab = 1; |
|
219 break; |
|
220 } |
|
221 case EMbmAvkonQgn_graf_tab_long_32: |
|
222 { |
|
223 longTabs = ETrue; |
|
224 numberOfTabs = 3; |
|
225 activeTab = 2; |
|
226 break; |
|
227 } |
|
228 case EMbmAvkonQgn_graf_tab_long_33: |
|
229 { |
|
230 longTabs = ETrue; |
|
231 numberOfTabs = 3; |
|
232 activeTab = 3; |
|
233 break; |
|
234 } |
|
235 default: |
|
236 { |
|
237 break; |
|
238 } |
|
239 } |
|
240 |
|
241 return CreateTabGroupBackgroundL( longTabs, numberOfTabs, activeTab ); |
|
242 } |
|
243 |
|
244 CAknTabGroupGraphics::SAknTabGroupBackground CAknTabGroupGraphics::CreateTabGroupBackgroundL( |
|
245 TBool aLongTabs, TInt aNumberOfTabs, TInt aActiveTab ) |
|
246 { |
|
247 CAknTabGroupGraphics::SAknTabGroupBackground tabGroupBackGround; |
|
248 CAknTabGroupGraphics::SAknTabGroupBackgroundLayout tabGroupBackGroundLayout; |
|
249 |
|
250 AknIconConfig::TPreferredDisplayMode mode; |
|
251 AknIconConfig::PreferredDisplayMode( mode, |
|
252 AknIconConfig::EImageTypeOffscreen ); |
|
253 |
|
254 TDisplayMode bitmapDisplayMode = mode.iBitmapMode; |
|
255 TDisplayMode maskDisplayMode = EGray256; |
|
256 TSize size( iTabGroupBackgroundParent.Size() ); |
|
257 |
|
258 // BITMAP |
|
259 tabGroupBackGround.iBitmap = new (ELeave) CFbsBitmap(); |
|
260 CleanupStack::PushL( tabGroupBackGround.iBitmap ); |
|
261 User::LeaveIfError( tabGroupBackGround.iBitmap->Create( size, bitmapDisplayMode ) ); |
|
262 CFbsBitmapDevice* bitmapDevice = CFbsBitmapDevice::NewL( tabGroupBackGround.iBitmap ); |
|
263 CleanupStack::PushL( bitmapDevice ); |
|
264 CFbsBitGc* bitmapGc; |
|
265 User::LeaveIfError( bitmapDevice->CreateContext( bitmapGc ) ); |
|
266 |
|
267 // Clear background first... |
|
268 bitmapGc->SetBrushColor( KRgbBlack ); |
|
269 bitmapGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
270 bitmapGc->DrawRect( iTabGroupBackgroundParent ); |
|
271 |
|
272 bitmapGc->SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
273 DrawTabGroupBackgroundL( CAknTabGroupGraphics::ENormal, |
|
274 aLongTabs, |
|
275 aNumberOfTabs, |
|
276 aActiveTab, |
|
277 bitmapGc, |
|
278 tabGroupBackGroundLayout, |
|
279 ENone ); |
|
280 delete bitmapGc; |
|
281 |
|
282 CleanupStack::Pop( 2, tabGroupBackGround.iBitmap ); |
|
283 delete bitmapDevice; |
|
284 bitmapGc = NULL; |
|
285 bitmapDevice = NULL; |
|
286 |
|
287 // MASK |
|
288 tabGroupBackGround.iMask = new (ELeave) CFbsBitmap(); |
|
289 CleanupStack::PushL( tabGroupBackGround.iMask ); |
|
290 User::LeaveIfError( tabGroupBackGround.iMask->Create( size, maskDisplayMode ) ); |
|
291 bitmapDevice = CFbsBitmapDevice::NewL( tabGroupBackGround.iMask ); |
|
292 CleanupStack::PushL( bitmapDevice ); |
|
293 User::LeaveIfError( bitmapDevice->CreateContext( bitmapGc ) ); |
|
294 |
|
295 // Clear background first... |
|
296 bitmapGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
297 if ( maskDisplayMode == EGray256 ) |
|
298 { |
|
299 bitmapGc->SetBrushColor( KRgbBlack ); |
|
300 } |
|
301 else |
|
302 { |
|
303 bitmapGc->SetBrushColor( KRgbWhite ); |
|
304 } |
|
305 bitmapGc->DrawRect( iTabGroupBackgroundParent ); |
|
306 |
|
307 bitmapGc->SetBrushStyle( CGraphicsContext::ENullBrush ); |
|
308 DrawTabGroupBackgroundL( CAknTabGroupGraphics::EMaskOnly, |
|
309 aLongTabs, |
|
310 aNumberOfTabs, |
|
311 aActiveTab, |
|
312 bitmapGc, |
|
313 tabGroupBackGroundLayout, |
|
314 ENone); |
|
315 delete bitmapGc; |
|
316 |
|
317 CleanupStack::Pop( 2, tabGroupBackGround.iMask ); |
|
318 delete bitmapDevice; |
|
319 |
|
320 return tabGroupBackGround; |
|
321 } |
|
322 |
|
323 #endif |
|
324 |
|
325 |
|
326 // --------------------------------------------------------------------------- |
190 // --------------------------------------------------------------------------- |
327 // Draws normal tab background from given parameters. |
191 // Draws normal tab background from given parameters. |
328 // --------------------------------------------------------------------------- |
192 // --------------------------------------------------------------------------- |
329 // |
193 // |
330 void CAknTabGroupGraphics::DrawTabGroupBackgroundL( |
194 void CAknTabGroupGraphics::DrawTabGroupBackground( |
331 TTabDrawMode aTabDrawMode, |
195 TTabDrawMode aTabDrawMode, |
332 TBool aLongTabs, |
196 TBool aLongTabs, |
333 TInt aNumberOfTabs, |
197 TInt aNumberOfTabs, |
334 TInt aActiveTab, |
198 TInt aActiveTab, |
335 CBitmapContext* aGc, |
199 CBitmapContext* aGc, |
336 SAknTabGroupBackgroundLayout& aLayout, |
200 SAknTabGroupBackgroundLayout& aLayout, |
337 TTabsHidden aTabsHidden, |
201 TTabsHidden aTabsHidden, |
338 TTabAnimationType aAnimation ) const |
202 TTabAnimationType aAnimation, |
339 { |
203 TInt aHighlightTab ) const |
340 switch ( aNumberOfTabs ) |
204 { |
|
205 //Set the layout for tab background; |
|
206 ReviseLayoutForTabBackground(aLayout, aNumberOfTabs, aLongTabs, aActiveTab, EFalse, aAnimation); |
|
207 |
|
208 TInt insCnt = 0; |
|
209 TTabInstruction instruction[8]; |
|
210 |
|
211 switch (aNumberOfTabs) |
341 { |
212 { |
342 case 2: |
213 case 2: |
343 { |
214 { |
344 if ( aLongTabs ) |
215 if (aActiveTab == 1) |
345 { |
216 { |
346 DrawTwoLongTabBackground( aTabDrawMode, |
217 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
347 aActiveTab, |
218 AssemblyActiveTabInstruction(instruction[insCnt++], 1); |
348 aGc, |
|
349 aLayout ); |
|
350 } |
219 } |
351 else |
220 else |
352 { |
221 { |
353 DrawTwoTabBackground( aTabDrawMode, |
222 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 1, EFalse); |
354 aActiveTab, |
223 AssemblyActiveTabInstruction(instruction[insCnt++], 2); |
355 aGc, |
224 } |
356 aLayout ); |
225 } |
357 } |
|
358 break; |
226 break; |
359 } |
|
360 case 3: |
227 case 3: |
361 { |
228 { |
362 if ( aLongTabs ) |
229 if ( aLongTabs ) |
363 { |
230 { |
364 DrawThreeLongTabBackground( aTabDrawMode, |
231 if (aActiveTab == 1) |
365 aActiveTab, |
232 { |
366 aGc, |
233 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 3, EFalse); |
367 aLayout ); |
234 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
|
235 AssemblyActiveTabInstruction(instruction[insCnt++], 1); |
|
236 } |
|
237 else if ( aActiveTab == 2) |
|
238 { |
|
239 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 1, EFalse); |
|
240 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 3, EFalse); |
|
241 AssemblyActiveTabInstruction(instruction[insCnt++], 2); |
|
242 } |
|
243 else if ( aActiveTab == 3) |
|
244 { |
|
245 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 1, EFalse); |
|
246 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
|
247 AssemblyActiveTabInstruction(instruction[insCnt++], 3); |
|
248 } |
368 } |
249 } |
369 else |
250 else |
370 { |
251 { |
371 DrawThreeTabBackground( aTabDrawMode, |
252 TInt xOffset(aLayout.iFirstTab.iRight.iBr.iX - aLayout.iSecondTab.iLeft.iTl.iX); |
372 aActiveTab, |
253 |
373 aGc, |
254 if (aActiveTab == 1) |
374 aLayout, |
255 { |
375 aTabsHidden, |
256 if (aTabsHidden == EOnRightSide) |
376 aAnimation ); |
257 { |
377 } |
258 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 6, ETrue); |
|
259 } |
|
260 |
|
261 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 3, EFalse); |
|
262 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
|
263 AssemblyActiveTabInstruction(instruction[insCnt++], 1); |
|
264 } |
|
265 else if (aActiveTab == 2) |
|
266 { |
|
267 switch (aTabsHidden) |
|
268 { |
|
269 case EOnLeftSide: |
|
270 { |
|
271 TRect bitRect(aLayout.iHiddenTabLeft.iLeft); |
|
272 bitRect.Resize(xOffset, 0); |
|
273 AssemblyPassiveTabBitInstruction(instruction[insCnt++], 5, bitRect); |
|
274 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 5, |
|
275 aAnimation != ECycleToLeft ? ETrue : EFalse); |
|
276 } |
|
277 break; |
|
278 case EOnRightSide: |
|
279 { |
|
280 TRect bitRect(aLayout.iHiddenTabRight.iRight); |
|
281 bitRect.Move(-xOffset, 0); |
|
282 bitRect.Resize(xOffset, 0); |
|
283 AssemblyPassiveTabBitInstruction(instruction[insCnt++], 4, bitRect); |
|
284 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 6, |
|
285 aAnimation != ECycleToRight ? ETrue : EFalse); |
|
286 } |
|
287 break; |
|
288 case EOnBothSides: |
|
289 { |
|
290 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 5, |
|
291 aAnimation != ECycleToLeft ? ETrue : EFalse); |
|
292 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 6, |
|
293 aAnimation != ECycleToRight ? ETrue : EFalse); |
|
294 } |
|
295 break; |
|
296 case ETwoOnBothSides: |
|
297 { |
|
298 TRect bitRect(aLayout.iHiddenTabLeft.iLeft); |
|
299 bitRect.Resize(xOffset, 0); |
|
300 AssemblyPassiveTabBitInstruction(instruction[insCnt++], 5, bitRect); |
|
301 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 5, |
|
302 aAnimation != ECycleToLeft ? ETrue : EFalse); |
|
303 |
|
304 bitRect = aLayout.iHiddenTabRight.iRight; |
|
305 bitRect.Move(-xOffset, 0); |
|
306 bitRect.Resize(xOffset, 0); |
|
307 AssemblyPassiveTabBitInstruction(instruction[insCnt++], 4, bitRect); |
|
308 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 6, |
|
309 aAnimation != ECycleToRight ? ETrue : EFalse); |
|
310 } |
|
311 break; |
|
312 case ENone: |
|
313 default: |
|
314 break; |
|
315 } |
|
316 |
|
317 if (aAnimation == ECycleToLeft) |
|
318 { |
|
319 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 3, ETrue); |
|
320 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
|
321 AssemblyActiveTabInstruction(instruction[insCnt++], 1); |
|
322 } |
|
323 else if ( aAnimation == ECycleToRight ) |
|
324 { |
|
325 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 1, ETrue); |
|
326 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
|
327 AssemblyActiveTabInstruction(instruction[insCnt++], 3); |
|
328 } |
|
329 else |
|
330 { |
|
331 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 1, EFalse); |
|
332 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 3, EFalse); |
|
333 |
|
334 if (aAnimation) |
|
335 { |
|
336 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
|
337 } |
|
338 else |
|
339 { |
|
340 AssemblyActiveTabInstruction(instruction[insCnt++], 2); |
|
341 } |
|
342 } |
|
343 } |
|
344 else if (aActiveTab == 3) |
|
345 { |
|
346 if (aTabsHidden == EOnLeftSide) |
|
347 { |
|
348 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 5, ETrue); |
|
349 } |
|
350 |
|
351 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 1, EFalse); |
|
352 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
|
353 AssemblyActiveTabInstruction(instruction[insCnt++], 3); |
|
354 } |
|
355 } |
|
356 } |
378 break; |
357 break; |
379 } |
|
380 case 4: |
358 case 4: |
381 { |
359 { |
382 DrawFourTabBackground( aTabDrawMode, |
360 if (aActiveTab == 1) |
383 aActiveTab, |
361 { |
384 aGc, |
362 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 4, EFalse); |
385 aLayout ); |
363 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 3, EFalse); |
|
364 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
|
365 AssemblyActiveTabInstruction(instruction[insCnt++], 1); |
|
366 } |
|
367 else if ( aActiveTab == 2 ) |
|
368 { |
|
369 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 4, EFalse); |
|
370 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 3, EFalse); |
|
371 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 1, EFalse); |
|
372 AssemblyActiveTabInstruction(instruction[insCnt++], 2); |
|
373 } |
|
374 else if ( aActiveTab == 3 ) |
|
375 { |
|
376 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 1, EFalse); |
|
377 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
|
378 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 4, EFalse); |
|
379 AssemblyActiveTabInstruction(instruction[insCnt++], 3); |
|
380 } |
|
381 else if ( aActiveTab == 4 ) |
|
382 { |
|
383 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 1, EFalse); |
|
384 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 2, EFalse); |
|
385 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], aHighlightTab, 3, EFalse); |
|
386 AssemblyActiveTabInstruction(instruction[insCnt++], 4); |
|
387 } |
|
388 } |
386 break; |
389 break; |
387 } |
|
388 default: |
390 default: |
389 { |
391 { |
390 #ifdef AVKON_RDEBUG_ERROR |
392 #ifdef AVKON_RDEBUG_ERROR |
391 RDebug::Print( _L("CAknTabGroupGraphics: Unknown tab layout !") ); |
393 RDebug::Print( _L("CAknTabGroupGraphics: Unknown tab group background !") ); |
392 #endif |
394 #endif |
|
395 break; |
393 } |
396 } |
394 } |
397 } |
395 |
398 |
396 if ( !aLayout.iUse ) |
399 //Draw tab background according to instructions |
397 { |
400 ProcessDrawTabInstructions(instruction, insCnt, aTabDrawMode, aLayout, aGc); |
398 aLayout.iFirstTab.iActive = EFalse; |
401 |
399 aLayout.iSecondTab.iActive = EFalse; |
402 ReviseLayoutUseFlag(aLayout, aActiveTab); |
400 aLayout.iThirdTab.iActive = EFalse; |
403 } |
401 aLayout.iFourthTab.iActive = EFalse; |
404 |
402 |
405 void CAknTabGroupGraphics::DrawTabGroupNarrowBackground( |
403 if ( aActiveTab == 1 ) |
|
404 { |
|
405 aLayout.iFirstTab.iActive = ETrue; |
|
406 } |
|
407 else if ( aActiveTab == 2 ) |
|
408 { |
|
409 aLayout.iSecondTab.iActive = ETrue; |
|
410 } |
|
411 else if ( aActiveTab == 3 ) |
|
412 { |
|
413 aLayout.iThirdTab.iActive = ETrue; |
|
414 } |
|
415 else if ( aActiveTab == 4 ) |
|
416 { |
|
417 aLayout.iFourthTab.iActive = ETrue; |
|
418 } |
|
419 } |
|
420 } |
|
421 |
|
422 void CAknTabGroupGraphics::DrawTabGroupNarrowBackgroundL( |
|
423 TTabDrawMode aTabDrawMode, |
406 TTabDrawMode aTabDrawMode, |
424 TBool aLongTabs, |
407 TBool aLongTabs, |
425 TInt aNumberOfTabs, |
408 TInt aNumberOfTabs, |
426 TInt aActiveTab, |
409 TInt aActiveTab, |
427 CBitmapContext* aGc, |
410 CBitmapContext* aGc, |
428 SAknTabGroupBackgroundLayout& aLayout ) const |
411 SAknTabGroupBackgroundLayout& aLayout ) const |
429 { |
412 { |
|
413 //Set the layout for tab background; |
|
414 ReviseLayoutForTabBackground(aLayout, aNumberOfTabs, aLongTabs, aActiveTab, ETrue, ENoAnimation); |
|
415 |
|
416 TInt insCnt = 0; |
|
417 TTabInstruction instruction[6]; |
|
418 |
430 switch ( aNumberOfTabs ) |
419 switch ( aNumberOfTabs ) |
431 { |
420 { |
432 case 2: |
421 case 2: |
433 { |
422 { |
434 if ( aLongTabs ) |
423 if (aActiveTab == 1) |
435 { |
424 { |
436 if ( !aLayout.iUse ) |
425 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 2, EFalse); |
437 { |
426 AssemblyActiveTabInstruction(instruction[insCnt++], 1); |
438 aLayout = TwoLongTabNarrowBackground( aActiveTab ); |
|
439 } |
|
440 aLayout.iUse = ETrue; |
|
441 DrawTwoLongTabNarrowBackground( aTabDrawMode, |
|
442 aActiveTab, |
|
443 aGc, |
|
444 aLayout ); |
|
445 } |
427 } |
446 else |
428 else |
447 { |
429 { |
448 if ( !aLayout.iUse ) |
430 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 1, EFalse); |
449 { |
431 AssemblyActiveTabInstruction(instruction[insCnt++], 2); |
450 aLayout = TwoTabNarrowBackground( aActiveTab ); |
432 } |
451 } |
433 } |
452 aLayout.iUse = ETrue; |
|
453 DrawTwoTabNarrowBackground( aTabDrawMode, |
|
454 aActiveTab, |
|
455 aGc, |
|
456 aLayout ); |
|
457 } |
|
458 break; |
434 break; |
459 } |
|
460 case 3: |
435 case 3: |
461 { |
436 { |
462 if ( aLongTabs ) |
437 if (aActiveTab == 1) |
463 { |
438 { |
464 if ( !aLayout.iUse ) |
439 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 3, EFalse); |
465 { |
440 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 2, EFalse); |
466 aLayout = ThreeLongTabNarrowBackground( aActiveTab ); |
441 AssemblyActiveTabInstruction(instruction[insCnt++], 1); |
467 } |
442 } |
468 aLayout.iUse = ETrue; |
443 else if (aActiveTab == 2) |
469 DrawThreeLongTabNarrowBackground( aTabDrawMode, |
444 { |
470 aActiveTab, |
445 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 1, EFalse); |
471 aGc, |
446 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 3, EFalse); |
472 aLayout ); |
447 AssemblyActiveTabInstruction(instruction[insCnt++], 2); |
473 } |
448 } |
474 else |
449 else if (aActiveTab == 3) |
475 { |
450 { |
476 if ( !aLayout.iUse ) |
451 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 1, EFalse); |
477 { |
452 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 2, EFalse); |
478 aLayout = ThreeTabNarrowBackground( aActiveTab ); |
453 AssemblyActiveTabInstruction(instruction[insCnt++], 3); |
479 } |
454 } |
480 aLayout.iUse = ETrue; |
455 } |
481 DrawThreeTabNarrowBackground( aTabDrawMode, |
|
482 aActiveTab, |
|
483 aGc, |
|
484 aLayout ); |
|
485 } |
|
486 break; |
456 break; |
487 } |
|
488 case 4: |
457 case 4: |
489 { |
458 { |
490 if ( !aLayout.iUse ) |
459 if (aActiveTab == 1) |
491 { |
460 { |
492 aLayout = FourTabNarrowBackground( aActiveTab ); |
461 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 4, EFalse); |
493 } |
462 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 3, EFalse); |
494 aLayout.iUse = ETrue; |
463 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 2, EFalse); |
495 DrawFourTabNarrowBackground( aTabDrawMode, |
464 AssemblyActiveTabInstruction(instruction[insCnt++], 1); |
496 aActiveTab, |
465 } |
497 aGc, |
466 else if (aActiveTab == 2) |
498 aLayout ); |
467 { |
|
468 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 4, EFalse); |
|
469 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 3, EFalse); |
|
470 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 1, EFalse); |
|
471 AssemblyActiveTabInstruction(instruction[insCnt++], 2); |
|
472 } |
|
473 else if (aActiveTab == 3) |
|
474 { |
|
475 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 1, EFalse); |
|
476 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 2, EFalse); |
|
477 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 4, EFalse); |
|
478 AssemblyActiveTabInstruction(instruction[insCnt++], 3); |
|
479 } |
|
480 else if (aActiveTab == 4) |
|
481 { |
|
482 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 1, EFalse); |
|
483 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 2, EFalse); |
|
484 AssemblyPassiveOrHighlightTabInstruction(instruction[insCnt++], 0, 3, EFalse); |
|
485 AssemblyActiveTabInstruction(instruction[insCnt++], 4); |
|
486 } |
|
487 } |
499 break; |
488 break; |
500 } |
|
501 default: |
489 default: |
502 { |
490 { |
503 #ifdef AVKON_RDEBUG_ERROR |
491 #ifdef AVKON_RDEBUG_ERROR |
504 RDebug::Print( _L("CAknTabGroupGraphics: Unknown tab layout !") ); |
492 RDebug::Print( _L("CAknTabGroupGraphics: Unknown tab narrow background !") ); |
505 #endif |
493 #endif |
|
494 break; |
506 } |
495 } |
507 } |
496 } |
508 |
497 |
509 if ( !aLayout.iUse ) |
498 //Draw tab background according to instructions |
510 { |
499 ProcessDrawTabInstructions(instruction, insCnt, aTabDrawMode, aLayout, aGc); |
511 aLayout.iFirstTab.iActive = EFalse; |
500 |
512 aLayout.iSecondTab.iActive = EFalse; |
501 ReviseLayoutUseFlag(aLayout, aActiveTab); |
513 aLayout.iThirdTab.iActive = EFalse; |
502 } |
514 aLayout.iFourthTab.iActive = EFalse; |
503 |
515 |
|
516 if ( aActiveTab == 1 ) |
|
517 { |
|
518 aLayout.iFirstTab.iActive = ETrue; |
|
519 } |
|
520 else if ( aActiveTab == 2 ) |
|
521 { |
|
522 aLayout.iSecondTab.iActive = ETrue; |
|
523 } |
|
524 else if ( aActiveTab == 3 ) |
|
525 { |
|
526 aLayout.iThirdTab.iActive = ETrue; |
|
527 } |
|
528 else if ( aActiveTab == 4 ) |
|
529 { |
|
530 aLayout.iFourthTab.iActive = ETrue; |
|
531 } |
|
532 } |
|
533 } |
|
534 |
504 |
535 TBool CAknTabGroupGraphics::TabClickedL( TInt aTabComponent, |
505 TBool CAknTabGroupGraphics::TabClickedL( TInt aTabComponent, |
536 const TRect& aTabRect, |
506 const TRect& aTabRect, |
537 const TPoint& aPoint, |
507 const TPoint& aPoint, |
538 TBool aIsActiveTab ) |
508 TBool aIsActiveTab ) |
1331 aLayout.iFourthTab.iRight = TRect(0,0,0,0); |
1216 aLayout.iFourthTab.iRight = TRect(0,0,0,0); |
1332 |
1217 |
1333 return aLayout; |
1218 return aLayout; |
1334 } |
1219 } |
1335 |
1220 |
1336 |
|
1337 // --------------------------------------------------------------------------- |
|
1338 // Draws the tab group background in three tab layout. |
|
1339 // --------------------------------------------------------------------------- |
|
1340 // |
|
1341 void CAknTabGroupGraphics::DrawThreeTabBackground( |
|
1342 TTabDrawMode aTabDrawMode, |
|
1343 TInt aActiveTab, |
|
1344 CBitmapContext* aGc, |
|
1345 SAknTabGroupBackgroundLayout& aLayout, |
|
1346 TTabsHidden aTabsHidden, |
|
1347 TTabAnimationType aAnimation ) const |
|
1348 { |
|
1349 TInt animActiveTab( aActiveTab ); |
|
1350 if ( aAnimation && aActiveTab == 2 ) |
|
1351 { |
|
1352 // Move the tab highlight already during the animation. |
|
1353 animActiveTab = aAnimation == ECycleToLeft ? aActiveTab - 1 : |
|
1354 aActiveTab + 1; |
|
1355 } |
|
1356 |
|
1357 // If not given layout, then get the default layout. |
|
1358 if ( !aLayout.iUse ) |
|
1359 { |
|
1360 aLayout = ThreeTabBackground( animActiveTab ); |
|
1361 } |
|
1362 |
|
1363 TInt xOffset( aLayout.iFirstTab.iRight.iBr.iX - |
|
1364 aLayout.iSecondTab.iLeft.iTl.iX ); |
|
1365 |
|
1366 if ( aActiveTab == 1 ) |
|
1367 { |
|
1368 if ( aTabsHidden == EOnRightSide ) |
|
1369 { |
|
1370 DrawPassiveTab( aTabDrawMode, |
|
1371 aLayout.iHiddenTabRight.iLeft, |
|
1372 aLayout.iHiddenTabRight.iMiddle, |
|
1373 aLayout.iHiddenTabRight.iRight, |
|
1374 aGc, |
|
1375 ETrue ); |
|
1376 } |
|
1377 |
|
1378 DrawPassiveTab( aTabDrawMode, |
|
1379 aLayout.iThirdTab.iLeft, |
|
1380 aLayout.iThirdTab.iMiddle, |
|
1381 aLayout.iThirdTab.iRight, |
|
1382 aGc ); |
|
1383 |
|
1384 DrawPassiveTab( aTabDrawMode, |
|
1385 aLayout.iSecondTab.iLeft, |
|
1386 aLayout.iSecondTab.iMiddle, |
|
1387 aLayout.iSecondTab.iRight, |
|
1388 aGc ); |
|
1389 |
|
1390 DrawActiveTab( aTabDrawMode, |
|
1391 aLayout.iFirstTab.iLeft, |
|
1392 aLayout.iFirstTab.iMiddle, |
|
1393 aLayout.iFirstTab.iRight, |
|
1394 aGc ); |
|
1395 } |
|
1396 else if ( aActiveTab == 2 ) |
|
1397 { |
|
1398 switch ( aTabsHidden ) |
|
1399 { |
|
1400 case EOnLeftSide: |
|
1401 { |
|
1402 TRect bitRect( aLayout.iHiddenTabLeft.iLeft ); |
|
1403 bitRect.Resize( xOffset, 0 ); |
|
1404 DrawPassiveTabBit( aTabDrawMode, |
|
1405 ERight, |
|
1406 bitRect, |
|
1407 aGc ); |
|
1408 DrawPassiveTab( aTabDrawMode, |
|
1409 aLayout.iHiddenTabLeft.iLeft, |
|
1410 aLayout.iHiddenTabLeft.iMiddle, |
|
1411 aLayout.iHiddenTabLeft.iRight, |
|
1412 aGc, |
|
1413 aAnimation != ECycleToLeft ? ETrue : EFalse ); |
|
1414 break; |
|
1415 } |
|
1416 case EOnRightSide: |
|
1417 { |
|
1418 TRect bitRect( aLayout.iHiddenTabRight.iRight ); |
|
1419 bitRect.Move( -xOffset, 0 ); |
|
1420 bitRect.Resize( xOffset, 0 ); |
|
1421 DrawPassiveTabBit( aTabDrawMode, |
|
1422 ELeft, |
|
1423 bitRect, |
|
1424 aGc ); |
|
1425 DrawPassiveTab( aTabDrawMode, |
|
1426 aLayout.iHiddenTabRight.iLeft, |
|
1427 aLayout.iHiddenTabRight.iMiddle, |
|
1428 aLayout.iHiddenTabRight.iRight, |
|
1429 aGc, |
|
1430 aAnimation != ECycleToRight ? ETrue : EFalse ); |
|
1431 break; |
|
1432 } |
|
1433 case EOnBothSides: |
|
1434 { |
|
1435 DrawPassiveTab( aTabDrawMode, |
|
1436 aLayout.iHiddenTabLeft.iLeft, |
|
1437 aLayout.iHiddenTabLeft.iMiddle, |
|
1438 aLayout.iHiddenTabLeft.iRight, |
|
1439 aGc, |
|
1440 aAnimation != ECycleToLeft ? ETrue : EFalse ); |
|
1441 |
|
1442 DrawPassiveTab( aTabDrawMode, |
|
1443 aLayout.iHiddenTabRight.iLeft, |
|
1444 aLayout.iHiddenTabRight.iMiddle, |
|
1445 aLayout.iHiddenTabRight.iRight, |
|
1446 aGc, |
|
1447 aAnimation != ECycleToRight ? ETrue : EFalse ); |
|
1448 break; |
|
1449 } |
|
1450 case ETwoOnBothSides: |
|
1451 { |
|
1452 TRect bitRect( aLayout.iHiddenTabLeft.iLeft ); |
|
1453 bitRect.Resize( xOffset, 0 ); |
|
1454 DrawPassiveTabBit( aTabDrawMode, |
|
1455 ERight, |
|
1456 bitRect, |
|
1457 aGc ); |
|
1458 DrawPassiveTab( aTabDrawMode, |
|
1459 aLayout.iHiddenTabLeft.iLeft, |
|
1460 aLayout.iHiddenTabLeft.iMiddle, |
|
1461 aLayout.iHiddenTabLeft.iRight, |
|
1462 aGc, |
|
1463 aAnimation != ECycleToLeft ? ETrue : EFalse ); |
|
1464 |
|
1465 bitRect = aLayout.iHiddenTabRight.iRight; |
|
1466 bitRect.Move( -xOffset, 0 ); |
|
1467 bitRect.Resize( xOffset, 0 ); |
|
1468 DrawPassiveTabBit( aTabDrawMode, |
|
1469 ELeft, |
|
1470 bitRect, |
|
1471 aGc ); |
|
1472 DrawPassiveTab( aTabDrawMode, |
|
1473 aLayout.iHiddenTabRight.iLeft, |
|
1474 aLayout.iHiddenTabRight.iMiddle, |
|
1475 aLayout.iHiddenTabRight.iRight, |
|
1476 aGc, |
|
1477 aAnimation != ECycleToRight ? ETrue : EFalse); |
|
1478 break; |
|
1479 } |
|
1480 case ENone: |
|
1481 default: |
|
1482 { |
|
1483 break; |
|
1484 } |
|
1485 } |
|
1486 |
|
1487 if ( aAnimation == ECycleToLeft ) |
|
1488 { |
|
1489 DrawPassiveTab( aTabDrawMode, |
|
1490 aLayout.iThirdTab.iLeft, |
|
1491 aLayout.iThirdTab.iMiddle, |
|
1492 aLayout.iThirdTab.iRight, |
|
1493 aGc, |
|
1494 ETrue ); |
|
1495 DrawPassiveTab( aTabDrawMode, |
|
1496 aLayout.iSecondTab.iLeft, |
|
1497 aLayout.iSecondTab.iMiddle, |
|
1498 aLayout.iSecondTab.iRight, |
|
1499 aGc ); |
|
1500 DrawActiveTab( aTabDrawMode, |
|
1501 aLayout.iFirstTab.iLeft, |
|
1502 aLayout.iFirstTab.iMiddle, |
|
1503 aLayout.iFirstTab.iRight, |
|
1504 aGc ); |
|
1505 } |
|
1506 else if ( aAnimation == ECycleToRight ) |
|
1507 { |
|
1508 DrawPassiveTab( aTabDrawMode, |
|
1509 aLayout.iFirstTab.iLeft, |
|
1510 aLayout.iFirstTab.iMiddle, |
|
1511 aLayout.iFirstTab.iRight, |
|
1512 aGc, |
|
1513 ETrue ); |
|
1514 DrawPassiveTab( aTabDrawMode, |
|
1515 aLayout.iSecondTab.iLeft, |
|
1516 aLayout.iSecondTab.iMiddle, |
|
1517 aLayout.iSecondTab.iRight, |
|
1518 aGc ); |
|
1519 DrawActiveTab( aTabDrawMode, |
|
1520 aLayout.iThirdTab.iLeft, |
|
1521 aLayout.iThirdTab.iMiddle, |
|
1522 aLayout.iThirdTab.iRight, |
|
1523 aGc ); |
|
1524 } |
|
1525 else |
|
1526 { |
|
1527 DrawPassiveTab( aTabDrawMode, |
|
1528 aLayout.iFirstTab.iLeft, |
|
1529 aLayout.iFirstTab.iMiddle, |
|
1530 aLayout.iFirstTab.iRight, |
|
1531 aGc ); |
|
1532 |
|
1533 DrawPassiveTab( aTabDrawMode, |
|
1534 aLayout.iThirdTab.iLeft, |
|
1535 aLayout.iThirdTab.iMiddle, |
|
1536 aLayout.iThirdTab.iRight, |
|
1537 aGc ); |
|
1538 |
|
1539 if ( aAnimation ) |
|
1540 { |
|
1541 DrawPassiveTab( aTabDrawMode, |
|
1542 aLayout.iSecondTab.iLeft, |
|
1543 aLayout.iSecondTab.iMiddle, |
|
1544 aLayout.iSecondTab.iRight, |
|
1545 aGc ); |
|
1546 } |
|
1547 else |
|
1548 { |
|
1549 DrawActiveTab( aTabDrawMode, |
|
1550 aLayout.iSecondTab.iLeft, |
|
1551 aLayout.iSecondTab.iMiddle, |
|
1552 aLayout.iSecondTab.iRight, |
|
1553 aGc ); |
|
1554 } |
|
1555 } |
|
1556 } |
|
1557 else if ( aActiveTab == 3 ) |
|
1558 { |
|
1559 if ( aTabsHidden == EOnLeftSide ) |
|
1560 { |
|
1561 DrawPassiveTab( aTabDrawMode, |
|
1562 aLayout.iHiddenTabLeft.iLeft, |
|
1563 aLayout.iHiddenTabLeft.iMiddle, |
|
1564 aLayout.iHiddenTabLeft.iRight, |
|
1565 aGc, |
|
1566 ETrue ); |
|
1567 } |
|
1568 |
|
1569 DrawPassiveTab( aTabDrawMode, |
|
1570 aLayout.iFirstTab.iLeft, |
|
1571 aLayout.iFirstTab.iMiddle, |
|
1572 aLayout.iFirstTab.iRight, |
|
1573 aGc ); |
|
1574 |
|
1575 DrawPassiveTab( aTabDrawMode, |
|
1576 aLayout.iSecondTab.iLeft, |
|
1577 aLayout.iSecondTab.iMiddle, |
|
1578 aLayout.iSecondTab.iRight, |
|
1579 aGc ); |
|
1580 |
|
1581 DrawActiveTab( aTabDrawMode, |
|
1582 aLayout.iThirdTab.iLeft, |
|
1583 aLayout.iThirdTab.iMiddle, |
|
1584 aLayout.iThirdTab.iRight, |
|
1585 aGc ); |
|
1586 } |
|
1587 } |
|
1588 |
|
1589 |
|
1590 // --------------------------------------------------------------------------- |
|
1591 // Draws the tab group background in three tab narrow layout. |
|
1592 // --------------------------------------------------------------------------- |
|
1593 // |
|
1594 void CAknTabGroupGraphics::DrawThreeTabNarrowBackground( |
|
1595 TTabDrawMode aTabDrawMode, |
|
1596 TInt aActiveTab, |
|
1597 CBitmapContext* aGc, |
|
1598 SAknTabGroupBackgroundLayout& aLayout ) const |
|
1599 { |
|
1600 // If not given layout, then get the default layout |
|
1601 if ( !aLayout.iUse ) |
|
1602 { |
|
1603 aLayout = ThreeTabBackground( aActiveTab ); |
|
1604 } |
|
1605 |
|
1606 if ( aActiveTab == 1 ) |
|
1607 { |
|
1608 DrawPassiveTab( aTabDrawMode, |
|
1609 aLayout.iThirdTab.iLeft, |
|
1610 aLayout.iThirdTab.iMiddle, |
|
1611 aLayout.iThirdTab.iRight, |
|
1612 aGc ); |
|
1613 |
|
1614 DrawPassiveTab( aTabDrawMode, |
|
1615 aLayout.iSecondTab.iLeft, |
|
1616 aLayout.iSecondTab.iMiddle, |
|
1617 aLayout.iSecondTab.iRight, |
|
1618 aGc ); |
|
1619 |
|
1620 DrawActiveTab( aTabDrawMode, |
|
1621 aLayout.iFirstTab.iLeft, |
|
1622 aLayout.iFirstTab.iMiddle, |
|
1623 aLayout.iFirstTab.iRight, |
|
1624 aGc ); |
|
1625 } |
|
1626 else if ( aActiveTab == 2 ) |
|
1627 { |
|
1628 DrawPassiveTab( aTabDrawMode, |
|
1629 aLayout.iFirstTab.iLeft, |
|
1630 aLayout.iFirstTab.iMiddle, |
|
1631 aLayout.iFirstTab.iRight, |
|
1632 aGc ); |
|
1633 |
|
1634 DrawPassiveTab( aTabDrawMode, |
|
1635 aLayout.iThirdTab.iLeft, |
|
1636 aLayout.iThirdTab.iMiddle, |
|
1637 aLayout.iThirdTab.iRight, |
|
1638 aGc ); |
|
1639 |
|
1640 DrawActiveTab( aTabDrawMode, |
|
1641 aLayout.iSecondTab.iLeft, |
|
1642 aLayout.iSecondTab.iMiddle, |
|
1643 aLayout.iSecondTab.iRight, |
|
1644 aGc ); |
|
1645 } |
|
1646 else if ( aActiveTab == 3 ) |
|
1647 { |
|
1648 DrawPassiveTab( aTabDrawMode, |
|
1649 aLayout.iFirstTab.iLeft, |
|
1650 aLayout.iFirstTab.iMiddle, |
|
1651 aLayout.iFirstTab.iRight, |
|
1652 aGc ); |
|
1653 |
|
1654 DrawPassiveTab( aTabDrawMode, |
|
1655 aLayout.iSecondTab.iLeft, |
|
1656 aLayout.iSecondTab.iMiddle, |
|
1657 aLayout.iSecondTab.iRight, |
|
1658 aGc ); |
|
1659 |
|
1660 DrawActiveTab( aTabDrawMode, |
|
1661 aLayout.iThirdTab.iLeft, |
|
1662 aLayout.iThirdTab.iMiddle, |
|
1663 aLayout.iThirdTab.iRight, |
|
1664 aGc ); |
|
1665 } |
|
1666 } |
|
1667 |
|
1668 |
|
1669 CAknTabGroupGraphics::SAknTabGroupBackgroundLayout CAknTabGroupGraphics::FourTabBackground( |
1221 CAknTabGroupGraphics::SAknTabGroupBackgroundLayout CAknTabGroupGraphics::FourTabBackground( |
1670 TInt aActiveTab ) const |
1222 TInt aActiveTab ) const |
1671 { |
1223 { |
1672 SAknTabGroupBackgroundLayout aLayout; |
1224 SAknTabGroupBackgroundLayout aLayout; |
1673 |
1225 |
2138 } |
1690 } |
2139 |
1691 |
2140 return aLayout; |
1692 return aLayout; |
2141 } |
1693 } |
2142 |
1694 |
2143 void CAknTabGroupGraphics::DrawFourTabBackground( TTabDrawMode aTabDrawMode, |
|
2144 TInt aActiveTab, |
|
2145 CBitmapContext* aGc, |
|
2146 SAknTabGroupBackgroundLayout& aLayout ) const |
|
2147 { |
|
2148 // If not given layout, then get the default layout |
|
2149 if ( !aLayout.iUse ) |
|
2150 { |
|
2151 aLayout = FourTabBackground( aActiveTab ); |
|
2152 } |
|
2153 |
|
2154 if ( aActiveTab == 1 ) |
|
2155 { |
|
2156 DrawPassiveTab( aTabDrawMode, |
|
2157 aLayout.iFourthTab.iLeft, |
|
2158 aLayout.iFourthTab.iMiddle, |
|
2159 aLayout.iFourthTab.iRight, |
|
2160 aGc ); |
|
2161 |
|
2162 DrawPassiveTab( aTabDrawMode, |
|
2163 aLayout.iThirdTab.iLeft, |
|
2164 aLayout.iThirdTab.iMiddle, |
|
2165 aLayout.iThirdTab.iRight, |
|
2166 aGc ); |
|
2167 |
|
2168 DrawPassiveTab( aTabDrawMode, |
|
2169 aLayout.iSecondTab.iLeft, |
|
2170 aLayout.iSecondTab.iMiddle, |
|
2171 aLayout.iSecondTab.iRight, |
|
2172 aGc ); |
|
2173 |
|
2174 DrawActiveTab( aTabDrawMode, |
|
2175 aLayout.iFirstTab.iLeft, |
|
2176 aLayout.iFirstTab.iMiddle, |
|
2177 aLayout.iFirstTab.iRight, |
|
2178 aGc ); |
|
2179 } |
|
2180 else if ( aActiveTab == 2 ) |
|
2181 { |
|
2182 DrawPassiveTab( aTabDrawMode, |
|
2183 aLayout.iFourthTab.iLeft, |
|
2184 aLayout.iFourthTab.iMiddle, |
|
2185 aLayout.iFourthTab.iRight, |
|
2186 aGc ); |
|
2187 |
|
2188 DrawPassiveTab( aTabDrawMode, |
|
2189 aLayout.iThirdTab.iLeft, |
|
2190 aLayout.iThirdTab.iMiddle, |
|
2191 aLayout.iThirdTab.iRight, |
|
2192 aGc ); |
|
2193 |
|
2194 DrawPassiveTab( aTabDrawMode, |
|
2195 aLayout.iFirstTab.iLeft, |
|
2196 aLayout.iFirstTab.iMiddle, |
|
2197 aLayout.iFirstTab.iRight, |
|
2198 aGc ); |
|
2199 |
|
2200 DrawActiveTab( aTabDrawMode, |
|
2201 aLayout.iSecondTab.iLeft, |
|
2202 aLayout.iSecondTab.iMiddle, |
|
2203 aLayout.iSecondTab.iRight, |
|
2204 aGc ); |
|
2205 } |
|
2206 else if ( aActiveTab == 3 ) |
|
2207 { |
|
2208 DrawPassiveTab( aTabDrawMode, |
|
2209 aLayout.iFirstTab.iLeft, |
|
2210 aLayout.iFirstTab.iMiddle, |
|
2211 aLayout.iFirstTab.iRight, |
|
2212 aGc ); |
|
2213 |
|
2214 DrawPassiveTab( aTabDrawMode, |
|
2215 aLayout.iSecondTab.iLeft, |
|
2216 aLayout.iSecondTab.iMiddle, |
|
2217 aLayout.iSecondTab.iRight, |
|
2218 aGc ); |
|
2219 |
|
2220 DrawPassiveTab( aTabDrawMode, |
|
2221 aLayout.iFourthTab.iLeft, |
|
2222 aLayout.iFourthTab.iMiddle, |
|
2223 aLayout.iFourthTab.iRight, |
|
2224 aGc ); |
|
2225 |
|
2226 DrawActiveTab( aTabDrawMode, |
|
2227 aLayout.iThirdTab.iLeft, |
|
2228 aLayout.iThirdTab.iMiddle, |
|
2229 aLayout.iThirdTab.iRight, |
|
2230 aGc ); |
|
2231 } |
|
2232 else if ( aActiveTab == 4 ) |
|
2233 { |
|
2234 DrawPassiveTab( aTabDrawMode, |
|
2235 aLayout.iFirstTab.iLeft, |
|
2236 aLayout.iFirstTab.iMiddle, |
|
2237 aLayout.iFirstTab.iRight, |
|
2238 aGc ); |
|
2239 |
|
2240 DrawPassiveTab( aTabDrawMode, |
|
2241 aLayout.iSecondTab.iLeft, |
|
2242 aLayout.iSecondTab.iMiddle, |
|
2243 aLayout.iSecondTab.iRight, |
|
2244 aGc ); |
|
2245 |
|
2246 DrawPassiveTab( aTabDrawMode, |
|
2247 aLayout.iThirdTab.iLeft, |
|
2248 aLayout.iThirdTab.iMiddle, |
|
2249 aLayout.iThirdTab.iRight, |
|
2250 aGc ); |
|
2251 |
|
2252 DrawActiveTab( aTabDrawMode, |
|
2253 aLayout.iFourthTab.iLeft, |
|
2254 aLayout.iFourthTab.iMiddle, |
|
2255 aLayout.iFourthTab.iRight, |
|
2256 aGc ); |
|
2257 } |
|
2258 } |
|
2259 |
|
2260 void CAknTabGroupGraphics::DrawFourTabNarrowBackground( TTabDrawMode aTabDrawMode, |
|
2261 TInt aActiveTab, |
|
2262 CBitmapContext* aGc, |
|
2263 SAknTabGroupBackgroundLayout& aLayout ) const |
|
2264 { |
|
2265 // If not given layout, then get the default layout |
|
2266 if ( !aLayout.iUse ) |
|
2267 { |
|
2268 aLayout = FourTabBackground( aActiveTab ); |
|
2269 } |
|
2270 |
|
2271 if ( aActiveTab == 1 ) |
|
2272 { |
|
2273 DrawPassiveTab( aTabDrawMode, |
|
2274 aLayout.iFourthTab.iLeft, |
|
2275 aLayout.iFourthTab.iMiddle, |
|
2276 aLayout.iFourthTab.iRight, |
|
2277 aGc ); |
|
2278 |
|
2279 DrawPassiveTab( aTabDrawMode, |
|
2280 aLayout.iThirdTab.iLeft, |
|
2281 aLayout.iThirdTab.iMiddle, |
|
2282 aLayout.iThirdTab.iRight, |
|
2283 aGc ); |
|
2284 |
|
2285 DrawPassiveTab( aTabDrawMode, |
|
2286 aLayout.iSecondTab.iLeft, |
|
2287 aLayout.iSecondTab.iMiddle, |
|
2288 aLayout.iSecondTab.iRight, |
|
2289 aGc ); |
|
2290 |
|
2291 DrawActiveTab( aTabDrawMode, |
|
2292 aLayout.iFirstTab.iLeft, |
|
2293 aLayout.iFirstTab.iMiddle, |
|
2294 aLayout.iFirstTab.iRight, |
|
2295 aGc ); |
|
2296 } |
|
2297 else if ( aActiveTab == 2 ) |
|
2298 { |
|
2299 DrawPassiveTab( aTabDrawMode, |
|
2300 aLayout.iFourthTab.iLeft, |
|
2301 aLayout.iFourthTab.iMiddle, |
|
2302 aLayout.iFourthTab.iRight, |
|
2303 aGc ); |
|
2304 |
|
2305 DrawPassiveTab( aTabDrawMode, |
|
2306 aLayout.iThirdTab.iLeft, |
|
2307 aLayout.iThirdTab.iMiddle, |
|
2308 aLayout.iThirdTab.iRight, |
|
2309 aGc ); |
|
2310 |
|
2311 DrawPassiveTab( aTabDrawMode, |
|
2312 aLayout.iFirstTab.iLeft, |
|
2313 aLayout.iFirstTab.iMiddle, |
|
2314 aLayout.iFirstTab.iRight, |
|
2315 aGc ); |
|
2316 |
|
2317 DrawActiveTab( aTabDrawMode, |
|
2318 aLayout.iSecondTab.iLeft, |
|
2319 aLayout.iSecondTab.iMiddle, |
|
2320 aLayout.iSecondTab.iRight, |
|
2321 aGc ); |
|
2322 } |
|
2323 else if ( aActiveTab == 3 ) |
|
2324 { |
|
2325 // Note the drawing order of passive tabs |
|
2326 DrawPassiveTab( aTabDrawMode, |
|
2327 aLayout.iFirstTab.iLeft, |
|
2328 aLayout.iFirstTab.iMiddle, |
|
2329 aLayout.iFirstTab.iRight, |
|
2330 aGc ); |
|
2331 |
|
2332 DrawPassiveTab( aTabDrawMode, |
|
2333 aLayout.iSecondTab.iLeft, |
|
2334 aLayout.iSecondTab.iMiddle, |
|
2335 aLayout.iSecondTab.iRight, |
|
2336 aGc ); |
|
2337 |
|
2338 DrawPassiveTab( aTabDrawMode, |
|
2339 aLayout.iFourthTab.iLeft, |
|
2340 aLayout.iFourthTab.iMiddle, |
|
2341 aLayout.iFourthTab.iRight, |
|
2342 aGc ); |
|
2343 |
|
2344 DrawActiveTab( aTabDrawMode, |
|
2345 aLayout.iThirdTab.iLeft, |
|
2346 aLayout.iThirdTab.iMiddle, |
|
2347 aLayout.iThirdTab.iRight, |
|
2348 aGc ); |
|
2349 } |
|
2350 else if ( aActiveTab == 4 ) |
|
2351 { |
|
2352 // Note the drawing order of passive tabs |
|
2353 DrawPassiveTab( aTabDrawMode, |
|
2354 aLayout.iFirstTab.iLeft, |
|
2355 aLayout.iFirstTab.iMiddle, |
|
2356 aLayout.iFirstTab.iRight, |
|
2357 aGc ); |
|
2358 |
|
2359 DrawPassiveTab( aTabDrawMode, |
|
2360 aLayout.iSecondTab.iLeft, |
|
2361 aLayout.iSecondTab.iMiddle, |
|
2362 aLayout.iSecondTab.iRight, |
|
2363 aGc ); |
|
2364 |
|
2365 DrawPassiveTab( aTabDrawMode, |
|
2366 aLayout.iThirdTab.iLeft, |
|
2367 aLayout.iThirdTab.iMiddle, |
|
2368 aLayout.iThirdTab.iRight, |
|
2369 aGc ); |
|
2370 |
|
2371 DrawActiveTab( aTabDrawMode, |
|
2372 aLayout.iFourthTab.iLeft, |
|
2373 aLayout.iFourthTab.iMiddle, |
|
2374 aLayout.iFourthTab.iRight, |
|
2375 aGc ); |
|
2376 } |
|
2377 } |
|
2378 |
|
2379 CAknTabGroupGraphics::SAknTabGroupBackgroundLayout CAknTabGroupGraphics::TwoLongTabBackground(TInt aActiveTab) const |
1695 CAknTabGroupGraphics::SAknTabGroupBackgroundLayout CAknTabGroupGraphics::TwoLongTabBackground(TInt aActiveTab) const |
2380 { |
1696 { |
2381 SAknTabGroupBackgroundLayout aLayout; |
1697 SAknTabGroupBackgroundLayout aLayout; |
2382 |
1698 |
2383 // screen |
1699 // screen |
3037 aLayout.iFourthTab.iMiddle = TRect(0,0,0,0); |
2269 aLayout.iFourthTab.iMiddle = TRect(0,0,0,0); |
3038 aLayout.iFourthTab.iRight = TRect(0,0,0,0); |
2270 aLayout.iFourthTab.iRight = TRect(0,0,0,0); |
3039 |
2271 |
3040 return aLayout; |
2272 return aLayout; |
3041 } |
2273 } |
3042 |
|
3043 void CAknTabGroupGraphics::DrawThreeLongTabBackground( TTabDrawMode aTabDrawMode, |
|
3044 TInt aActiveTab, CBitmapContext* aGc, |
|
3045 SAknTabGroupBackgroundLayout& aLayout ) const |
|
3046 { |
|
3047 // If not given layout, then get the default layout |
|
3048 if ( !aLayout.iUse ) |
|
3049 { |
|
3050 aLayout = ThreeLongTabBackground( aActiveTab ); |
|
3051 } |
|
3052 |
|
3053 if ( aActiveTab == 1 ) |
|
3054 { |
|
3055 DrawPassiveTab( aTabDrawMode, |
|
3056 aLayout.iThirdTab.iLeft, |
|
3057 aLayout.iThirdTab.iMiddle, |
|
3058 aLayout.iThirdTab.iRight, |
|
3059 aGc ); |
|
3060 DrawPassiveTab( aTabDrawMode, |
|
3061 aLayout.iSecondTab.iLeft, |
|
3062 aLayout.iSecondTab.iMiddle, |
|
3063 aLayout.iSecondTab.iRight, |
|
3064 aGc ); |
|
3065 DrawActiveTab( aTabDrawMode, |
|
3066 aLayout.iFirstTab.iLeft, |
|
3067 aLayout.iFirstTab.iMiddle, |
|
3068 aLayout.iFirstTab.iRight, |
|
3069 aGc ); |
|
3070 } |
|
3071 else if ( aActiveTab == 2) |
|
3072 { |
|
3073 DrawPassiveTab( aTabDrawMode, |
|
3074 aLayout.iFirstTab.iLeft, |
|
3075 aLayout.iFirstTab.iMiddle, |
|
3076 aLayout.iFirstTab.iRight, |
|
3077 aGc ); |
|
3078 DrawPassiveTab( aTabDrawMode, |
|
3079 aLayout.iThirdTab.iLeft, |
|
3080 aLayout.iThirdTab.iMiddle, |
|
3081 aLayout.iThirdTab.iRight, |
|
3082 aGc ); |
|
3083 DrawActiveTab( aTabDrawMode, |
|
3084 aLayout.iSecondTab.iLeft, |
|
3085 aLayout.iSecondTab.iMiddle, |
|
3086 aLayout.iSecondTab.iRight, |
|
3087 aGc ); |
|
3088 } |
|
3089 else if ( aActiveTab == 3) |
|
3090 { |
|
3091 DrawPassiveTab( aTabDrawMode, |
|
3092 aLayout.iFirstTab.iLeft, |
|
3093 aLayout.iFirstTab.iMiddle, |
|
3094 aLayout.iFirstTab.iRight, |
|
3095 aGc ); |
|
3096 DrawPassiveTab( aTabDrawMode, |
|
3097 aLayout.iSecondTab.iLeft, |
|
3098 aLayout.iSecondTab.iMiddle, |
|
3099 aLayout.iSecondTab.iRight, |
|
3100 aGc ); |
|
3101 DrawActiveTab( aTabDrawMode, |
|
3102 aLayout.iThirdTab.iLeft, |
|
3103 aLayout.iThirdTab.iMiddle, |
|
3104 aLayout.iThirdTab.iRight, |
|
3105 aGc ); |
|
3106 } |
|
3107 } |
|
3108 |
|
3109 void CAknTabGroupGraphics::DrawThreeLongTabNarrowBackground( TTabDrawMode aTabDrawMode, |
|
3110 TInt aActiveTab, |
|
3111 CBitmapContext* aGc, |
|
3112 SAknTabGroupBackgroundLayout& aLayout ) const |
|
3113 { |
|
3114 // If not given layout, then get the default layout |
|
3115 if ( !aLayout.iUse ) |
|
3116 { |
|
3117 aLayout = ThreeLongTabBackground( aActiveTab ); |
|
3118 } |
|
3119 |
|
3120 if ( aActiveTab == 1 ) |
|
3121 { |
|
3122 DrawPassiveTab( aTabDrawMode, |
|
3123 aLayout.iThirdTab.iLeft, |
|
3124 aLayout.iThirdTab.iMiddle, |
|
3125 aLayout.iThirdTab.iRight, |
|
3126 aGc ); |
|
3127 DrawPassiveTab( aTabDrawMode, |
|
3128 aLayout.iSecondTab.iLeft, |
|
3129 aLayout.iSecondTab.iMiddle, |
|
3130 aLayout.iSecondTab.iRight, |
|
3131 aGc ); |
|
3132 DrawActiveTab( aTabDrawMode, |
|
3133 aLayout.iFirstTab.iLeft, |
|
3134 aLayout.iFirstTab.iMiddle, |
|
3135 aLayout.iFirstTab.iRight, |
|
3136 aGc ); |
|
3137 } |
|
3138 else if ( aActiveTab == 2) |
|
3139 { |
|
3140 DrawPassiveTab( aTabDrawMode, |
|
3141 aLayout.iFirstTab.iLeft, |
|
3142 aLayout.iFirstTab.iMiddle, |
|
3143 aLayout.iFirstTab.iRight, |
|
3144 aGc ); |
|
3145 DrawPassiveTab( aTabDrawMode, |
|
3146 aLayout.iThirdTab.iLeft, |
|
3147 aLayout.iThirdTab.iMiddle, |
|
3148 aLayout.iThirdTab.iRight, |
|
3149 aGc ); |
|
3150 DrawActiveTab( aTabDrawMode, |
|
3151 aLayout.iSecondTab.iLeft, |
|
3152 aLayout.iSecondTab.iMiddle, |
|
3153 aLayout.iSecondTab.iRight, |
|
3154 aGc ); |
|
3155 } |
|
3156 else if ( aActiveTab == 3) |
|
3157 { |
|
3158 DrawPassiveTab( aTabDrawMode, |
|
3159 aLayout.iFirstTab.iLeft, |
|
3160 aLayout.iFirstTab.iMiddle, |
|
3161 aLayout.iFirstTab.iRight, |
|
3162 aGc ); |
|
3163 DrawPassiveTab( aTabDrawMode, |
|
3164 aLayout.iSecondTab.iLeft, |
|
3165 aLayout.iSecondTab.iMiddle, |
|
3166 aLayout.iSecondTab.iRight, |
|
3167 aGc ); |
|
3168 DrawActiveTab( aTabDrawMode, |
|
3169 aLayout.iThirdTab.iLeft, |
|
3170 aLayout.iThirdTab.iMiddle, |
|
3171 aLayout.iThirdTab.iRight, |
|
3172 aGc ); |
|
3173 } |
|
3174 } |
|
3175 |
|
3176 |
2274 |
3177 // --------------------------------------------------------------------------- |
2275 // --------------------------------------------------------------------------- |
3178 // Draws single tab graphics for an active tab. |
2276 // Draws single tab graphics for an active tab. |
3179 // --------------------------------------------------------------------------- |
2277 // --------------------------------------------------------------------------- |
3180 // |
2278 // |
3626 } |
2724 } |
3627 |
2725 |
3628 return iTabGroupBackgroundAvailable; // 3 |
2726 return iTabGroupBackgroundAvailable; // 3 |
3629 } |
2727 } |
3630 |
2728 |
|
2729 void CAknTabGroupGraphics::DrawHighlightTabL(TTabDrawMode aDrawMode, |
|
2730 TRect aLeft, TRect aMiddle, TRect aRight, CBitmapContext* aGc) const |
|
2731 { |
|
2732 if ( aDrawMode == CAknTabGroupGraphics::ENoDraw ) |
|
2733 { |
|
2734 return; |
|
2735 } |
|
2736 |
|
2737 TRect rect( aLeft ); |
|
2738 CFbsBitmap* activeColorBitmap = new (ELeave) CFbsBitmap(); |
|
2739 CleanupStack::PushL( activeColorBitmap ); |
|
2740 |
|
2741 TDisplayMode screenDisplayMode( iPassiveTabLeft->DisplayMode() ); |
|
2742 activeColorBitmap->Create( rect.Size(), screenDisplayMode ); |
|
2743 |
|
2744 TRgb color; |
|
2745 AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), color, |
|
2746 KAknsIIDQsnOtherColors, EAknsCIQsnOtherColorsCG25 ); |
|
2747 |
|
2748 CFbsBitmapDevice* destinationDevice = CFbsBitmapDevice::NewL( activeColorBitmap ); |
|
2749 CleanupStack::PushL( destinationDevice ); |
|
2750 CFbsBitGc* destinationGc; |
|
2751 User::LeaveIfError( destinationDevice->CreateContext( destinationGc ) ); |
|
2752 destinationGc->SetPenColor( color ); |
|
2753 destinationGc->SetPenStyle( CGraphicsContext::ESolidPen ); |
|
2754 destinationGc->SetBrushColor( color ); |
|
2755 destinationGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
2756 destinationGc->DrawRect( TRect( activeColorBitmap->SizeInPixels() ) ); |
|
2757 |
|
2758 delete destinationGc; |
|
2759 CleanupStack::PopAndDestroy( destinationDevice ); |
|
2760 |
|
2761 aGc->BitBltMasked( rect.iTl, activeColorBitmap, |
|
2762 TRect( 0, 0, rect.Width(), rect.Height() ), |
|
2763 iPassiveTabLeftMask, ETrue ); |
|
2764 |
|
2765 CleanupStack::PopAndDestroy( activeColorBitmap ); |
|
2766 |
|
2767 /*********************************************************************/ |
|
2768 |
|
2769 rect = aMiddle; |
|
2770 |
|
2771 CFbsBitmap* activeColorBitmapM = new (ELeave) CFbsBitmap(); |
|
2772 CleanupStack::PushL( activeColorBitmapM ); |
|
2773 |
|
2774 activeColorBitmapM->Create( rect.Size(), screenDisplayMode ); |
|
2775 |
|
2776 destinationDevice = CFbsBitmapDevice::NewL( activeColorBitmapM ); |
|
2777 CleanupStack::PushL( destinationDevice ); |
|
2778 User::LeaveIfError( destinationDevice->CreateContext( destinationGc ) ); |
|
2779 destinationGc->SetPenColor( color ); |
|
2780 destinationGc->SetPenStyle( CGraphicsContext::ESolidPen ); |
|
2781 destinationGc->SetBrushColor( color ); |
|
2782 destinationGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
2783 destinationGc->DrawRect( TRect( activeColorBitmapM->SizeInPixels() ) ); |
|
2784 |
|
2785 delete destinationGc; |
|
2786 CleanupStack::PopAndDestroy( destinationDevice ); |
|
2787 |
|
2788 aGc->BitBltMasked(rect.iTl, activeColorBitmapM, |
|
2789 TRect(0, 0, rect.Width(), rect.Height() ), |
|
2790 iPassiveTabMiddleMask, ETrue ); |
|
2791 CleanupStack::PopAndDestroy( activeColorBitmapM ); |
|
2792 |
|
2793 /*********************************************************************/ |
|
2794 |
|
2795 rect = aRight; |
|
2796 |
|
2797 CFbsBitmap* activeColorBitmapR = new (ELeave) CFbsBitmap(); |
|
2798 CleanupStack::PushL( activeColorBitmapR ); |
|
2799 |
|
2800 activeColorBitmapR->Create( rect.Size(), screenDisplayMode ); |
|
2801 |
|
2802 destinationDevice = CFbsBitmapDevice::NewL( activeColorBitmapR ); |
|
2803 CleanupStack::PushL( destinationDevice ); |
|
2804 User::LeaveIfError( destinationDevice->CreateContext( destinationGc ) ); |
|
2805 destinationGc->SetPenColor( color ); |
|
2806 destinationGc->SetPenStyle( CGraphicsContext::ESolidPen ); |
|
2807 destinationGc->SetBrushColor( color ); |
|
2808 destinationGc->SetBrushStyle( CGraphicsContext::ESolidBrush ); |
|
2809 destinationGc->DrawRect( TRect( activeColorBitmapR->SizeInPixels() ) ); |
|
2810 |
|
2811 delete destinationGc; |
|
2812 CleanupStack::PopAndDestroy( destinationDevice ); |
|
2813 aGc->BitBltMasked( rect.iTl, activeColorBitmapR, |
|
2814 TRect(0, 0, rect.Width(), rect.Height() ), |
|
2815 iPassiveTabRightMask, ETrue ); |
|
2816 |
|
2817 CleanupStack::PopAndDestroy( activeColorBitmapM ); |
|
2818 } |
|
2819 |
|
2820 void CAknTabGroupGraphics::ReviseLayoutForTabBackground( |
|
2821 SAknTabGroupBackgroundLayout& aLayout, |
|
2822 TInt aNumberOfTabs, |
|
2823 TBool aLongTabs, |
|
2824 TInt aActiveTab, |
|
2825 TBool aIsNarrow, |
|
2826 TTabAnimationType aAnimation) const |
|
2827 { |
|
2828 if (aLayout.iUse) |
|
2829 { |
|
2830 // aLayout has been set, return directly. |
|
2831 return; |
|
2832 } |
|
2833 |
|
2834 if (aIsNarrow) |
|
2835 { |
|
2836 switch (aNumberOfTabs) |
|
2837 { |
|
2838 case 2: |
|
2839 { |
|
2840 aLayout = aLongTabs ? TwoLongTabNarrowBackground(aActiveTab) : TwoTabNarrowBackground(aActiveTab); |
|
2841 break; |
|
2842 } |
|
2843 case 3: |
|
2844 { |
|
2845 aLayout = aLongTabs ? ThreeLongTabNarrowBackground(aActiveTab) : ThreeTabNarrowBackground(aActiveTab); |
|
2846 break; |
|
2847 } |
|
2848 case 4: |
|
2849 { |
|
2850 aLayout = FourTabNarrowBackground(aActiveTab); |
|
2851 break; |
|
2852 } |
|
2853 default: |
|
2854 { |
|
2855 #ifdef AVKON_RDEBUG_ERROR |
|
2856 RDebug::Print(_L("CAknTabGroupGraphics: Unknown narrow tab layout !")); |
|
2857 #endif |
|
2858 } |
|
2859 } |
|
2860 aLayout.iUse = ETrue; |
|
2861 } |
|
2862 else |
|
2863 { |
|
2864 switch (aNumberOfTabs) |
|
2865 { |
|
2866 case 2: |
|
2867 { |
|
2868 aLayout = aLongTabs ? TwoLongTabBackground(aActiveTab) : TwoTabBackground(aActiveTab); |
|
2869 break; |
|
2870 } |
|
2871 case 3: |
|
2872 { |
|
2873 if (aLongTabs) |
|
2874 { |
|
2875 aLayout = ThreeLongTabBackground(aActiveTab); |
|
2876 } |
|
2877 else |
|
2878 { |
|
2879 TInt animActiveTab = aActiveTab; |
|
2880 if (aAnimation && aActiveTab == 2) |
|
2881 { |
|
2882 // Move the tab highlight already during the animation. |
|
2883 animActiveTab = |
|
2884 aAnimation == ECycleToLeft ? aActiveTab - 1 : aActiveTab + 1; |
|
2885 } |
|
2886 aLayout = ThreeTabBackground(animActiveTab); |
|
2887 } |
|
2888 break; |
|
2889 } |
|
2890 case 4: |
|
2891 { |
|
2892 aLayout = FourTabBackground(aActiveTab); |
|
2893 break; |
|
2894 } |
|
2895 default: |
|
2896 { |
|
2897 #ifdef AVKON_RDEBUG_ERROR |
|
2898 RDebug::Print( _L("CAknTabGroupGraphics: Unknown tab layout !") ); |
|
2899 #endif |
|
2900 } |
|
2901 } |
|
2902 } |
|
2903 } |
|
2904 |
|
2905 void CAknTabGroupGraphics::ReviseLayoutUseFlag( |
|
2906 SAknTabGroupBackgroundLayout& aLayout, |
|
2907 TInt aActiveTab) const |
|
2908 { |
|
2909 if (!aLayout.iUse) |
|
2910 { |
|
2911 aLayout.iFirstTab.iActive = EFalse; |
|
2912 aLayout.iSecondTab.iActive = EFalse; |
|
2913 aLayout.iThirdTab.iActive = EFalse; |
|
2914 aLayout.iFourthTab.iActive = EFalse; |
|
2915 |
|
2916 if (aActiveTab == 1) |
|
2917 { |
|
2918 aLayout.iFirstTab.iActive = ETrue; |
|
2919 } |
|
2920 else if (aActiveTab == 2) |
|
2921 { |
|
2922 aLayout.iSecondTab.iActive = ETrue; |
|
2923 } |
|
2924 else if (aActiveTab == 3) |
|
2925 { |
|
2926 aLayout.iThirdTab.iActive = ETrue; |
|
2927 } |
|
2928 else if (aActiveTab == 4) |
|
2929 { |
|
2930 aLayout.iFourthTab.iActive = ETrue; |
|
2931 } |
|
2932 } |
|
2933 } |
|
2934 |
|
2935 |
|
2936 #define GET_TABLAYOUT_RECT(idx) do{ \ |
|
2937 left = aLayout.idx.iLeft; \ |
|
2938 middle = aLayout.idx.iMiddle; \ |
|
2939 right = aLayout.idx.iRight; \ |
|
2940 }while (0) |
|
2941 |
|
2942 void CAknTabGroupGraphics::ProcessDrawTabInstructions( |
|
2943 TTabInstruction *aInstructions, |
|
2944 TInt aNumOfIns, |
|
2945 TTabDrawMode aTabDrawMode, |
|
2946 SAknTabGroupBackgroundLayout& aLayout, |
|
2947 CBitmapContext* aGc) const |
|
2948 { |
|
2949 if (aInstructions == NULL || aNumOfIns <= 0 || aGc == NULL) |
|
2950 { |
|
2951 return; |
|
2952 } |
|
2953 |
|
2954 for ( TInt i = 0; i < aNumOfIns; i++ ) |
|
2955 { |
|
2956 if ( aInstructions[i].iTabStyle == 5 || aInstructions[i].iTabStyle == 6 ) |
|
2957 { |
|
2958 // Draw passive tab bit. |
|
2959 DrawPassiveTabBit(aTabDrawMode, |
|
2960 aInstructions[i].iTabStyle == 5 ? ELeft : ERight, |
|
2961 aInstructions[i].iBitTabRect, |
|
2962 aGc); |
|
2963 } |
|
2964 else |
|
2965 { |
|
2966 TBool layoutValid = ETrue; |
|
2967 TRect left, middle, right; |
|
2968 switch (aInstructions[i].iLayoutIdx) |
|
2969 { |
|
2970 case 1: |
|
2971 { |
|
2972 GET_TABLAYOUT_RECT(iFirstTab); |
|
2973 break; |
|
2974 } |
|
2975 case 2: |
|
2976 { |
|
2977 GET_TABLAYOUT_RECT(iSecondTab); |
|
2978 break; |
|
2979 } |
|
2980 case 3: |
|
2981 { |
|
2982 GET_TABLAYOUT_RECT(iThirdTab); |
|
2983 break; |
|
2984 } |
|
2985 case 4: |
|
2986 { |
|
2987 GET_TABLAYOUT_RECT(iFourthTab); |
|
2988 break; |
|
2989 } |
|
2990 case 5: |
|
2991 { |
|
2992 GET_TABLAYOUT_RECT(iHiddenTabLeft); |
|
2993 break; |
|
2994 } |
|
2995 case 6: |
|
2996 { |
|
2997 GET_TABLAYOUT_RECT(iHiddenTabRight); |
|
2998 break; |
|
2999 } |
|
3000 default: |
|
3001 { |
|
3002 layoutValid = EFalse; |
|
3003 } |
|
3004 } |
|
3005 |
|
3006 if (layoutValid) |
|
3007 { |
|
3008 if (aInstructions[i].iTabStyle == 1) |
|
3009 { |
|
3010 DrawActiveTab(aTabDrawMode, left, middle, right, aGc); |
|
3011 } |
|
3012 else if (aInstructions[i].iTabStyle == 2) |
|
3013 { |
|
3014 DrawPassiveTab(aTabDrawMode, left, middle, right, aGc, aInstructions[i].iPassiveFade); |
|
3015 } |
|
3016 else if (aInstructions[i].iTabStyle == 3) |
|
3017 { |
|
3018 TRAP_IGNORE( DrawHighlightTabL(aTabDrawMode, left, middle, right, aGc) ); |
|
3019 } |
|
3020 } |
|
3021 } |
|
3022 } |
|
3023 } |
|
3024 |
3631 // End of file |
3025 // End of file |