113 * |
113 * |
114 * @param aParent Parent rectangle |
114 * @param aParent Parent rectangle |
115 */ |
115 */ |
116 void SetTabGroupBackgroundParent( TRect aParent ); |
116 void SetTabGroupBackgroundParent( TRect aParent ); |
117 |
117 |
|
118 #if 0 // not used |
|
119 /** |
|
120 * This method draws the tab background bitmap using SVG graphics. |
|
121 * The tab combination is given as bitmap id which refers to old style |
|
122 * tab bitmaps. |
|
123 * |
|
124 * @param aAvkonBitmapId Bitmap index (@see avkon.mbg). |
|
125 * |
|
126 * @return Struct which contains both the bitmap and the mask. |
|
127 * Ownership is transferred to the caller. |
|
128 */ |
|
129 CAknTabGroupGraphics::SAknTabGroupBackground CreateTabGroupBackgroundL( |
|
130 TInt aAvkonBitmapId ); |
|
131 |
|
132 #endif |
118 /** |
133 /** |
119 * Draw modes of the tab background graphics. |
134 * Draw modes of the tab background graphics. |
120 */ |
135 */ |
121 enum TTabDrawMode |
136 enum TTabDrawMode |
122 { |
137 { |
170 * @c EFalse, then the layout is calculated |
185 * @c EFalse, then the layout is calculated |
171 * to the @c aLayout. |
186 * to the @c aLayout. |
172 * @param aTabsHidden Specifies where hidden tabs are drawn. |
187 * @param aTabsHidden Specifies where hidden tabs are drawn. |
173 * @param aAnimation Specifies the used animation. |
188 * @param aAnimation Specifies the used animation. |
174 */ |
189 */ |
175 void DrawTabGroupBackground( |
190 void DrawTabGroupBackgroundL( |
176 TTabDrawMode aTabDrawMode, |
191 TTabDrawMode aTabDrawMode, |
177 TBool aLongTabs, |
192 TBool aLongTabs, |
178 TInt aNumberOfTabs, |
193 TInt aNumberOfTabs, |
179 TInt aActiveTab, |
194 TInt aActiveTab, |
180 CBitmapContext* aGc, |
195 CBitmapContext* aGc, |
181 SAknTabGroupBackgroundLayout& aLayout, |
196 SAknTabGroupBackgroundLayout& aLayout, |
182 TTabsHidden aTabsHidden, |
197 TTabsHidden aTabsHidden, |
183 TTabAnimationType aAnimation = ENoAnimation, |
198 TTabAnimationType aAnimation = ENoAnimation ) const; |
184 TInt aHighlightTab = 0 ) const; |
|
185 |
199 |
186 /** |
200 /** |
187 * Draws narrow tab background from given parameters. |
201 * Draws narrow tab background from given parameters. |
188 * |
202 * |
189 * @param aTabDrawMode Mode with which the background is drawn. |
203 * @param aTabDrawMode Mode with which the background is drawn. |
197 * @param aLayout[in,out] Tab group background layout used in drawing. |
211 * @param aLayout[in,out] Tab group background layout used in drawing. |
198 * If the @c aLayout's @c iUse parameter is |
212 * If the @c aLayout's @c iUse parameter is |
199 * @c EFalse, then the layout is calculated |
213 * @c EFalse, then the layout is calculated |
200 * to the @c aLayout. |
214 * to the @c aLayout. |
201 */ |
215 */ |
202 void DrawTabGroupNarrowBackground( |
216 void DrawTabGroupNarrowBackgroundL( |
203 TTabDrawMode aTabDrawMode, |
217 TTabDrawMode aTabDrawMode, |
204 TBool aLongTabs, |
218 TBool aLongTabs, |
205 TInt aNumberOfTabs, |
219 TInt aNumberOfTabs, |
206 TInt aActiveTab, |
220 TInt aActiveTab, |
207 CBitmapContext* aGc, |
221 CBitmapContext* aGc, |
321 TwoLongTabNarrowBackground( TInt aActiveTab ) const; |
335 TwoLongTabNarrowBackground( TInt aActiveTab ) const; |
322 |
336 |
323 CAknTabGroupGraphics::SAknTabGroupBackgroundLayout |
337 CAknTabGroupGraphics::SAknTabGroupBackgroundLayout |
324 ThreeLongTabNarrowBackground( TInt aActiveTab ) const; |
338 ThreeLongTabNarrowBackground( TInt aActiveTab ) const; |
325 |
339 |
|
340 /** |
|
341 * Methods to draw normal tab backgrounds. |
|
342 */ |
|
343 void DrawTwoTabBackground( TTabDrawMode aDrawMode, |
|
344 TInt aActiveTab, |
|
345 CBitmapContext* aGc, |
|
346 SAknTabGroupBackgroundLayout& aLayout ) const; |
|
347 |
|
348 void DrawThreeTabBackground( TTabDrawMode aDrawMode, |
|
349 TInt aActiveTab, |
|
350 CBitmapContext* aGc, |
|
351 SAknTabGroupBackgroundLayout& aLayout, |
|
352 TTabsHidden aTabsHidden, |
|
353 TTabAnimationType aAnimation = ENoAnimation ) const; |
|
354 |
|
355 void DrawFourTabBackground( TTabDrawMode aDrawMode, |
|
356 TInt aActiveTab, |
|
357 CBitmapContext* aGc, |
|
358 SAknTabGroupBackgroundLayout& aLayout ) const; |
|
359 |
|
360 void DrawTwoLongTabBackground( |
|
361 TTabDrawMode aDrawMode, |
|
362 TInt aActiveTab, |
|
363 CBitmapContext* aGc, |
|
364 SAknTabGroupBackgroundLayout& aLayout ) const; |
|
365 |
|
366 void DrawThreeLongTabBackground( |
|
367 TTabDrawMode aDrawMode, |
|
368 TInt aActiveTab, |
|
369 CBitmapContext* aGc, |
|
370 SAknTabGroupBackgroundLayout& aLayout ) const; |
|
371 |
|
372 /** |
|
373 * Methods to draw narrow tab backgrounds. |
|
374 */ |
|
375 void DrawTwoTabNarrowBackground( |
|
376 TTabDrawMode aDrawMode, |
|
377 TInt aActiveTab, |
|
378 CBitmapContext* aGc, |
|
379 SAknTabGroupBackgroundLayout& aLayout ) const; |
|
380 |
|
381 void DrawThreeTabNarrowBackground( |
|
382 TTabDrawMode aDrawMode, |
|
383 TInt aActiveTab, |
|
384 CBitmapContext* aGc, |
|
385 SAknTabGroupBackgroundLayout& aLayout ) const; |
|
386 |
|
387 void DrawFourTabNarrowBackground( |
|
388 TTabDrawMode aDrawMode, |
|
389 TInt aActiveTab, |
|
390 CBitmapContext* aGc, |
|
391 SAknTabGroupBackgroundLayout& aLayout ) const; |
|
392 |
|
393 void DrawTwoLongTabNarrowBackground( |
|
394 TTabDrawMode aDrawMode, |
|
395 TInt aActiveTab, |
|
396 CBitmapContext* aGc, |
|
397 SAknTabGroupBackgroundLayout& aLayout ) const; |
|
398 |
|
399 void DrawThreeLongTabNarrowBackground( |
|
400 TTabDrawMode aDrawMode, |
|
401 TInt aActiveTab, |
|
402 CBitmapContext* aGc, |
|
403 SAknTabGroupBackgroundLayout& aLayout ) const; |
326 |
404 |
327 /** |
405 /** |
328 * Draws single tab graphics for an active tab. |
406 * Draws single tab graphics for an active tab. |
329 * |
407 * |
330 * @param aDrawMode Mode with which the background is drawn. |
408 * @param aDrawMode Mode with which the background is drawn. |
355 TRect aRight, |
433 TRect aRight, |
356 CBitmapContext* aGc, |
434 CBitmapContext* aGc, |
357 TBool aFaded = EFalse ) const; |
435 TBool aFaded = EFalse ) const; |
358 |
436 |
359 /** |
437 /** |
360 * Draws single tab graphics for a Highlight tab. |
|
361 * |
|
362 * @param aDrawMode Mode with which the background is drawn. |
|
363 * @param aLeft Rectangle of the left part of the tab. |
|
364 * @param aMiddle Rectangle of the middle part of the tab. |
|
365 * @param aRight Rectangle of the right part of the tab. |
|
366 * @param aGc Graphics context used in drawing. |
|
367 */ |
|
368 void DrawHighlightTabL( TTabDrawMode aDrawMode, |
|
369 TRect aLeft, |
|
370 TRect aMiddle, |
|
371 TRect aRight, |
|
372 CBitmapContext* aGc ) const; |
|
373 |
|
374 /** |
|
375 * Draws single tab part graphics for a passive tab. |
438 * Draws single tab part graphics for a passive tab. |
376 * Used in drawing the hidden tab bits. |
439 * Used in drawing the hidden tab bits. |
377 * |
440 * |
378 * @param aDrawMode Mode with which the background is drawn. |
441 * @param aDrawMode Mode with which the background is drawn. |
379 * @param aTabPart Part of the tab graphics to draw. |
442 * @param aTabPart Part of the tab graphics to draw. |
393 |
456 |
394 /** |
457 /** |
395 * Helper method to get the narrow tab container rect. |
458 * Helper method to get the narrow tab container rect. |
396 */ |
459 */ |
397 TRect NarrowParentRect() const; |
460 TRect NarrowParentRect() const; |
398 |
|
399 /** |
|
400 * Sets the layout for tab background according to specified parameters. |
|
401 * Used in DrawTabGroupBackground/DrawTabGroupNarrowBackground |
|
402 * |
|
403 * @param aLayout[in,out] Tab group background layout used in drawing. |
|
404 * If the @c aLayout's @c iUse parameter is |
|
405 * @c EFalse, then the layout is calculated |
|
406 * to the @c aLayout. |
|
407 * @param aNumberOfTabs Number of tabs visible in the tab group (not |
|
408 * the total number of tabs in the tab group). |
|
409 * @param aLongTabs Active tab number in relation to the first tab |
|
410 * shown. This value can be from one to |
|
411 * @c aNumberOfTabs. |
|
412 * @param aLongTabs Specifies whether or not long tabs are used. |
|
413 * @param aIsNarrow Specifies whether or not narrow tabs are used. |
|
414 * @param aAnimation Specifies the used animation. |
|
415 */ |
|
416 void CAknTabGroupGraphics::ReviseLayoutForTabBackground( |
|
417 SAknTabGroupBackgroundLayout& aLayout, |
|
418 TInt aNumberOfTabs, |
|
419 TBool aLongTabs, |
|
420 TInt aActiveTab, |
|
421 TBool aIsNarrow, |
|
422 TTabAnimationType aAnimation |
|
423 ) const; |
|
424 |
|
425 /** |
|
426 * Sets active tab flag for the layout. |
|
427 * Used in DrawTabGroupBackground/DrawTabGroupNarrowBackground |
|
428 * |
|
429 * @param aLayout[in,out] Tab group background layout used in drawing. |
|
430 * If the @c aLayout's @c iUse parameter is |
|
431 * @c EFalse, then the layout is calculated |
|
432 * to the @c aLayout. |
|
433 * @param aActiveTab Active tab number in relation to the first tab |
|
434 * shown. This value can be from one to |
|
435 * @c aNumberOfTabs. |
|
436 */ |
|
437 void ReviseLayoutUseFlag( |
|
438 SAknTabGroupBackgroundLayout& aLayout, |
|
439 TInt aActiveTab |
|
440 ) const; |
|
441 |
|
442 /** |
|
443 * Processes the instructions and draw the tab background according to instructions. |
|
444 * Instructions are created according to drawing sequence. |
|
445 * Used in DrawTabGroupBackground/DrawTabGroupNarrowBackground |
|
446 * |
|
447 * @param aInstructions The instructions for drawing tabs. |
|
448 * @param aNumOfIns The number of instructions. |
|
449 * @param aTabDrawMode Mode with which the background is drawn. |
|
450 * @param aLayout[in,out] Tab group background layout used in drawing. |
|
451 * If the @c aLayout's @c iUse parameter is |
|
452 * @c EFalse, then the layout is calculated |
|
453 * to the @c aLayout. |
|
454 * @param aGc Graphics context used in drawing the background. |
|
455 * |
|
456 */ |
|
457 void ProcessDrawTabInstructions( |
|
458 struct TTabInstruction *aInstructions, |
|
459 TInt aNumOfIns, |
|
460 TTabDrawMode aTabDrawMode, |
|
461 SAknTabGroupBackgroundLayout& aLayout, |
|
462 CBitmapContext* aGc |
|
463 ) const; |
|
464 |
|
465 |
461 |
466 private: // Member data. |
462 private: // Member data. |
467 |
463 |
468 CFbsBitmap* iActiveTabLeft; |
464 CFbsBitmap* iActiveTabLeft; |
469 CFbsBitmap* iActiveTabLeftMask; |
465 CFbsBitmap* iActiveTabLeftMask; |