2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
22 // Copyright (c) 2001 Symbian Ltd. All rights reserved.
24 #if !defined(__EIKFRLBD_H__)
25 #define __EIKFRLBD_H__
33 #include <AknsDrawUtils.h> // for TAknsQsnTextColorsIndex
34 #include <babitflags.h> // for TBitFlags32
38 class CFormattedCellListBoxDataExtension;
39 class MAknsControlContext;
42 class CAknsEffectAnim;
43 class TAknTextLineLayout;
44 class TAknWindowLineLayout;
45 class TAknTextComponentLayout;
46 class TAknWindowComponentLayout;
49 * A callback interface for overriding highlight animation input layer
50 * preparation in derived classes. Usually drawing the background under the
51 * highlight rect will yield the right kind of result. The size of the render
52 * target is equal to item cell size.
56 class MListBoxAnimBackgroundDrawer
60 * @param aGc Bitmapped graphical context to draw to.
63 virtual TBool DrawHighlightAnimBackground( CFbsBitGc& aGc ) const = 0;
67 * @c CFormattedCellListBoxData can draw list items.
68 * This is similar class than @c CColumnListBoxData, but it can more freely
69 * layout the list items; more parameters can be used to position the elements.
70 * In particular, the position of the elements is free, and not tied to fixed
73 * This class is used to draw most of the S60 list and grid layouts.
75 * It also handles truncation of the text elements, centering and cropping of
76 * images, z-order/overlapping cells, bi-directional text drawing, backgrounds
77 * for lists, highlight drawing, various text and image properties and finally
78 * the parts of the separator lines that are inside list items.
80 * This is a very low level class. The less you use this class, the better.
81 * Applications should be using @c CAknSelectionListDialog or
82 * @c CAknMarkableListDialog or @c CAknListQueryDialog to use lists. There are
83 * enough predefined list layouts available, so there should be no need for
84 * applications to use this class. See Style Guide for more information. Use of
85 * this class may cause your application to not look ok when properties of the
90 class CFormattedCellListBoxData : public CListBoxData
92 friend class CFormattedCellListBoxDataExtension;
96 //INNER CLASS DECLARATION
98 * A container class for storage of colour values.
99 * Used by @c CFormattedCellListBoxData.
107 * C++ default constructor.
119 * The background colour.
124 * The highlighted text colour.
126 TRgb iHighlightedText;
129 * The highlighted background colour.
131 TRgb iHighlightedBack;
134 * The separator line colour.
136 * @deprecated The separator line colour is no longer used because the
137 * separator lines are skinned.
139 TRgb iRightSeparatorColor;
145 * Two-phased constructor.
147 * @return Pointer to a new formatted cell listbox data object.
149 IMPORT_C static CFormattedCellListBoxData* NewL();
154 IMPORT_C ~CFormattedCellListBoxData();
159 * Gets colours attached to the cell.
161 * @param aSubCellIndex Index number of the subcell.
162 * @return Text and background colors.
164 IMPORT_C const TColors& SubCellColors(TInt aSubCellIndex) const;
167 * Sets colours attached to the cell.
169 * @param aSubCellIndex Index number of the subcell.
170 * @param aColors Text and background colors.
172 IMPORT_C void SetSubCellColorsL(TInt aSubCellIndex, const TColors &aColors);
175 * Gets baseline position from top of the cell.
177 * @param aSubCellIndex Index number of the subcell.
178 * @return Baseline y-position.
180 IMPORT_C TInt SubCellBaselinePos(TInt aSubCellIndex) const;
183 * Sets baseline position from top of the cell.
185 * @param aSubCellIndex Index number of the subcell.
186 * @param aPos Position which is set for the item.
188 IMPORT_C void SetSubCellBaselinePosL(TInt aSubCellIndex, TInt aPos);
191 * Gets cell size in pixels.
193 * @param aSubCellIndex Index number of the subcell.
196 IMPORT_C TSize SubCellSize(TInt aSubCellIndex) const;
199 * Sets cell size in pixels.
201 * @param aSubCellIndex Index number of the subcell.
202 * @param aSize Cell size.
204 IMPORT_C void SetSubCellSizeL(TInt aSubCellIndex, TSize aSize);
207 * Gets cell position inside an item.
209 * @param aSubCellIndex Index number of the subcell.
210 * @return Cell position.
212 IMPORT_C TPoint SubCellPosition(TInt aSubCellIndex) const;
215 * Sets cell position inside an item.
217 * @param aSubCellIndex Index number of the subcell.
218 * @param aPosition New position for cell.
220 IMPORT_C void SetSubCellPositionL(TInt aSubCellIndex, TPoint aPosition);
223 * Determines whether this cell can overlap with one of the previous cells.
225 * @param aSubCellIndex Index number of the subcell.
226 * @return @c ETrue if cell overlaps another one, @c EFalse if cell allocates
227 * area from other cells.
229 IMPORT_C TBool SubCellIsTransparent(TInt aSubCellIndex) const;
232 * Modifies whether the cell can overlap with one of the previous cells.
234 * @param aSubCellIndex Index number of the subcell.
235 * @param aIsTransparent @c ETrue if transparent, @c EFalse if not.
237 IMPORT_C void SetTransparentSubCellL(TInt aSubCellIndex,
238 TBool aIsTransparent);
241 * Checks whether drawing algorithm always draws the cell or whether empty
242 * string in list item can disable the drawing of the cell.
244 * @param aSubCellIndex Index number of the subcell.
245 * @return @c ETrue when empty string disables cell,
246 * @c EFalse if always drawn.
248 IMPORT_C TBool SubCellIsNotAlwaysDrawn(TInt aSubCellIndex) const;
251 * Sets whether drawing algorithm always draws the cell.
253 * @param aSubCellIndex Index number of the subcell.
254 * @param aIsNotAlwaysDrawn If @c ETrue, empty string disables cell.
256 IMPORT_C void SetNotAlwaysDrawnSubCellL(TInt aSubCellIndex,
257 TBool aIsNotAlwaysDrawn);
260 * Gets margins used for the content inside the cell.
262 * @param aSubCellIndex Index number of the subcell.
263 * @return Margins in pixels.
265 IMPORT_C TMargins SubCellMargins(TInt aSubCellIndex) const;
268 * Sets margins for the content inside the cell.
270 * @param aSubCellIndex Index number of the subcell.
271 * @param aMargins Margins for the content inside the cell.
273 IMPORT_C void SetSubCellMarginsL(TInt aSubCellIndex, TMargins aMargins);
276 * Gets font attached to the cell.
278 * @param aSubCellIndex Index number of the subcell.
279 * @return Handle to the attached font.
281 IMPORT_C const CFont* SubCellFont(TInt aSubCellIndex) const;
284 * Sets the font attached to the cell.
286 * @param aSubCellIndex Index number of the subcell.
287 * @param aFont Font to attach to the cell.
289 IMPORT_C void SetSubCellFontL(TInt aSubCellIndex, const CFont* aFont);
292 * Gets the alignment attached to the cell.
294 * @param aSubCellIndex Index number of the subcell.
295 * @return Alignment of the text.
297 IMPORT_C CGraphicsContext::TTextAlign SubCellAlignment(TInt aSubCellIndex)
301 * Sets the alignment attached to the cell.
303 * @param aSubCellIndex Index number of the subcell.
304 * @param aAlign Alignment that is attached to the cell
306 IMPORT_C void SetSubCellAlignmentL(TInt aSubCellIndex,
307 CGraphicsContext::TTextAlign aAlign);
310 * Checks whetherdrawing algorithm considers the text
311 * string in list item as unicode text string displayable on the screen,
312 * or as string representation of an index to icon array.
314 * @param aSubCellIndex Index number of the subcell.
315 * @return @c ETrue if graphics cell, @c EFalse if text cell.
317 IMPORT_C TBool SubCellIsGraphics(TInt aSubCellIndex) const;
320 * Sets whether drawing algorithm considers the text string in list item as
321 * unicode text string displayable on the screen, or as string
322 * representation of an index to icon array.
324 * @param aSubCellIndex Index number of the subcell.
325 * @param aIsGraphics @c ETrue if graphics cell, @c EFalse if text cell.
327 IMPORT_C void SetGraphicsSubCellL(TInt aSubCellIndex, TBool aIsGraphics);
330 * Checks whether vertical line is drawn to the right side of the cell.
332 * @param aColumn Index number of the subcell.
333 * @return Style of pen used to draw a line for the right side of the cell.
335 IMPORT_C CGraphicsContext::TPenStyle
336 SubCellRightSeparatorStyle(TInt aColumn) const;
339 * Sets whether vertical line is drawn to the right side of the cell.
341 * @param aSubCell Index number of the subcell.
342 * @param aStyle Style of a pen used to draw a line for the right side of
345 IMPORT_C void SetSubCellRightSeparatorStyleL(TInt aSubCell,
346 CGraphicsContext::TPenStyle aStyle);
349 * Gets the amount of pixels text margins is grown if it is truncated.
350 * This is usually very small number used to make the layout look more
351 * balanced when text is truncated. (the glyph used for truncation is
352 * almost empty and on narrow text elements, it looks odd if the truncated
353 * text element is exactly same size as non-truncated version.)
355 * @param aSubCellIndex Index number of the subcell.
356 * @return Amount of pixels that are used for growing the text margins in
359 IMPORT_C TInt SubCellTextClipGap(TInt aSubCellIndex) const;
362 * Sets the amount of pixels truncation grows a text element.
364 * @param aSubCellIndex Index number of the subcell.
365 * @param aGap The amount of pixels that are required for growing the text
366 * element when it is truncated.
368 IMPORT_C void SetSubCellTextClipGapL(TInt aSubCellIndex, TInt aGap);
371 * SkinEnabled checks whether skins are enabled on this list.
374 * @return @c ETrue if enabled, @c EFalse if disabled.
376 IMPORT_C TBool SkinEnabled() const;
379 * Sets whether skins are enabled on this list.
380 * The default value is determined from global setting from @c CAknAppUi.
383 * @param aEnabled If @c ETrue skins are set enabled.
384 * If @c EFalse skins are set disabled.
386 IMPORT_C void SetSkinEnabledL(TBool aEnabled);
389 * Checks whether the cell is used for numbers.
392 * @param aSubCellIndex Index number of the subcell.
393 * @return @c ETrue if enabled, @c EFalse if disabled.
395 IMPORT_C TBool SubCellIsNumberCell(TInt aSubCellIndex) const;
398 * Sets whether the cell is used for numbers.
401 * @param aSubCellIndex Index number of the subcell.
402 * @param aIsNumberCell New value for the flag.
404 IMPORT_C void SetNumberCellL(TInt aSubCellIndex, TBool aIsNumberCell);
407 * Gets the icon array used when drawing bitmaps for the listbox items.
409 IMPORT_C CArrayPtr<CGulIcon>* IconArray() const;
412 * Sets the icon array used when drawing bitmaps.
413 * The array can be modified (no need to call this method when modifying),
414 * even in @c MdcaPoint() or @c MdcaCount() methods of @c MDesCArray class.
415 * See also @c CTextListBoxModel::SetItemTextArray().
417 * The most common way to crash a listbox is by forgetting to call this
418 * method, or the list item string for graphics cell is not an index of
421 * @param aArray Pointer to the icon array.
423 IMPORT_C void SetIconArrayL(CArrayPtr<CGulIcon>* aArray);
426 * SetIconArray sets the icon array used when drawing bitmaps.
427 * The array can be modified (no need to call this method when modifying),
428 * even in @c MdcaPoint() or @c MdcaCount() methods of @c MDesCArray class.
429 * See also @c CTextListBoxModel::SetItemTextArray().
431 * The most common way to crash a listbox is by forgetting to call this
432 * method, or the list item string for graphics cell is not an index of
435 * @param aArray Pointer to the icon array.
437 IMPORT_C void SetIconArray(CArrayPtr<CGulIcon>* aArray);
440 * Font access to the font used in subcell.
442 * @param aItemProperties Not used in code.
443 * @param aSubCellIndex Index number of the subcell.
444 * @return Font used in subcell.
446 IMPORT_C CFont* Font(const TListItemProperties& aItemProperties,
447 TInt aSubCellIndex) const;
450 * From @c CListBoxData.
452 * @c Draw() is the most important method in
453 * @c CEikFormattedCellListBoxData.
454 * This is the only method that needs to be implemented in this class and
455 * it draws the whole list item.
457 * @param aProperties Properties attached to the list item.
458 * @param aGc Graphics Context used for drawing the list item.
459 * @param aText A text string describing the list item cells.
460 * @param aRect The area of the screen for the whole list item.
461 * @param aHighlight Whether the list item is selected.
462 * @param aColors The colours used for drawing the item.
464 IMPORT_C virtual void Draw(TListItemProperties aProperties,
469 const TColors& aColors) const;
472 * Indicates if sub cell is using its own colors rather than common colors.
474 * @param aSubCell Index number of the subcell.
475 * @return Boolean indicating whether own colors enabled.
476 * @c ETrue enabled, @c EFalse disabled.
478 IMPORT_C TBool UseSubCellColors(TInt aSubCell) const;
481 * Ability for a skin subsystem to access Mop chain through current
485 * @return Current listbox instance or NULL.
487 IMPORT_C CCoeControl* Control() const;
490 * Ability for a skin subsystem to access mop chain through current listbox
494 * @param aControlOrNull Current listbox instance or NULL. Cannot be other
495 * control than the current listbox!
497 IMPORT_C void SetControl(CCoeControl* aControlOrNull);
500 * Access to the background context of the listbox.
503 * @return Skin background context.
505 IMPORT_C MAknsControlContext* SkinBackgroundContext() const;
507 * Modify properties of the skin context (background).
510 * @param aId Skin background identifier.
511 * @param aRect Skin background rectangle.
513 IMPORT_C void SetBackgroundSkinStyle(const TAknsItemID *aId,
517 * Modify properties of the skin context (AB-column).
520 * @param aId Skin background identifier.
521 * @param aTileRect Skin background area from LAF.
523 IMPORT_C void SetSkinStyle(const TAknsItemID* aId, const TRect& aTileRect);
526 * Modify position of the parent for list default context.
529 * @param aPos The new position.
531 IMPORT_C void SetSkinParentPos(const TPoint& aPos);
534 * Modify properties of the skin context (list ending)*
537 * @param listEndId List ending skin background identifier.
538 * @param aRect List ending background area from LAF.
540 IMPORT_C void SetListEndSkinStyle(const TAknsItemID *listEndId,
544 * Gets RespectFocus flag.
546 * @return RespectFocus flag. @c ETrue if list item highlights are only
547 * shown when the list is has been focused on.
549 IMPORT_C TBool RespectFocus() const;
552 * Sets RespectFocus flag.
554 * @param aBool Value of RespectFocus flag. @c ETrue means that the
555 * list item highlight is only shown if list is focused on.
557 IMPORT_C void SetRespectFocus(TBool aBool);
560 * Set list higlight skin style.
563 * @param aFrameId The id for the frame.
564 * @param aFrameCenterId The id for the frame center.
566 IMPORT_C void SetSkinHighlightFrame(const TAknsItemID* aFrameId,
567 const TAknsItemID* aFrameCenterId);
569 * Set popup skin style.
572 * @param aFrameId The id for the frame.
573 * @param aFrameCenterId The id for the frame center.
575 IMPORT_C void SetSkinPopupFrame(const TAknsItemID* aFrameId,
576 const TAknsItemID* aFrameCenterId);
579 * Set popup skin frame position.
582 * @param aOuterRect Outer position of the frame.
583 * @param aInnerRect Inner position of the frame.
585 IMPORT_C void SetSkinPopupFramePosition(const TRect& aOuterRect,
586 const TRect& aInnerRect);
589 * Enable or disable logical to visual reordering in listbox data text
590 * drawing. By default, it is enabled. This has any effect only when
591 * bidirectional text is rendered.
593 * If you convert text to visual order prior to passing it to the listbox
594 * (for example by wrapping text to lines with methods in
595 * @c AknBidiTextUtils), then you should disable conversion in listbox by
596 * calling this method.
599 * @param aUseConversion Enable (@c ETrue) or disable
600 * (@c EFalse) conversion.
602 IMPORT_C void UseLogicalToVisualConversion( TBool aUseConversion );
605 * Enables or disables marquee.
607 * @param aEnable @c ETrue if On, @c EFalse if Off.
609 IMPORT_C void EnableMarqueeL(TBool aEnable);
612 * Determines if marquee is on.
614 * @return Flag indicating if marquee is on (@c ETrue on, @c EFalse off)
617 IMPORT_C const TBool IsMarqueeOn();
619 IMPORT_C TBool IsMarqueeOn();
622 * Function that is called when the owning control has gained the focus.
623 * Causes that animation is continued because the control is visible and
629 * Function that is called when the owning control has lost the focus.
630 * Causes the animation to pause, even if the control is partially
636 * Handles the skin change situation. Causes change of animation.
638 * @param aType Type of resource change.
640 void HandleResourceChange( TInt aType );
643 * Gets animation used for drawing the list highlight.
644 * May return NULL, in which case the normal skinned highlight should be
645 * drawn. This pointer is valid only during the draw -> you should not
646 * store it locally outside draw scope.
648 * @return Animation used for drawing the list highlight.
650 IMPORT_C const CAknsEffectAnim* HighlightAnim() const;
653 * This method should be called before drawing animated highlight. It will
654 * sync the animation with the background under the current highlight (only
655 * when current item index has changed).
657 IMPORT_C void AboutToDrawHighlightAnim() const;
660 * Sets the observer for overriding default highlight input layer drawing
661 * functionality. Note that you should still call
662 * @c AboutToDrawHighlightAnim (it will call the observer if it is set).
664 * @param aDrawer Highlight animation drawer.
666 IMPORT_C void SetHighlightAnimBackgroundDrawer(
667 MListBoxAnimBackgroundDrawer* aDrawer );
670 * Changes item cell size and resizes highlight animation. Called by list
671 * when item cell size changes. If you are using non-standard highlight
672 * sizes make sure to sync the list item cell size.
674 * @param aSize New cell size.
676 IMPORT_C void SetItemCellSize( const TSize& aSize );
679 * @return ETrue if highlight animation exists, EFalse otherwise.
683 IMPORT_C TBool HasHighlightAnim() const;
685 * The preferred method for drawing highlight animation in derived classes.
686 * Before calling this method you should check that highlight animation
687 * exists by calling HasHighlightAnim. In case of draw failure you should
688 * default to normal skinned highlight drawing. For example:
690 * TBool drawOk = EFalse;
692 * if( HasHighlightAnim() )
694 * drawOk = DrawHighlightAnim( gc, rect );
699 * ...do normal skinned draw
702 * @param aGc Graphics context for blitting animation frame
703 * @param aRect Target rect for blitting animation frame
704 * @return The draw status, ETrue if drawing was ok, EFalse otherwise.
708 IMPORT_C TBool DrawHighlightAnim( CBitmapContext& aGc, const TRect& aRect ) const;
710 * Creates pictograph interface.
711 * Only effective in Japanese variant.
712 * Called by the listbox.
714 void CreatePictographInterfaceL();
717 * Creates marquee control.
718 * Called by the listbox.
720 void CreateMarqueeControlL();
723 * Resets the marquee animation data.
728 * Gets the current list item index that is / was drawn by marquee.
730 * @return Index of the item that is / was drawn by marquee.
732 TInt CurrentMarqueeItemIndex();
735 * Sets the current list item index that was drawn by marquee.
737 * @param aIndex Index of list item.
739 void SetCurrentMarqueeItemIndex(TInt aIndex);
742 * Sets the current list item index (not for marquee). Since Symbian 3.0
743 * causes highlight animation to change its background (only if the current
744 * item index changes). Don't call this method if the index is not the
745 * current item index.
747 * @param aIndex Index number of list item.
749 void SetCurrentItemIndex(TInt aIndex);
751 // previous method was used both as current item index AND as currently
752 // drawn item index. Not really good idea.
753 void SetCurrentlyDrawnItemIndex( TInt aIndex );
756 * Sets the font attached to the cell for each row separately.
758 * @param aRowIndex Row, which subcells are to be changed.
759 * @param aSubCellIndex Index number of the subcell.
760 * @param aFont Font to be used.
762 IMPORT_C void SetSubCellFontForRowL(TInt aRowIndex,
767 * Gets font attached to the row and cell.
769 * @param aRow Index number of the row.
770 * @param aSubCellIndex Index number of the subcell.
771 * @return Font handle.
773 IMPORT_C const CFont* RowAndSubCellFont(TInt aRow,
774 TInt aSubCellIndex) const;
777 * Enables or disables transparency effect i.e. does the listbox draw its
778 * own background or not.
780 * @param aDrawBackground @c EFalse enables transparency, @c ETrue disables.
782 IMPORT_C void SetDrawBackground(const TBool aDrawBackground);
785 * Checks if the list is transparent and drawing the background
786 * that would fall behind it.
788 * @return @c EFalse if transparent, @c ETrue otherwise.
790 TBool IsBackgroundDrawingEnabled() const;
793 * Enables or disables drawing background after scrollbar.
795 * @param aDrawBackground Default is @c ETrue which means that Scrollbar
798 void SetDrawScrollbarBackground(const TBool aDrawBackground);
801 * Is the listbox drawing the background behind the scrollbar or not.
803 * @return @c ETrue if background is drawn after scrollbar, @c EFalse
806 TBool IsScrollbarBackgroundDrawingEnabled() const;
809 * Sets position of listbox separator line.
811 * @param aPosition Position in which separator line is placed.
813 IMPORT_C void SetSeparatorLinePosition(TAknSeparatorLinePosition aPosition);
816 * Gets separator line position.
818 * @return Position of separator line.
820 IMPORT_C TAknSeparatorLinePosition SeparatorLinePosition() const;
826 * Gets layout data needed for separator lines drawing.
828 * @return Layout data.
830 IMPORT_C CAknLayoutData* LayoutData() const;
836 * Gets LayOutInit flag used for drawing separator lines in lists.
839 * @return LayOutInit flag.
841 IMPORT_C TBool LayoutInit() const;
847 * Sets LayOutInit flag used for drawing separator lines in lists.
850 * @param aValue LayOutInit flag value.
852 IMPORT_C void SetLayoutInit(TBool aValue);
855 * Enables or disables underlining per text subcell only if
856 * @c TListItemProperties also has underlining enabled. If this method is
857 * not called and @c TListItemProperties has underlining enabled, drawing
858 * will revert to old style where only first text subcell will be underlined.
861 * @param aUnderlinedCells Bitmask of cells to be underlined.
863 IMPORT_C void SetSubcellUnderlined( TBitFlags32 aUnderlinedCells );
867 * enables certain highlight skinning for
868 * radibutton / checkbox set style lists
870 * should be used only by avkon internally
876 void UseHighlightIconSwapping( TBool aUse );
877 TBool UseHighlightIconSwapping() const;
879 // next methods are only used inside the drawing algorithm.
880 // The set methods are also const because they do not change observable behavior of the system.
881 TSize SubCellRealSize(TInt aSubCellIndex) const;
882 void SetSubCellRealSize(TInt aSubCellIndex, TSize aRealSize) const;
884 TSize SubCellRealTextSize(TInt aSubCellIndex) const;
885 void SetSubCellRealTextSize(TInt aSubCellIndex, TSize aRealSize) const;
891 TInt iSubCell; // Must be first entry
895 const CFont* iBaseFont;
896 TInt iActualFontIndex;
899 TBool iNotAlwaysDrawn;
900 CGraphicsContext::TTextAlign iAlign;
901 CGraphicsContext::TPenStyle iRightSeparatorStyle;
907 TBool iUseSubCellColors; // this is set if someone calls SetSubCellColorsL()
912 // the next ones change during drawing algorithm
913 __MUTABLE TSize iRealSize;
914 __MUTABLE TSize iRealTextSize;
920 * C++ default constructor.
922 IMPORT_C CFormattedCellListBoxData();
925 * Second phase constructor. Highlight animation will be
926 * created by default (if it is provided by the skin).
928 IMPORT_C void ConstructLD();
931 * Second phase constructor for subclasses that want to override highlight
932 * animation creation.
934 * @param aAnimationIID Skin ItemID of the constructed animation. Passing
935 * @c KAknsIIDNone will disable highlight animation.
937 IMPORT_C void ConstructLD(const TAknsItemID& aAnimationIID);
940 * Main drawing algorithm used for drawing S60 list item.
941 * @c Draw() method should call this method after clearing the list item
942 * area and drawing the highlight.
944 * @param aProperties Properties attached to the list item.
945 * @param aGc Graphics Context used for drawing the list item.
946 * @param aText A text string describing the list item cells.
947 * @param aRect The area of the screen for the whole list item.
948 * @param aHighlight Whether the list item is selected.
949 * @param aColors The colors used for drawing the item.
950 * @panic EAknPanicFormattedCellListInvalidBitmapIndex The defined bitmap
952 * @panic EAknPanicOutOfRange The defined index is out of the range.
954 IMPORT_C void DrawFormatted(TListItemProperties aProperties,
959 const TColors& aColors) const;
964 * @param aProperties Properties attached to the list item.
965 * @param aGc Graphics Context used for drawing the list item.
966 * @param aText A text string describing the list item cells.
967 * @param aRect The area of the screen for the whole list item.
968 * @param aHighlight Whether the list item is selected.
969 * @param aColors The colors used for drawing the item.
972 void DrawFormattedSimple( TListItemProperties& aProperties,
977 const TColors& aColors ) const;
982 void DrawFormattedOld( TListItemProperties& aProperties,
985 const TRect& aItemRect,
987 const TColors& aColors ) const;
992 void BitBltColored( CWindowGc& aGc,
994 const CGulIcon* aIcon,
997 const TRect& aGraphicRect ) const;
1002 * Customizes marquee default behavior.
1003 * Use this before enabling marquee ( @c EnableMarqueeL() ), otherwise
1004 * marquee behavior will change during animation.
1007 * @param aLoops Max number of loops to be executed (default 1).
1008 * @param aScrollAmount The amount of pixels scrolled per frame (default 6).
1009 * @param aScrollDelay The delay between each loop
1010 * (in microseconds, default 1000000 microseconds).
1011 * @param aInterval The interval between frame updates after
1012 * the initial delay, in microseconds.
1014 IMPORT_C void SetMarqueeParams(const TInt aLoops,
1015 const TInt aScrollAmount,
1016 const TInt aScrollDelay,
1017 const TInt aInterval);
1023 void SetClippedByWrap( TUint32 aClippedCells, TBool aUseClippedByWrap );
1026 * Tells whether current item has clipped text cells
1028 * @return bitfield of clipped subcells
1030 IMPORT_C TUint32 CurrentItemTextWasClipped() const;
1032 protected: // non-exported!
1035 * Gets list box extension, which is used for adding more funtionality to
1036 * list boxes without destroying compatibility with previous versions.
1038 * @return Pointer to the list box extension.
1040 CFormattedCellListBoxDataExtension* Extension();
1043 * Gets list box extension, which is used for adding more funtionality to
1044 * list boxes without destroying compatibility with previous versions.
1046 * @return Pointer to the list box extension.
1048 CFormattedCellListBoxDataExtension* Extension() const;
1052 * Renders a default animated highlight.
1054 * @param aGc Graphics context used for drawing.
1055 * @param aItemRect the area of the screen for drawing.
1056 * @param aHighlight If @c ETrue highlight is rendered
1057 * if @c EFalse, nothing is done.
1059 void DrawDefaultHighlight(CWindowGc &aGc,
1060 const TRect &aItemRect,
1061 TBool aHighlight) const;
1064 * Renders a settings animated highlight.
1066 * @param aGc Graphics context used for drawing.
1067 * @param aItemRect the area of the screen for drawing.
1068 * @param aHighlight If @c ETrue highlight is rendered
1069 * if @c EFalse, nothing is done.
1071 void DrawSettingHighlight(CWindowGc &aGc,
1072 const TRect &aItemRect,
1073 TBool aHighlight) const;
1076 * Renders a popup animated highlight.
1078 * @param aGc Graphics context used for drawing.
1079 * @param aItemRect the area of the screen for drawing.
1080 * @param aHighlight If @c ETrue highlight is rendered
1081 * if @c EFalse, nothing is done.
1083 void DrawPopupHighlight(CWindowGc &aGc,
1084 const TRect &aItemRect,
1085 TBool aHighlight) const;
1088 * Draws a popup frame.
1090 * @param aGc Graphics context used for drawing.
1092 void DrawPopupFrame(CWindowGc &aGc) const;
1095 * Disables logical-to-visual conversion in subcells between indexes.
1097 * @param aFirstIndex First subcell not to use logical-to-visual conversion.
1098 * @param aSecondIndex Last subcell not to use logical-to-visual conversion.
1100 void SetWordWrappedSubcellIndices( TInt aFirstIndex, TInt aSecondIndex );
1103 * Sets the size of the subcell's icon.
1106 * @param aIndex Subcell to modify.
1107 * @param aSize New size for the icon.
1109 IMPORT_C void SetSubCellIconSize(TInt aIndex, TSize aSize);
1112 * Gets the size of the subcell's icon.
1115 * @param aIndex Subcell to query.
1116 * @return Size of the subcell's icon.
1118 TSize GetSubCellIconSize(TInt aIndex);
1121 * Create and set the defaul skin context. Needed by the dynamic skin support.
1124 * @panic EAknPanicNullPointer Panics if @c iExtension has not been defined.
1126 void SetupSkinContextL();
1129 * Sets a text color if enhanced skin support is available.
1132 * @param aIndex Index Number of text color in @c TAknsQsnTextColorsIndex.
1133 * @see @c TAknsQsnTextColorsIndex.
1135 void SetESSTextColor( TAknsQsnTextColorsIndex aIndex );
1138 * Set a highlighted text color if enhanced skin support is available.
1141 * @param aIndex Index Number of text color in @c TAknsQsnTextColorsIndex.
1142 * @see @c TAknsQsnTextColorsIndex.
1144 void SetESSHighlightedTextColor( TAknsQsnTextColorsIndex aIndex );
1147 * Set window line layout for the defined sub cell.
1150 * @param aSubCell Target cell for which the layout is changed.
1151 * @param aGraphicLayout The new layout.
1153 void SetGraphicSubCellL(TInt aSubCell, const TAknWindowLineLayout& aGraphicLayout);
1156 * Support for new layouts.
1158 * Set text line layout for the defined sub cell.
1161 * @param aSubCell Target cell.
1162 * @param aTextLayout The new layout.
1164 void SetTextSubCellL(TInt aSubCell,const TAknTextLineLayout& aTextLayout);
1168 * Support for new layouts.
1171 * Changes setting of a graphical sub cell which is contained by the
1172 * defined text sub cell.
1174 * @param aSubCell Target text sub cell.
1175 * @param aTextLayout New text layout.
1176 * @param aAffectedSubCell The graphical sub cell affected by the change.
1178 void SetConditionalSubCellL(TInt aSubCell,
1179 const TAknTextLineLayout& aTextLayout,
1180 TInt aAffectedSubCell);
1183 * Checks if the list box uses scalable layouts.
1187 TBool UsesScalableLayoutData() const;
1189 * @internal. Do NOT use.
1191 void UseScalableLayoutData( TBool aUse );
1196 void SetStretchableGraphicSubCellL(TInt aSubCell,
1197 const TAknWindowComponentLayout& aNormalLayout,
1198 const TAknWindowComponentLayout& aStretchedLayout);
1202 void SetStretchableTextSubCellL(TInt aSubCell,
1203 const TAknTextComponentLayout& aNormalLayout,
1204 const TAknTextComponentLayout& aStretchedLayout);
1208 void SetStretchableConditionalSubCellL(TInt aSubCell,
1209 const TAknTextComponentLayout& aNormalLayout,
1210 const TAknTextComponentLayout& aStretchedLayout,
1211 TInt aNormalSubCell,
1212 TInt aStretchedSubCell );
1216 void ResetSLSubCellArray();
1221 void EnableStretching(const TBool aEnabled);
1225 TBool StretchingEnabled() const;
1229 void HideSecondRow(const TBool aHide);
1233 TBool SecondRowHidden() const;
1237 void SubCellsMightIntersect( const TBool aMightIntersect );
1239 // Drop shadows can be toggled on/off in
1240 // "transparent" lists (eg. transparent camera setting page).
1241 // ETrue = on, EFalse = off
1245 void ToggleDropShadows( const TBool aEnable );
1247 // changes tactile feedback behaviour
1248 // ETrue - feedback for any item
1249 // EFalse - feedback for focused item only
1253 void SetFeedbackForAllItems( TBool aFeedbackForAllItems );
1254 // gets tactile feedback behaviour
1255 // ETrue - feedback for any item
1256 // EFalse - feedback for focused item only
1260 TBool FeedbackForAllItems();
1263 * Returns ETrue if kinetic scrolling is enabled.
1266 * @return ETrue if kinetic scrolling feature is enabled.
1268 TBool KineticScrollingEnabled() const;
1271 * Returns instance of CEikListBox.
1274 * @return Instance of CEikListBox.
1276 CEikListBox* ListBox() const;
1280 void DoConstructL( const TAknsItemID& aAnimationIID );
1282 const TColors &Colors(TInt aItemIndex, TInt aSubCell) const;
1283 TInt LastSubCell() const;
1284 void AddSubCellL(TInt aSubCell);
1285 SSubCell& At(TInt aArrayIndex);
1286 const SSubCell& At(TInt aArrayIndex) const;
1287 TInt FindSubCellIndex(TInt& aArrayIndex,TInt aSubCell) const;
1288 void FindSubCellIndexOrAddL(TInt& aArrayIndex,TInt aSubCell);
1289 TInt AddActualFontL(const CFont* aBaseFont);
1290 void SetUnderlineStyle( TListItemProperties aProperties, CWindowGc& aGc, TInt aSubCell ) const;
1291 void CheckIfSubCellsIntersect( TAknTextLineLayout* aLayouts, TBool* aResults, const TDesC& aText, const TRect& aItemRect ) const;
1294 CArrayFix<SSubCell>* iSubCellArray;
1295 CArrayPtr<CGulIcon>* iIconArray;
1296 friend class CFormattedCellListBoxItemDrawer; // this is for "lastsubcell" -access.
1297 TColors defaultcolors;
1298 CFormattedCellListBoxDataExtension *iExtension;
1301 // CLASS DECLARATION
1303 * CSettingItemEditingListBoxData draws list items for setting page
1304 * Special feature of this class is the rectangular style of highlight used in
1309 class CSettingItemEditingListBoxData : public CFormattedCellListBoxData
1312 IMPORT_C static CSettingItemEditingListBoxData* NewL();
1313 IMPORT_C virtual void Draw(TListItemProperties aProperties,
1318 const TColors& aColors) const;
1321 // CLASS DECLARATION
1323 * CSettingItemEditingListBoxData draws list items for form popup fields
1324 * Special feature of this class is the rectangular style of highlight used in
1329 class CFormGraphicListBoxData : public CFormattedCellListBoxData
1332 IMPORT_C static CFormGraphicListBoxData* NewL();
1333 IMPORT_C virtual void Draw(TListItemProperties aProperties,
1338 const TColors& aColors) const;
1342 // CLASS DECLARATION
1344 * CPopupFormattedListBoxData draws list items for popup windows
1345 * Special feature of this class is the narrower style of highlight used in
1350 class CPopupFormattedListBoxData : public CFormattedCellListBoxData
1353 IMPORT_C static CPopupFormattedListBoxData* NewL();
1354 IMPORT_C virtual void Draw(TListItemProperties aProperties,
1359 const TColors& aColors) const;
1363 * CPopupFormattedListBoxData draws list items for grids.
1364 * Special feature of this class is the rectangular highlight used in grids.
1368 class CFormattedCellGridData : public CFormattedCellListBoxData
1374 * Symbian two-phase constructor.
1376 IMPORT_C static CFormattedCellGridData* NewL();
1379 * From @c CFormattedCellListBoxData.
1381 * This is the only method that needs to be implemented in this class and
1382 * it draws the whole list item.
1384 * @param aProperties Properties attached to the list item.
1385 * @param aGc Graphics Context used for drawing the list item.
1386 * @param aText A text string describing the list item cells.
1387 * @param aRect The area of the screen for the whole list item.
1388 * @param aHighlight Whether the list item is selected.
1389 * @param aColors The colors used for drawing the item.
1391 IMPORT_C virtual void Draw(TListItemProperties aProperties,
1396 const TColors& aColors) const;
1399 #endif // __EIKFRLBD_H__