epoc32/include/mw/eikclbd.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/mw/eikclbd.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,893 @@
     1.4 +/*
     1.5 +* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +#if !defined(__EIKCLBD_H__)
    1.22 +#define __EIKCLBD_H__
    1.23 +
    1.24 +#include <e32base.h>
    1.25 +#include <gdi.h>
    1.26 +
    1.27 +#include <eiklbd.h>
    1.28 +#include <avkon.hrh>
    1.29 +#include <babitflags.h>    // for TBitFlags32
    1.30 +
    1.31 +class CWindowGc;
    1.32 +class CGulIcon;
    1.33 +class CColumnListBoxDataExtension;
    1.34 +class MAknsControlContext;
    1.35 +class CCoeControl;
    1.36 +class TAknsItemID;
    1.37 +class CAknsEffectAnim;
    1.38 +class CAknsListBoxBackgroundControlContext;
    1.39 +class CAknLayoutData;
    1.40 +class TAknWindowLineLayout;
    1.41 +class TAknTextLineLayout;
    1.42 +class TAknWindowComponentLayout;
    1.43 +class TAknTextComponentLayout;
    1.44 +class MAknsSkinInstance;
    1.45 +
    1.46 +/**
    1.47 +* A callback interface for overriding highlight animation input layer
    1.48 +* preparation in derived classes. Usually drawing the background under the
    1.49 +* highlight rect will yield the right kind of result. The size of the render
    1.50 +* target is equal to item cell size.
    1.51 +*
    1.52 +* @since 3.0
    1.53 +*/
    1.54 +class MColumnListBoxAnimBackgroundDrawer
    1.55 +    {
    1.56 +    public:
    1.57 +
    1.58 +        /**
    1.59 +         * Draws the background under the current highlight.
    1.60 +         *
    1.61 +         * Should be implemented in the derived class .
    1.62 +         *
    1.63 +         * @param aGc bitmapped graphics context to be drawn.
    1.64 +         * @return @c ETrue if Succeeded.
    1.65 +         */
    1.66 +        virtual TBool DrawHighlightAnimBackground( CFbsBitGc& aGc ) const = 0;
    1.67 +    };
    1.68 +
    1.69 +/**
    1.70 + * The @c CColumnListBoxData class handles the data required to draw a column 
    1.71 + * list box.
    1.72 + *
    1.73 + * The class performs drawing for @c CColumnListBoxItemDrawer. Columns are 
    1.74 + * numbered from 0 from left to right, and extra column data can be set 
    1.75 + * for each.
    1.76 + *
    1.77 + * N.B.: The standard width of a column drawn by @c CColumnListListBoxData is  
    1.78 + * 0 pixels, so at the very least a column width should be set for each column 
    1.79 + * in a column list box.    
    1.80 + *
    1.81 + * This class is not intended for user derivation. 
    1.82 + */
    1.83 +class CColumnListBoxData : public CListBoxData
    1.84 +    {
    1.85 +    friend class CColumnListBoxDataExtension;
    1.86 +public:
    1.87 +
    1.88 +    /**
    1.89 +     * Represents the colours used within the border and for the optional 
    1.90 +     * single pixel border outlines.
    1.91 +     *
    1.92 +     * These colours are stored using @c TRgb values.
    1.93 +     */
    1.94 +    class TColors
    1.95 +        {
    1.96 +    public:
    1.97 +
    1.98 +        /**
    1.99 +         * C++ default constructor.
   1.100 +         */
   1.101 +        IMPORT_C TColors();
   1.102 +    public:
   1.103 +
   1.104 +        /**
   1.105 +         * Stores text Color.
   1.106 +         */
   1.107 +        TRgb iText;
   1.108 +
   1.109 +        /**
   1.110 +         * Stores background color.
   1.111 +         */
   1.112 +        TRgb iBack;
   1.113 +
   1.114 +        /**
   1.115 +         * Stores highLighted text color.
   1.116 +         */ 
   1.117 +        TRgb iHighlightedText;
   1.118 +
   1.119 +        /**
   1.120 +         * Stores highlighted background colour.
   1.121 +         */
   1.122 +        TRgb iHighlightedBack;
   1.123 +        };
   1.124 +
   1.125 +public:
   1.126 +
   1.127 +    /**
   1.128 +     * Two-phased constructor.
   1.129 +     *
   1.130 +     * Allocates and constructs a column list box data object.
   1.131 +     *
   1.132 +     * Constructs an array in which the column data is held.
   1.133 +     *
   1.134 +     * @return New @c CColumnListBoxData.
   1.135 +     */
   1.136 +    IMPORT_C static CColumnListBoxData* NewL();
   1.137 +    
   1.138 +    /**
   1.139 +     * Destructor.
   1.140 +     */
   1.141 +    IMPORT_C ~CColumnListBoxData();
   1.142 +
   1.143 +public:
   1.144 +
   1.145 +    /**
   1.146 +     * Gets the index of the last defined column.
   1.147 +     *
   1.148 +     * @return The index of the last defined column or @c KErrNotFound if no 
   1.149 +     *         column has been defined.
   1.150 +     */
   1.151 +    IMPORT_C TInt LastColumn() const;
   1.152 +    
   1.153 +    /**
   1.154 +     * Gets the specified column’s width in pixels.
   1.155 +     *
   1.156 +     * @param aColumn The index of the column for which the width is obtained.
   1.157 +     * @return The specified column’s width in pixels. Zero is returned if no 
   1.158 +     *         column exists at the specified index.
   1.159 +     */
   1.160 +    IMPORT_C TInt ColumnWidthPixel(TInt aColumn) const;
   1.161 +
   1.162 +    /**
   1.163 +     * Sets the specified column’s width in pixels.
   1.164 +     * 
   1.165 +     * If the column does not exist, one is added at the specified index, 
   1.166 +     * with the specifed width.
   1.167 +     *
   1.168 +     * @param aColumn The index of the column for which the width is to be set.
   1.169 +     * @param aWidth The width in pixels.
   1.170 +     */
   1.171 +    IMPORT_C void SetColumnWidthPixelL(TInt aColumn,TInt aWidth);
   1.172 +    
   1.173 +    /**
   1.174 +    * Not used in S60.
   1.175 +    */
   1.176 +    IMPORT_C TInt ColumnHorizontalGap(TInt aColumn) const;
   1.177 +
   1.178 +    /**
   1.179 +    * Not used in S60.
   1.180 +    */
   1.181 +    IMPORT_C void SetColumnHorizontalGapL(TInt aColumn,TInt aGap);
   1.182 +
   1.183 +    /**
   1.184 +     * Gets column's baseline.
   1.185 +     *
   1.186 +     * @param aColumn target column.
   1.187 +     * @return Vertical position.
   1.188 +     */
   1.189 +    IMPORT_C TInt ColumnBaselinePos(TInt aColumn) const;
   1.190 +
   1.191 +    /**
   1.192 +     * Sets columns baseline position.
   1.193 +     *
   1.194 +     * @param aColumn Target column.
   1.195 +     * @param aPos Wanted position.
   1.196 +     */
   1.197 +    IMPORT_C void SetColumnBaselinePosL(TInt aColumn,TInt aPos);
   1.198 +
   1.199 +    /**
   1.200 +     * Gets column's margins.
   1.201 +     *
   1.202 +     * @param aColumn Target column.
   1.203 +     * @return The columns margins.
   1.204 +     */
   1.205 +    IMPORT_C TMargins ColumnMargins(TInt aColumn) const;
   1.206 +    
   1.207 +    /**
   1.208 +     * Sets column's margins.
   1.209 +     *
   1.210 +     * @param aColumn Target column.
   1.211 +     * @param aMargins Wanted margins.
   1.212 +     */
   1.213 +    IMPORT_C void SetColumnMarginsL(TInt aColumn,TMargins aMargins);
   1.214 +    
   1.215 +    /**
   1.216 +     * Gets font used by the column.
   1.217 +     *
   1.218 +     * @param aColumn Target column.
   1.219 +     * @return Used font.
   1.220 +     */
   1.221 +    IMPORT_C const CFont* ColumnFont(TInt aColumn) const;
   1.222 +
   1.223 +    /**
   1.224 +     * Sets column's font.
   1.225 +     *
   1.226 +     * @param aColumn Target column.
   1.227 +     * @param aFont Wanted font.
   1.228 +     */
   1.229 +    IMPORT_C void SetColumnFontL(TInt aColumn,const CFont* aFont);
   1.230 +
   1.231 +    /**
   1.232 +     * Gets the text alignment for the specified column.
   1.233 +     *
   1.234 +     * @param  aColumn The index of the column for which the alignment 
   1.235 +     *         is obtained.
   1.236 +     * @return The text alignment for the specified column. The default 
   1.237 +     *         is @c ELeft.
   1.238 +     */
   1.239 +    IMPORT_C CGraphicsContext::TTextAlign ColumnAlignment(TInt aColumn) const;
   1.240 +    
   1.241 +    /**
   1.242 +     * Sets the text alignment for the specified column.
   1.243 +     *
   1.244 +     * If the column does not exist, it is added with the specified index 
   1.245 +     * to the array.
   1.246 +     *
   1.247 +     * @param aColumn The index of the column for which alignment is set.
   1.248 +     * @param aAlign The text alignment to use. The default is @c ELeft.
   1.249 +     */
   1.250 +    IMPORT_C void SetColumnAlignmentL(TInt aColumn,
   1.251 +                                      CGraphicsContext::TTextAlign aAlign);
   1.252 +
   1.253 +    /**
   1.254 +    * Not used in S60.
   1.255 +    */
   1.256 +    IMPORT_C CGraphicsContext::TPenStyle ColumnSeparatorStyle(
   1.257 +                                                        TInt aColumn) const;
   1.258 +    /**
   1.259 +    * Not used in S60.
   1.260 +    */
   1.261 +    IMPORT_C void SetColumnSeparatorStyleL(TInt aColumn, 
   1.262 +                                           CGraphicsContext::TPenStyle aStyle);
   1.263 +
   1.264 +    /**
   1.265 +     * Checks whether the column is optional.
   1.266 +     *
   1.267 +     * @param aColumn Target column.
   1.268 +     * @return @c ETrue if the column is optional.
   1.269 +     */
   1.270 +    IMPORT_C TBool ColumnIsOptional(TInt aColumn) const;
   1.271 +    
   1.272 +    /**
   1.273 +     * Sets whether the column is optional.
   1.274 +     *
   1.275 +     * @param aColumn Target column.
   1.276 +     * @param aIsOptional Wanted setting, @c ETrue if column is optional.
   1.277 +     */
   1.278 +    IMPORT_C void SetOptionalColumnL(TInt aColumn,TBool aIsOptional);
   1.279 +
   1.280 +    /**
   1.281 +     * Checks whether the column contains graphics.
   1.282 +     *
   1.283 +     * @param aColumn Target column.
   1.284 +     * @return @c ETrue if column contains graphics.
   1.285 +     */
   1.286 +    IMPORT_C TBool ColumnIsGraphics(TInt aColumn) const;
   1.287 +
   1.288 +    /**
   1.289 +     * Sets whether the column shows graphics.
   1.290 +     *
   1.291 +     * @param aColumn Target column.
   1.292 +     * @param aIsGraphics Wanted setting.
   1.293 +     */
   1.294 +    IMPORT_C void SetGraphicsColumnL(TInt aColumn,TBool aIsGraphics);
   1.295 +
   1.296 +    /**
   1.297 +     * Checks if the column is a number.
   1.298 +     *
   1.299 +     * @param aColumn Target column.
   1.300 +     * @return @c ETrue if it is a number.
   1.301 +     */
   1.302 +    IMPORT_C TBool ColumnIsNumber(TInt aColumn) const;
   1.303 +
   1.304 +    /**
   1.305 +     * Sets whether the column is a number. 
   1.306 +     *
   1.307 +     * @param aColumn Target columun.
   1.308 +     * @param aIsNumber Wanted setting. @c ETrue if it is a number.
   1.309 +     */
   1.310 +    IMPORT_C void SetNumberColumnL(TInt aColumn,TBool aIsNumber);
   1.311 +
   1.312 +    /**
   1.313 +     * Gets the icon array. 
   1.314 +     *
   1.315 +     * These icons contain the bitmaps that are displayed in graphical columns.
   1.316 +     *
   1.317 +     * @return Pointer to the icon array.
   1.318 +     */
   1.319 +    IMPORT_C CArrayPtr<CGulIcon>* IconArray() const;
   1.320 +
   1.321 +    /**
   1.322 +     * Sets icon array.
   1.323 +     *
   1.324 +     * @param aArray Wanted icon collection .
   1.325 +     */
   1.326 +    IMPORT_C void SetIconArray(CArrayPtr<CGulIcon>* aArray);
   1.327 +
   1.328 +    /**
   1.329 +     * Gets TextClipGap, the gap between words in a text clip, for the 
   1.330 +     * given column.
   1.331 +     *
   1.332 +     * @param aSubCellIndex Index to target column.
   1.333 +     * @return TextClipGap.
   1.334 +     */
   1.335 +    IMPORT_C TInt ColumnTextClipGap(TInt aSubCellIndex) const;
   1.336 +    
   1.337 +    /**
   1.338 +     * Sets columns TextClipGap, the gap between words in a text clip.
   1.339 +     *
   1.340 +     * @param aSubCellIndex Index of the target column.
   1.341 +     * @param aSize Wanted TextClipGap size. 
   1.342 +     */
   1.343 +    IMPORT_C void SetColumnTextClipGapL(TInt aSubCellIndex, TInt aSize);
   1.344 +    
   1.345 +    /**
   1.346 +     * Gets the specified font for the specified column.
   1.347 +     *
   1.348 +     * @param aItemProperties Whether the required font is:
   1.349 +     *        bold, italic, bold and italic or normal.
   1.350 +     * @param aColumn The index of the column for which the font is obtained.
   1.351 +     * @return The specified column’s, specified font. Null, the 
   1.352 +     *         default, if no font is set for the column.
   1.353 +     */
   1.354 +    IMPORT_C CFont* Font(const TListItemProperties& aItemProperties, 
   1.355 +                         TInt aColumn) const;
   1.356 +
   1.357 +    /**
   1.358 +     * Gets the specified column’s surrounding rectangle.
   1.359 +     *
   1.360 +     * @param aColumn The index of the column for which the rectangle 
   1.361 +     *                is obtained.
   1.362 +     * @param aRect On return contains the specified column’s rectangle.
   1.363 +     * @return @c ETrue if successful. @c EFalse if a non-existent column 
   1.364 +     *               was specified.
   1.365 +     */
   1.366 +    IMPORT_C TBool MakeColumnRect( TInt aColumn, TRect& aRect );
   1.367 +
   1.368 +    /**
   1.369 +     * Draws a single row.
   1.370 +     *
   1.371 +     * The text @c aText is parsed into columns and is split using 
   1.372 +     * @c KColumnListSeparator. Text or bitmaps are drawn according to whether 
   1.373 +     * the column has been set as a graphical column 
   1.374 +     * (see @c SetGraphicsColumnL()). Column cells within the row are drawn 
   1.375 +     * from left to right.
   1.376 +     *
   1.377 +     * @param aItemProperties The properties of each column in the row.
   1.378 +     * @param aGc The graphics context to draw into.
   1.379 +     * @param aText The text to parse and draw.
   1.380 +     * @param aRect Bounding rectangle for the entire row.
   1.381 +     * @param aHighlight @c ETrue to draw the item highlighted. 
   1.382 +     *        @c EFalse otherwise.
   1.383 +     * @param aColors The colours to use if the item is highlighted.
   1.384 +     */
   1.385 +    IMPORT_C virtual void Draw(const TListItemProperties& aItemProperties, 
   1.386 +                               CWindowGc& aGc,
   1.387 +                               const TDesC* aText,
   1.388 +                               const TRect& aRect,
   1.389 +                               TBool aHighlight,
   1.390 +                               const TColors& aColors) const;
   1.391 +                               
   1.392 +    /**
   1.393 +    * internal
   1.394 +    */
   1.395 +    void DrawSimple(const TListItemProperties& aItemProperties, CWindowGc& aGc,const TDesC* aText,const TRect& aRect,TBool aHighlight,const TColors& aColors) const;
   1.396 +    /**
   1.397 +     * Sets position of listbox line.
   1.398 +     *
   1.399 +     * @param aPosition Wanted position.
   1.400 +     */
   1.401 +    IMPORT_C void SetSeparatorLinePosition(
   1.402 +                                        TAknSeparatorLinePosition aPosition);
   1.403 +
   1.404 +    /**
   1.405 +     * Gives out separator line position.
   1.406 +     *
   1.407 +     * @return Separator position.
   1.408 +     */
   1.409 +    IMPORT_C TAknSeparatorLinePosition SeparatorLinePosition() const;
   1.410 +
   1.411 +    /**
   1.412 +     * 
   1.413 +     * @deprecated
   1.414 +     *
   1.415 +     * Gives out layout data for separator line drawing.
   1.416 +     *
   1.417 +     * @return Requested layout data.
   1.418 +     */
   1.419 +    IMPORT_C CAknLayoutData *LayoutData() const;
   1.420 +    
   1.421 +    /**
   1.422 +     * 
   1.423 +     * @deprecated
   1.424 +     *
   1.425 +     * Checks if the layout has been initialized.
   1.426 +     *
   1.427 +     * @return @c ETrue if initialized.
   1.428 +     */
   1.429 +    IMPORT_C TBool LayoutInit() const;
   1.430 +    
   1.431 +    /**
   1.432 +     * 
   1.433 +     * @deprecated
   1.434 +     *
   1.435 +     * Sets the initialization .
   1.436 +     *
   1.437 +     * @param aValue Wanted value (@c ETrue = initialized).
   1.438 +     */
   1.439 +    IMPORT_C void SetLayoutInit(TBool aValue) const;
   1.440 +
   1.441 +    /**
   1.442 +     * Enables / disables underlining per text column,
   1.443 +     * if and only if @c TListItemProperties also has underlining enabled.
   1.444 +     * If this method is not called and @c TListItemProperties has underlining
   1.445 +     * enabled, drawing will revert to old style where only first text column
   1.446 +     * will be underlined.
   1.447 +     *
   1.448 +     * @since S60 3.0
   1.449 +     * @param aUnderlinedColumns Bitmask of columns to be underlined.
   1.450 +     */    
   1.451 +    IMPORT_C void SetColumnUnderlined( TBitFlags32 aUnderlinedColumns );
   1.452 +
   1.453 +private:
   1.454 +    struct SColumn
   1.455 +        {
   1.456 +        TInt iColumn; // Must be first entry
   1.457 +        TInt iWidth;
   1.458 +        TMargins iMargins;
   1.459 +        TInt iVerticalCap;
   1.460 +        const CFont* iBaseFont;
   1.461 +        TInt iActualFontIndex;
   1.462 +        TBool iGraphics;
   1.463 +    TBool iOptional;
   1.464 +    TInt iBaseline;
   1.465 +        CGraphicsContext::TTextAlign iAlign;
   1.466 +    CGraphicsContext::TPenStyle iSeparator;
   1.467 +    TInt iTextClipGap;
   1.468 +    TBool iNumberColumn;
   1.469 +    // the next are for storing x-coordinates of a column for the drawing algorithm.
   1.470 +    __MUTABLE TInt iX;
   1.471 +    __MUTABLE TInt iEndX;
   1.472 +        };
   1.473 +protected:
   1.474 +
   1.475 +    /**
   1.476 +     * C++ default constructor.
   1.477 +     */
   1.478 +    IMPORT_C CColumnListBoxData();
   1.479 +
   1.480 +    /**
   1.481 +     * A second phase constructor. 
   1.482 +     *
   1.483 +     * Highlight animation will be created by default (if it is provided 
   1.484 +     * by the skin).
   1.485 +     */
   1.486 +    IMPORT_C void ConstructLD();
   1.487 +
   1.488 +    /**
   1.489 +     * Second phase constructor for subclasses that want to override highlight
   1.490 +     * animation creation.
   1.491 +     *
   1.492 +     * @since 3.0
   1.493 +     * @param aAnimationIID Skin item identifier of the constructed animation. 
   1.494 +     *        Passing @c KAknsIIDNone will disable highlight animation.
   1.495 +     */
   1.496 +    IMPORT_C void ConstructLD( const TAknsItemID& aAnimationIID );
   1.497 +
   1.498 +private:
   1.499 +    
   1.500 +    IMPORT_C TInt ColumnX(TInt aColumn) const;
   1.501 +    IMPORT_C void SetColumnXL(TInt aColumn,TInt aX) const; // note, const! (do not affect external state)
   1.502 +    //
   1.503 +    IMPORT_C TInt ColumnEndX(TInt aColumn) const;
   1.504 +    IMPORT_C void SetColumnEndXL(TInt aColumn,TInt aEndX) const; // note, Const!
   1.505 +
   1.506 +    void AddColumnL(TInt aColumn);
   1.507 +    SColumn& At(TInt aArrayIndex);
   1.508 +    const SColumn& At(TInt aArrayIndex) const;
   1.509 +    TBool FindColumnIndex(TInt& aArrayIndex,TInt aColumn) const;
   1.510 +    void FindColumnIndexOrAddL(TInt& aArrayIndex,TInt aColumn);
   1.511 +    TInt AddActualFontL(const CFont* aBaseFont);
   1.512 +    void SetUnderlineStyle( TListItemProperties aProperties, CWindowGc& aGc, TInt aColumn ) const;
   1.513 +    void DoConstructL( const TAknsItemID& aAnimationIID );
   1.514 +public:
   1.515 +
   1.516 +    /**
   1.517 +     * Gets @c CCoeControl for component.
   1.518 +     *
   1.519 +     * @return Pointer to the used @c CCoeControl.
   1.520 +     */
   1.521 +    IMPORT_C CCoeControl *Control() const;
   1.522 +    
   1.523 +    /**
   1.524 +     * Sets @c CCoeControl for current component.
   1.525 +     *
   1.526 +     * @param aControl Current listbox control instance, cannot be any 
   1.527 +     *        other control.
   1.528 +     */
   1.529 +    IMPORT_C void SetControl(CCoeControl *aControl);
   1.530 +    
   1.531 +    /**
   1.532 +     * Gets background skin context.
   1.533 +     *
   1.534 +     * @return Component's skin control context.
   1.535 +     */
   1.536 +    IMPORT_C MAknsControlContext* SkinBackgroundContext() const;
   1.537 +    
   1.538 +    /**
   1.539 +     * Sets background skin context. Changes ownership as well.
   1.540 +     *
   1.541 +     * @param aContext Wanted background skin control context.
   1.542 +     */
   1.543 +    void SetSkinBackgroundContext(
   1.544 +                    CAknsListBoxBackgroundControlContext *aContext); 
   1.545 +                    // takes ownership
   1.546 +    
   1.547 +    /**
   1.548 +     * Sets style for the skin fot list tiles.
   1.549 +     *
   1.550 +     * @param aId Wanted skins item ID.
   1.551 +     * @param aTileRect Skin tile size. 
   1.552 +     */
   1.553 +    IMPORT_C void SetSkinStyle(const TAknsItemID *aId, 
   1.554 +                               const TRect &aTileRect);
   1.555 +
   1.556 +    /**
   1.557 +     * Sets skin style for the end of the list. 
   1.558 +     *
   1.559 +     * @param aId Wanted skins item ID. 
   1.560 +     * @param aRect Skin tile size. 
   1.561 +     */
   1.562 +    IMPORT_C void SetListEndSkinStyle(const TAknsItemID *aId, 
   1.563 +                                      const TRect &aRect);
   1.564 +
   1.565 +    /**
   1.566 +     * Sets skin for the highlighted frame.
   1.567 +     *
   1.568 +     * @param aFrameId Wanted skin's item ID for the frame.
   1.569 +     * @param aFrameCenterId Wanted skin's item ID for the center of the frame.
   1.570 +     */
   1.571 +    IMPORT_C void SetSkinHighlightFrame(const TAknsItemID *aFrameId, 
   1.572 +                                        const TAknsItemID *aFrameCenterId);
   1.573 +
   1.574 +    /**
   1.575 +     * Enables/Disables skin.
   1.576 +     *
   1.577 +     * @param aEnabled Sets whether the skins are enable or disabled
   1.578 +     *                 @c ETrue for enabling skins.
   1.579 +     */
   1.580 +    IMPORT_C void SetSkinEnabledL(TBool aEnabled);
   1.581 +    
   1.582 +    /**
   1.583 +     * Creates a pictograph interface for the @c CColumnListBoxData.
   1.584 +     */
   1.585 +    void CreatePictographInterfaceL();
   1.586 +
   1.587 +    /**
   1.588 +     * Creates a marquee control for the @c CColumnListBoxData and redraw.
   1.589 +     */
   1.590 +    void CreateMarqueeControlL();
   1.591 +    
   1.592 +    /**
   1.593 +     * Resets marquee control. 
   1.594 +     */
   1.595 +    void ResetMarquee();
   1.596 +    
   1.597 +    /**
   1.598 +     * Gets current marquee item index.
   1.599 +     *
   1.600 +     * @return Current marquee item index.
   1.601 +     */
   1.602 +    TInt CurrentMarqueeItemIndex();
   1.603 +    
   1.604 +    /**
   1.605 +     * Sets the index for current marquee item.
   1.606 +     *
   1.607 +     * @param aIndex Item index.
   1.608 +     */
   1.609 +    void SetCurrentMarqueeItemIndex(TInt aIndex);
   1.610 +    
   1.611 +    /**
   1.612 +     * Enables or disables the marquee. 
   1.613 +     *
   1.614 +     * @param aEnable @c ETrue = On. @c EFalse = Off.
   1.615 +     */
   1.616 +    IMPORT_C void EnableMarqueeL(TBool aEnable); 
   1.617 +
   1.618 +    /**
   1.619 +     * Sets the font attached to the cell for each row separately.
   1.620 +     *
   1.621 +     * @param aRow Index number of the row.
   1.622 +     * @param aColumn Index number of the column.
   1.623 +     * @param aFont Font to be used.
   1.624 +     */
   1.625 +    IMPORT_C void SetColumnFontForRowL(TInt aRow, 
   1.626 +                                       TInt aColumn, 
   1.627 +                                       const CFont* aFont);
   1.628 +
   1.629 +    /**
   1.630 +     * Gets the font attached to the row and cell.
   1.631 +     *
   1.632 +     * @param aRow Index number of the row.
   1.633 +     * @param aColumn Index number of the column.
   1.634 +     * @return Font handle.
   1.635 +     */
   1.636 +    IMPORT_C const CFont* RowAndColumnFont(TInt aRow,TInt aColumn) const;
   1.637 +
   1.638 +    /**
   1.639 +     * Sets the current list item index. Since S60 2.6 causes highlight 
   1.640 +     * animation tochange its background (only if the current item index 
   1.641 +     * changes). Do not call this method if the index is not the current 
   1.642 +     * item index.
   1.643 +     *
   1.644 +     * @since S60 2.6
   1.645 +     * @param aIndex The new index for the current item.
   1.646 +     */
   1.647 +    void SetCurrentItemIndex(TInt aIndex);
   1.648 +
   1.649 +    /**
   1.650 +     * Sets the subcell icon size.
   1.651 +     *
   1.652 +     * @since S60 2.8
   1.653 +     * @param aIndex Index of the sub cell. 
   1.654 +     * @param aSize Size of the sub cell icon.
   1.655 +     */
   1.656 +    IMPORT_C void SetSubCellIconSize(TInt aIndex, TSize aSize);
   1.657 +
   1.658 +    /**
   1.659 +     * Gets subcell icon size.
   1.660 +     *
   1.661 +     * @param aIndex Index of the wanted subcell.
   1.662 +     * @return Size of the subcell.
   1.663 +     */
   1.664 +    TSize GetSubCellIconSize(TInt aIndex);
   1.665 +
   1.666 +    /**
   1.667 +     * Gets the highlight animation .
   1.668 +     *
   1.669 +     * @since S60 3.0
   1.670 +     * @return @c CAknsEffectAnim that is used for when the highlighted list 
   1.671 +     *         is drawn. May return NULL, in this case the normal skinned
   1.672 +     *         highlight should be drawn. This pointer is valid only during  
   1.673 +     *         the draw -> you should not store it locally outside draw scope.
   1.674 +     */
   1.675 +    IMPORT_C const CAknsEffectAnim* HighlightAnim() const;
   1.676 +    
   1.677 +    /**
   1.678 +     * This method should be called before drawing animated highlight. It will
   1.679 +     * sync the animation with the background under the current highlight (only
   1.680 +     * when current item index has changed).
   1.681 +     *
   1.682 +     * @since S60 3.0
   1.683 +     */
   1.684 +    IMPORT_C void AboutToDrawHighlightAnim() const;
   1.685 +    
   1.686 +    /**
   1.687 +     * Sets the observer for overriding default highlight input layer drawing
   1.688 +     * functionality. Note that you should still call 
   1.689 +     * @c AboutToDrawHighlightAnim (it will call the observer if it is set).
   1.690 +     *
   1.691 +     * @since S60 3.0
   1.692 +     * @param aDrawer New background drawer.
   1.693 +     */
   1.694 +    IMPORT_C void SetHighlightAnimBackgroundDrawer( 
   1.695 +                                MColumnListBoxAnimBackgroundDrawer* aDrawer );
   1.696 +
   1.697 +    /**
   1.698 +     * Changes item cell size & resizes highlight animation. Called by list 
   1.699 +     * when item cell size changes. If you are using non-standard highlight 
   1.700 +     * sizes make sure to sync the list item cell size.
   1.701 +     *
   1.702 +     * @since S60 3.0
   1.703 +     * @param aSizeInPixels New size in pixels for the Item cell.
   1.704 +     */
   1.705 +    IMPORT_C void SetItemCellSize( const TSize& aSizeInPixels );
   1.706 +    
   1.707 +    /**
   1.708 +    * @return ETrue if highlight animation exists, EFalse otherwise.
   1.709 +    *
   1.710 +    * @since 3.1
   1.711 +    */
   1.712 +    IMPORT_C TBool HasHighlightAnim() const;
   1.713 +    /**
   1.714 +    * The preferred method for drawing highlight animation in derived classes.
   1.715 +    * Before calling this method you should check that highlight animation
   1.716 +    * exists by calling HasHighlightAnim. In case of draw failure you should
   1.717 +    * default to normal skinned highlight drawing. For example:
   1.718 +    *
   1.719 +    * TBool drawOk = EFalse;
   1.720 +    *
   1.721 +    * if( HasHighlightAnim() )
   1.722 +    *     {
   1.723 +    *     drawOk = DrawHighlightAnim( gc, rect );
   1.724 +    *     }
   1.725 +    *
   1.726 +    * if( !drawOk )
   1.727 +    *     {
   1.728 +    *     ...do normal skinned draw
   1.729 +    *     }
   1.730 +    *
   1.731 +    * @param aGc   Graphics context for blitting animation frame
   1.732 +    * @param aRect Target rect for blitting animation frame
   1.733 +    * @return The draw status, ETrue if drawing was ok, EFalse otherwise.
   1.734 +    *
   1.735 +    * @since 3.1
   1.736 +    */
   1.737 +    IMPORT_C TBool DrawHighlightAnim( CBitmapContext& aGc, const TRect& aRect ) const;
   1.738 +
   1.739 +    void FocusGained();
   1.740 +    
   1.741 +    /**
   1.742 +     * Called when the @c CColumnListBoxData is unselected. Informs the 
   1.743 +     * @c CColumnListBoxData extension that the focus has been lost.
   1.744 +     */
   1.745 +    void FocusLost();
   1.746 +    
   1.747 +    /**
   1.748 +     * Handles changing of an resource. Only supports skin change.
   1.749 +     *
   1.750 +     * @param aType Defines the resource that has changed. 
   1.751 +     */
   1.752 +    void HandleResourceChange( TInt aType );
   1.753 +    
   1.754 +    /**
   1.755 +     * Setup skin control context for handling background skins.
   1.756 +     * if no skin control context is found one is created.
   1.757 +     */
   1.758 +    void SetupSkinContextL();
   1.759 +    
   1.760 +    /**
   1.761 +     * Sets text colour. 
   1.762 +     *
   1.763 +     * @param aTextColor Wanted colour.
   1.764 +     */
   1.765 +    void SetESSTextColor(TRgb aTextColor);
   1.766 +    
   1.767 +    /**
   1.768 +     * Sets text colour for highlighted text.
   1.769 +     *
   1.770 +     * @param aHighlightedTextColor Wanted colour.
   1.771 +     */
   1.772 +    void SetESSHighlightedTextColor(TRgb aHighlightedTextColor);
   1.773 +
   1.774 +    IMPORT_C void SetGraphicSubCellL(TInt aSubCell,const TAknWindowLineLayout &aGraphicLayout);
   1.775 +    IMPORT_C void SetTextSubCellL(TInt aSubCell,const TAknTextLineLayout &aTextLayout);
   1.776 +    IMPORT_C void SetConditionalSubCellL(TInt aSubCell, const TAknTextLineLayout &aTextLayout,TInt aAffectedSubCell);
   1.777 +    IMPORT_C void SubCellsMightIntersect( const TBool aMightIntersect );
   1.778 +
   1.779 +    IMPORT_C void SetStretchableGraphicSubCellL(TInt aSubCell, 
   1.780 +        const TAknWindowComponentLayout& aNormalLayout, 
   1.781 +        const TAknWindowComponentLayout& aStretchedLayout);
   1.782 +    IMPORT_C void SetStretchableTextSubCellL(TInt aSubCell,                                      
   1.783 +        const TAknTextComponentLayout& aNormalLayout, 
   1.784 +        const TAknTextComponentLayout& aStretchedLayout);
   1.785 +    IMPORT_C void SetStretchableConditionalSubCellL(TInt aSubCell,
   1.786 +        const TAknTextComponentLayout& aNormalLayout,
   1.787 +        const TAknTextComponentLayout& aStretchedLayout,
   1.788 +        TInt aNormalSubCell,
   1.789 +        TInt aStretchedSubCell );
   1.790 +    IMPORT_C void ResetSLSubCellArray();                                           
   1.791 +    TBool UsesScalableLayoutData() const;
   1.792 +    void EnableStretching(const TBool aEnabled);
   1.793 +    IMPORT_C TBool StretchingEnabled() const;
   1.794 +protected:
   1.795 +    
   1.796 +    /**
   1.797 +     * Wraps the text drawing functinality with & without marquee into one 
   1.798 +     * function, so that inherited classes can modify their own drawing 
   1.799 +     * behaviour more easily.
   1.800 +     *
   1.801 +     * @since S60 2.8
   1.802 +     * @param aGc Window graphics context controller.
   1.803 +     * @param aTextRect The area where the text is drawn.
   1.804 +     * @param aText The whole text. Not clipped.
   1.805 +     * @param aClippedText Clipped / truncated text.
   1.806 +     * @param aBaselineOffset An offset from the top of the box to the text 
   1.807 +     *        baseline.
   1.808 +     * @param aAlign The text alignment mode (default is left, rather 
   1.809 +     *        than centre or right). 
   1.810 +     * @param aFont Wanted font.
   1.811 +     * @param aHighlight Does the current item have highlight.
   1.812 +     * @param aIsTextClipped Is the current item clipped.
   1.813 +     */
   1.814 +    IMPORT_C void DrawText(CWindowGc& aGc, 
   1.815 +                           const TRect& aTextRect, 
   1.816 +                           const TDesC& aText, 
   1.817 +                           const TDesC& aClippedText, 
   1.818 +                           const TInt aBaselineOffset,
   1.819 +                           const CGraphicsContext::TTextAlign aAlign, 
   1.820 +                           const CFont& aFont,
   1.821 +                           const TBool aHighlight, 
   1.822 +                           const TBool aIsTextClipped) const;
   1.823 +
   1.824 +public:
   1.825 +    /**
   1.826 +     * Customizes marquee default behaviour. 
   1.827 +     *
   1.828 +     * Use this before enabling marquee ( @c EnableMarqueeL() ), otherwise 
   1.829 +     * marquee behaviour will change during animation.
   1.830 +     *
   1.831 +     * @since S60 2.8
   1.832 +     * @param aLoops Max number of loops to be executed.
   1.833 +     * @param aScrollAmount The amount of pixels scrolled per 
   1.834 +     *        iteration.
   1.835 +     * @param aScrollDelay The interval between iterations.
   1.836 +     */
   1.837 +    IMPORT_C void SetMarqueeParams(const TInt aLoops, 
   1.838 +                                   const TInt aScrollAmount, 
   1.839 +                                   const TInt aScrollDelay);
   1.840 +
   1.841 +    /**
   1.842 +     * Customizes marquee default behaviour. 
   1.843 +     *
   1.844 +     * @since S60 2.8
   1.845 +     * @param aLoops Max number of loops to be executed.
   1.846 +     * @param aScrollAmount The amount of pixels scrolled per iteration. 
   1.847 +     * @param aScrollDelay The interval between iterations.
   1.848 +     * @param aInterval The interval between frame updates.
   1.849 +     */
   1.850 +    IMPORT_C void SetMarqueeParams(const TInt aLoops, 
   1.851 +                                   const TInt aScrollAmount, 
   1.852 +                                   const TInt aScrollDelay, 
   1.853 +                                   const TInt aInterval);                        
   1.854 +    /**
   1.855 +    * Tells whether current item has clipped text cells
   1.856 +    * @since S60 3.2
   1.857 +    * @return bitfield of clipped columns
   1.858 +    */
   1.859 +    IMPORT_C TUint32 CurrentItemTextWasClipped() const;
   1.860 +        
   1.861 +    /**
   1.862 +    * Returns ETrue if kinetic scrolling is enabled.
   1.863 +    * @internal
   1.864 +    * @since S60 5.0
   1.865 +    * @return ETrue if kinetic scrolling feature is enabled.
   1.866 +    */
   1.867 +    TBool KineticScrollingEnabled() const;
   1.868 +
   1.869 +private:
   1.870 +    void DrawHighLight( CWindowGc& aGc, const TRect& aRect,
   1.871 +                        TBool aHighlight,
   1.872 +                        MAknsSkinInstance* aSkin ) const;
   1.873 +        
   1.874 +    void CheckIfSubCellsIntersect( TAknTextLineLayout* aLayouts,
   1.875 +                                   TBool* aResults, const TDesC& aText,
   1.876 +                                   const TRect& aItemRect ) const;
   1.877 +    /**
   1.878 +    * @internal helper
   1.879 +    */
   1.880 +    void BitBltColored( CWindowGc&      aGc,
   1.881 +                        TBool           aHighlight,
   1.882 +                        const CGulIcon* aIcon,
   1.883 +                        TInt            aSubcell,
   1.884 +                        TBool           aColorIcon,
   1.885 +                        const TRect&    aGraphicRect ) const;
   1.886 +
   1.887 +
   1.888 +        
   1.889 +private:
   1.890 +    CArrayFix<SColumn>* iColumnArray;
   1.891 +    CColumnListBoxDataExtension *iExtension;
   1.892 +    };
   1.893 +
   1.894 +#endif // __EIKCLBD_H__
   1.895 +
   1.896 +// End of File