epoc32/include/mw/eikfrlbd.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
/*
williamr@4
     2
* Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     3
* All rights reserved.
williamr@4
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@4
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     8
*
williamr@4
     9
* Initial Contributors:
williamr@4
    10
* Nokia Corporation - initial contribution.
williamr@4
    11
*
williamr@4
    12
* Contributors:
williamr@4
    13
*
williamr@4
    14
* Description:  
williamr@4
    15
*
williamr@4
    16
*/
williamr@4
    17
williamr@4
    18
williamr@4
    19
//
williamr@4
    20
// EIKFRLBD.H
williamr@4
    21
//
williamr@4
    22
// Copyright (c) 2001 Symbian Ltd.  All rights reserved.
williamr@4
    23
//
williamr@4
    24
#if !defined(__EIKFRLBD_H__)
williamr@4
    25
#define __EIKFRLBD_H__
williamr@4
    26
williamr@4
    27
#include <e32base.h>
williamr@4
    28
#include <gdi.h>
williamr@4
    29
williamr@4
    30
#include <eiklbd.h>
williamr@4
    31
#include <eikfrlb.h>
williamr@4
    32
#include <avkon.hrh>
williamr@4
    33
#include <AknsDrawUtils.h> // for TAknsQsnTextColorsIndex
williamr@4
    34
#include <babitflags.h>    // for TBitFlags32
williamr@4
    35
williamr@4
    36
class CWindowGc;
williamr@4
    37
class CGulIcon;
williamr@4
    38
class CFormattedCellListBoxDataExtension;
williamr@4
    39
class MAknsControlContext;
williamr@4
    40
class TAknsItemID;
williamr@4
    41
class CAknLayoutData;
williamr@4
    42
class CAknsEffectAnim;
williamr@4
    43
class TAknTextLineLayout;
williamr@4
    44
class TAknWindowLineLayout;
williamr@4
    45
class TAknTextComponentLayout;
williamr@4
    46
class TAknWindowComponentLayout;
williamr@4
    47
williamr@4
    48
/**
williamr@4
    49
* A callback interface for overriding highlight animation input layer
williamr@4
    50
* preparation in derived classes. Usually drawing the background under the
williamr@4
    51
* highlight rect will yield the right kind of result. The size of the render
williamr@4
    52
* target is equal to item cell size.
williamr@4
    53
*
williamr@4
    54
* @since 3.0
williamr@4
    55
*/
williamr@4
    56
class MListBoxAnimBackgroundDrawer
williamr@4
    57
    {
williamr@4
    58
    public:
williamr@4
    59
    /**
williamr@4
    60
     * @param aGc Bitmapped graphical context to draw to.
williamr@4
    61
     * @return 
williamr@4
    62
     */ 
williamr@4
    63
        virtual TBool DrawHighlightAnimBackground( CFbsBitGc& aGc ) const = 0;
williamr@4
    64
    };
williamr@4
    65
williamr@4
    66
/**
williamr@4
    67
 * @c CFormattedCellListBoxData can draw list items.
williamr@4
    68
 * This is similar class than @c CColumnListBoxData, but it can more freely
williamr@4
    69
 * layout the list items; more parameters can be used to position the elements.
williamr@4
    70
 * In particular, the position of the elements is free, and not tied to fixed
williamr@4
    71
 * width columns.
williamr@4
    72
 *
williamr@4
    73
 * This class is used to draw most of the S60 list and grid layouts.
williamr@4
    74
 *
williamr@4
    75
 * It also handles truncation of the text elements, centering and cropping of
williamr@4
    76
 * images, z-order/overlapping cells, bi-directional text drawing, backgrounds
williamr@4
    77
 * for lists, highlight drawing, various text and image properties and finally
williamr@4
    78
 * the parts of the separator lines that are inside list items.
williamr@4
    79
 *
williamr@4
    80
 * This is a very low level class. The less you use this class, the better.
williamr@4
    81
 * Applications should be using @c CAknSelectionListDialog or
williamr@4
    82
 * @c CAknMarkableListDialog or @c CAknListQueryDialog to use lists. There are
williamr@4
    83
 * enough predefined list layouts available, so there should be no need for
williamr@4
    84
 * applications to use this class. See Style Guide for more information. Use of
williamr@4
    85
 * this class may cause your application to not look ok when properties of the
williamr@4
    86
 * device change.
williamr@4
    87
 *
williamr@4
    88
 * @lib avkon
williamr@4
    89
 */
williamr@4
    90
class CFormattedCellListBoxData : public CListBoxData
williamr@4
    91
    {
williamr@4
    92
    friend class CFormattedCellListBoxDataExtension;
williamr@4
    93
williamr@4
    94
public:
williamr@4
    95
    
williamr@4
    96
    //INNER CLASS DECLARATION
williamr@4
    97
    /*
williamr@4
    98
     * A container class for storage of colour values.                           
williamr@4
    99
     * Used by @c CFormattedCellListBoxData.
williamr@4
   100
     */
williamr@4
   101
    class TColors
williamr@4
   102
        {
williamr@4
   103
    
williamr@4
   104
    public:
williamr@4
   105
    
williamr@4
   106
        /**
williamr@4
   107
         * C++ default constructor.
williamr@4
   108
         */
williamr@4
   109
        IMPORT_C TColors();
williamr@4
   110
williamr@4
   111
    public:
williamr@4
   112
    
williamr@4
   113
        /** 
williamr@4
   114
         * The text colour.
williamr@4
   115
         */
williamr@4
   116
        TRgb iText;
williamr@4
   117
williamr@4
   118
        /** 
williamr@4
   119
         * The background colour.
williamr@4
   120
         */
williamr@4
   121
        TRgb iBack;
williamr@4
   122
williamr@4
   123
        /** 
williamr@4
   124
         * The highlighted text colour.
williamr@4
   125
         */
williamr@4
   126
        TRgb iHighlightedText;
williamr@4
   127
williamr@4
   128
        /** 
williamr@4
   129
         * The highlighted background colour.
williamr@4
   130
         */
williamr@4
   131
        TRgb iHighlightedBack;
williamr@4
   132
        
williamr@4
   133
        /** 
williamr@4
   134
         * The separator line colour.
williamr@4
   135
         *
williamr@4
   136
         * @deprecated The separator line colour is no longer used because the
williamr@4
   137
         *             separator lines are skinned.
williamr@4
   138
         */
williamr@4
   139
        TRgb iRightSeparatorColor;
williamr@4
   140
        };
williamr@4
   141
williamr@4
   142
public:
williamr@4
   143
williamr@4
   144
    /**
williamr@4
   145
     * Two-phased constructor.
williamr@4
   146
     *
williamr@4
   147
     * @return Pointer to a new formatted cell listbox data object.
williamr@4
   148
     */
williamr@4
   149
    IMPORT_C static CFormattedCellListBoxData* NewL();
williamr@4
   150
williamr@4
   151
    /**
williamr@4
   152
     * Destructor.
williamr@4
   153
     */
williamr@4
   154
    IMPORT_C ~CFormattedCellListBoxData();
williamr@4
   155
williamr@4
   156
public:
williamr@4
   157
williamr@4
   158
    /**
williamr@4
   159
     * Gets colours attached to the cell.
williamr@4
   160
     *
williamr@4
   161
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   162
     * @return Text and background colors.
williamr@4
   163
     */
williamr@4
   164
    IMPORT_C const TColors& SubCellColors(TInt aSubCellIndex) const;
williamr@4
   165
    
williamr@4
   166
    /**
williamr@4
   167
     * Sets colours attached to the cell.
williamr@4
   168
     *
williamr@4
   169
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   170
     * @param aColors Text and background colors.
williamr@4
   171
     */
williamr@4
   172
    IMPORT_C void SetSubCellColorsL(TInt aSubCellIndex, const TColors &aColors);
williamr@4
   173
williamr@4
   174
    /**
williamr@4
   175
     * Gets baseline position from top of the cell.
williamr@4
   176
     *
williamr@4
   177
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   178
     * @return Baseline y-position.
williamr@4
   179
     */
williamr@4
   180
    IMPORT_C TInt SubCellBaselinePos(TInt aSubCellIndex) const;
williamr@4
   181
    
williamr@4
   182
    /**
williamr@4
   183
     * Sets baseline position from top of the cell.
williamr@4
   184
     *
williamr@4
   185
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   186
     * @param aPos Position which is set for the item.
williamr@4
   187
     */
williamr@4
   188
    IMPORT_C void SetSubCellBaselinePosL(TInt aSubCellIndex, TInt aPos);
williamr@4
   189
williamr@4
   190
    /**
williamr@4
   191
     * Gets cell size in pixels.
williamr@4
   192
     *
williamr@4
   193
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   194
     * @return Cell size.
williamr@4
   195
     */
williamr@4
   196
    IMPORT_C TSize SubCellSize(TInt aSubCellIndex) const;
williamr@4
   197
    
williamr@4
   198
    /**
williamr@4
   199
     * Sets cell size in pixels.
williamr@4
   200
     *
williamr@4
   201
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   202
     * @param aSize Cell size.
williamr@4
   203
     */
williamr@4
   204
    IMPORT_C void SetSubCellSizeL(TInt aSubCellIndex, TSize aSize);
williamr@4
   205
williamr@4
   206
    /**
williamr@4
   207
     * Gets cell position inside an item.
williamr@4
   208
     *
williamr@4
   209
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   210
     * @return Cell position.
williamr@4
   211
     */
williamr@4
   212
    IMPORT_C TPoint SubCellPosition(TInt aSubCellIndex) const;
williamr@4
   213
    
williamr@4
   214
    /**
williamr@4
   215
     * Sets cell position inside an item.
williamr@4
   216
     *
williamr@4
   217
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   218
     * @param aPosition New position for cell.
williamr@4
   219
     */
williamr@4
   220
    IMPORT_C void SetSubCellPositionL(TInt aSubCellIndex, TPoint aPosition);
williamr@4
   221
williamr@4
   222
    /**
williamr@4
   223
     * Determines whether this cell can overlap with one of the previous cells.
williamr@4
   224
     *
williamr@4
   225
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   226
     * @return @c ETrue if cell overlaps another one, @c EFalse if cell allocates 
williamr@4
   227
     *         area from other cells.
williamr@4
   228
     */
williamr@4
   229
    IMPORT_C TBool SubCellIsTransparent(TInt aSubCellIndex) const;
williamr@4
   230
williamr@4
   231
    /**
williamr@4
   232
     * Modifies whether the cell can overlap with one of the previous cells.
williamr@4
   233
     *
williamr@4
   234
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   235
     * @param aIsTransparent @c ETrue if transparent, @c EFalse if not.
williamr@4
   236
     */
williamr@4
   237
    IMPORT_C void SetTransparentSubCellL(TInt aSubCellIndex, 
williamr@4
   238
                                         TBool aIsTransparent);
williamr@4
   239
williamr@4
   240
    /**
williamr@4
   241
     * Checks whether drawing algorithm always draws the cell or whether empty 
williamr@4
   242
     * string in list item can disable the drawing of the cell.
williamr@4
   243
     *
williamr@4
   244
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   245
     * @return @c ETrue when empty string disables cell, 
williamr@4
   246
     *         @c EFalse if always drawn.
williamr@4
   247
     */
williamr@4
   248
    IMPORT_C TBool SubCellIsNotAlwaysDrawn(TInt aSubCellIndex) const;
williamr@4
   249
williamr@4
   250
    /**
williamr@4
   251
     * Sets whether drawing algorithm always draws the cell.
williamr@4
   252
     *
williamr@4
   253
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   254
     * @param aIsNotAlwaysDrawn If @c ETrue, empty string disables cell.
williamr@4
   255
     */
williamr@4
   256
    IMPORT_C void SetNotAlwaysDrawnSubCellL(TInt aSubCellIndex,
williamr@4
   257
                                            TBool aIsNotAlwaysDrawn);
williamr@4
   258
williamr@4
   259
    /**
williamr@4
   260
     * Gets margins used for the content inside the cell.
williamr@4
   261
     *
williamr@4
   262
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   263
     * @return Margins in pixels.
williamr@4
   264
     */
williamr@4
   265
    IMPORT_C TMargins SubCellMargins(TInt aSubCellIndex) const;
williamr@4
   266
williamr@4
   267
    /**
williamr@4
   268
     * Sets margins for the content inside the cell.
williamr@4
   269
     *
williamr@4
   270
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   271
     * @param aMargins Margins for the content inside the cell.
williamr@4
   272
     */
williamr@4
   273
    IMPORT_C void SetSubCellMarginsL(TInt aSubCellIndex, TMargins aMargins);
williamr@4
   274
williamr@4
   275
    /**
williamr@4
   276
     * Gets font attached to the cell.
williamr@4
   277
     *
williamr@4
   278
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   279
     * @return Handle to the attached font.
williamr@4
   280
     */
williamr@4
   281
    IMPORT_C const CFont* SubCellFont(TInt aSubCellIndex) const;
williamr@4
   282
williamr@4
   283
    /**
williamr@4
   284
     * Sets the font attached to the cell.
williamr@4
   285
     *
williamr@4
   286
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   287
     * @param aFont Font to attach to the cell.
williamr@4
   288
     */
williamr@4
   289
    IMPORT_C void SetSubCellFontL(TInt aSubCellIndex, const CFont* aFont);
williamr@4
   290
williamr@4
   291
    /**
williamr@4
   292
     * Gets the alignment attached to the cell.
williamr@4
   293
     *
williamr@4
   294
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   295
     * @return Alignment of the text.
williamr@4
   296
     */
williamr@4
   297
    IMPORT_C CGraphicsContext::TTextAlign SubCellAlignment(TInt aSubCellIndex)
williamr@4
   298
        const;
williamr@4
   299
williamr@4
   300
    /**
williamr@4
   301
     * Sets the alignment attached to the cell.
williamr@4
   302
     *
williamr@4
   303
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   304
     * @param aAlign Alignment that is attached to the cell
williamr@4
   305
     */
williamr@4
   306
    IMPORT_C void SetSubCellAlignmentL(TInt aSubCellIndex,
williamr@4
   307
                                       CGraphicsContext::TTextAlign aAlign);
williamr@4
   308
williamr@4
   309
    /**
williamr@4
   310
     * Checks whetherdrawing algorithm considers the text
williamr@4
   311
     * string in list item as unicode text string displayable on the screen,
williamr@4
   312
     * or as string representation of an index to icon array.
williamr@4
   313
     *
williamr@4
   314
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   315
     * @return @c ETrue if graphics cell, @c EFalse if text cell.
williamr@4
   316
     */
williamr@4
   317
    IMPORT_C TBool SubCellIsGraphics(TInt aSubCellIndex) const;
williamr@4
   318
williamr@4
   319
    /**
williamr@4
   320
     * Sets whether drawing algorithm considers the text string in list item as
williamr@4
   321
     * unicode text string displayable on the screen, or as string 
williamr@4
   322
     * representation of an index to icon array.
williamr@4
   323
     *
williamr@4
   324
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   325
     * @param aIsGraphics @c ETrue if graphics cell, @c EFalse if text cell.
williamr@4
   326
     */
williamr@4
   327
    IMPORT_C void SetGraphicsSubCellL(TInt aSubCellIndex, TBool aIsGraphics);
williamr@4
   328
williamr@4
   329
    /**
williamr@4
   330
     * Checks whether vertical line is drawn to the right side of the cell.
williamr@4
   331
     *
williamr@4
   332
     * @param aColumn Index number of the subcell.
williamr@4
   333
     * @return Style of pen used to draw a line for the right side of the cell.
williamr@4
   334
     */
williamr@4
   335
    IMPORT_C CGraphicsContext::TPenStyle 
williamr@4
   336
        SubCellRightSeparatorStyle(TInt aColumn) const;
williamr@4
   337
williamr@4
   338
    /**
williamr@4
   339
     * Sets whether vertical line is drawn to the right side of the cell.
williamr@4
   340
     *
williamr@4
   341
     * @param aSubCell Index number of the subcell.
williamr@4
   342
     * @param aStyle Style of a pen used to draw a line for the right side of 
williamr@4
   343
     *        the cell.
williamr@4
   344
     */
williamr@4
   345
    IMPORT_C void SetSubCellRightSeparatorStyleL(TInt aSubCell,
williamr@4
   346
                                            CGraphicsContext::TPenStyle aStyle);
williamr@4
   347
williamr@4
   348
    /**
williamr@4
   349
     * Gets the amount of pixels text margins is grown if it is truncated. 
williamr@4
   350
     * This is usually very small number used to make the layout look more 
williamr@4
   351
     * balanced when text is truncated. (the glyph used for truncation is 
williamr@4
   352
     * almost empty and on narrow text elements, it looks odd if the truncated
williamr@4
   353
     * text element is exactly same size as non-truncated version.)
williamr@4
   354
     *
williamr@4
   355
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   356
     * @return Amount of pixels that are used for growing the text margins in 
williamr@4
   357
     *         truncation.
williamr@4
   358
     */
williamr@4
   359
    IMPORT_C TInt SubCellTextClipGap(TInt aSubCellIndex) const;
williamr@4
   360
williamr@4
   361
    /**
williamr@4
   362
     * Sets the amount of pixels truncation grows a text element.
williamr@4
   363
     *
williamr@4
   364
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   365
     * @param aGap The amount of pixels that are required for growing the text 
williamr@4
   366
     *        element when it is truncated. 
williamr@4
   367
     */
williamr@4
   368
    IMPORT_C void SetSubCellTextClipGapL(TInt aSubCellIndex, TInt aGap);
williamr@4
   369
williamr@4
   370
    /**
williamr@4
   371
     * SkinEnabled checks whether skins are enabled on this list.
williamr@4
   372
     *
williamr@4
   373
     * @since Symbian 2.0 
williamr@4
   374
     * @return @c ETrue if enabled, @c EFalse if disabled.
williamr@4
   375
     */
williamr@4
   376
    IMPORT_C TBool SkinEnabled() const;
williamr@4
   377
williamr@4
   378
    /**
williamr@4
   379
     * Sets whether skins are enabled on this list.
williamr@4
   380
     * The default value is determined from global setting from @c CAknAppUi.
williamr@4
   381
     *
williamr@4
   382
     * @since Symbian 2.0
williamr@4
   383
     * @param aEnabled If @c ETrue skins are set enabled. 
williamr@4
   384
     *        If @c EFalse skins are set disabled.
williamr@4
   385
     */
williamr@4
   386
    IMPORT_C void SetSkinEnabledL(TBool aEnabled);
williamr@4
   387
williamr@4
   388
    /**
williamr@4
   389
     * Checks whether the cell is used for numbers.
williamr@4
   390
     *
williamr@4
   391
     * @since Symbian 2.0
williamr@4
   392
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   393
     * @return @c ETrue if enabled, @c EFalse if disabled.
williamr@4
   394
     */
williamr@4
   395
    IMPORT_C TBool SubCellIsNumberCell(TInt aSubCellIndex) const;
williamr@4
   396
williamr@4
   397
    /**
williamr@4
   398
     * Sets whether the cell is used for numbers.
williamr@4
   399
     *
williamr@4
   400
     * @since Symbian 2.0
williamr@4
   401
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   402
     * @param aIsNumberCell New value for the flag.
williamr@4
   403
     */
williamr@4
   404
    IMPORT_C void SetNumberCellL(TInt aSubCellIndex, TBool aIsNumberCell);
williamr@4
   405
williamr@4
   406
    /**
williamr@4
   407
     * Gets the icon array used when drawing bitmaps for the listbox items.
williamr@4
   408
     */
williamr@4
   409
    IMPORT_C CArrayPtr<CGulIcon>* IconArray() const;
williamr@4
   410
williamr@4
   411
    /**
williamr@4
   412
     * Sets the icon array used when drawing bitmaps.
williamr@4
   413
     * The array can be modified (no need to call this method when modifying),
williamr@4
   414
     * even in @c MdcaPoint() or @c MdcaCount() methods of @c MDesCArray class.
williamr@4
   415
     * See also @c CTextListBoxModel::SetItemTextArray().
williamr@4
   416
     * 
williamr@4
   417
     * The most common way to crash a listbox is by forgetting to call this 
williamr@4
   418
     * method, or the list item string for graphics cell is not an index of 
williamr@4
   419
     * a bitmap.
williamr@4
   420
     *
williamr@4
   421
     * @param aArray Pointer to the icon array.
williamr@4
   422
     */
williamr@4
   423
    IMPORT_C void SetIconArrayL(CArrayPtr<CGulIcon>* aArray);
williamr@4
   424
williamr@4
   425
    /**
williamr@4
   426
     * SetIconArray sets the icon array used when drawing bitmaps.
williamr@4
   427
     * The array can be modified (no need to call this method when modifying),
williamr@4
   428
     * even in @c MdcaPoint() or @c MdcaCount() methods of @c MDesCArray class.
williamr@4
   429
     * See also @c CTextListBoxModel::SetItemTextArray().
williamr@4
   430
     * 
williamr@4
   431
     * The most common way to crash a listbox is by forgetting to call this
williamr@4
   432
     * method, or the list item string for graphics cell is not an index of
williamr@4
   433
     * a bitmap.
williamr@4
   434
     *
williamr@4
   435
     * @param aArray Pointer to the icon array.
williamr@4
   436
     */
williamr@4
   437
    IMPORT_C void SetIconArray(CArrayPtr<CGulIcon>* aArray);
williamr@4
   438
williamr@4
   439
    /**
williamr@4
   440
     * Font access to the font used in subcell.
williamr@4
   441
     *
williamr@4
   442
     * @param aItemProperties Not used in code.
williamr@4
   443
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   444
     * @return Font used in subcell.
williamr@4
   445
     */
williamr@4
   446
    IMPORT_C CFont* Font(const TListItemProperties& aItemProperties,
williamr@4
   447
                         TInt aSubCellIndex) const;
williamr@4
   448
    
williamr@4
   449
    /**
williamr@4
   450
     * From @c CListBoxData.
williamr@4
   451
     *
williamr@4
   452
     * @c Draw() is the most important method in 
williamr@4
   453
     * @c CEikFormattedCellListBoxData.
williamr@4
   454
     * This is the only method that needs to be implemented in this class and
williamr@4
   455
     * it draws the whole list item.
williamr@4
   456
     *
williamr@4
   457
     * @param aProperties Properties attached to the list item.
williamr@4
   458
     * @param aGc Graphics Context used for drawing the list item.
williamr@4
   459
     * @param aText A text string describing the list item cells.
williamr@4
   460
     * @param aRect The area of the screen for the whole list item.
williamr@4
   461
     * @param aHighlight Whether the list item is selected.
williamr@4
   462
     * @param aColors The colours used for drawing the item.
williamr@4
   463
     */
williamr@4
   464
    IMPORT_C virtual void Draw(TListItemProperties aProperties,
williamr@4
   465
                               CWindowGc& aGc,
williamr@4
   466
                               const TDesC* aText,
williamr@4
   467
                               const TRect& aRect,
williamr@4
   468
                               TBool aHighlight,
williamr@4
   469
                               const TColors& aColors) const;
williamr@4
   470
williamr@4
   471
    /**
williamr@4
   472
     * Indicates if sub cell is using its own colors rather than common colors.
williamr@4
   473
     *
williamr@4
   474
     * @param aSubCell Index number of the subcell.
williamr@4
   475
     * @return Boolean indicating whether own colors enabled.
williamr@4
   476
     *         @c ETrue enabled, @c EFalse disabled.
williamr@4
   477
     */
williamr@4
   478
    IMPORT_C TBool UseSubCellColors(TInt aSubCell) const;
williamr@4
   479
williamr@4
   480
    /**
williamr@4
   481
     * Ability for a skin subsystem to access Mop chain through current 
williamr@4
   482
     * listbox control.
williamr@4
   483
     *
williamr@4
   484
     * @since Symbian 2.0
williamr@4
   485
     * @return Current listbox instance or NULL.
williamr@4
   486
     */
williamr@4
   487
    IMPORT_C CCoeControl* Control() const;
williamr@4
   488
    
williamr@4
   489
    /**
williamr@4
   490
     * Ability for a skin subsystem to access mop chain through current listbox
williamr@4
   491
     * control.
williamr@4
   492
     *
williamr@4
   493
     * @since Symbian 2.0
williamr@4
   494
     * @param aControlOrNull Current listbox instance or NULL. Cannot be other
williamr@4
   495
     *        control than the current listbox!
williamr@4
   496
     */
williamr@4
   497
    IMPORT_C void SetControl(CCoeControl* aControlOrNull);
williamr@4
   498
    
williamr@4
   499
    /**
williamr@4
   500
     * Access to the background context of the listbox.
williamr@4
   501
     *
williamr@4
   502
     * @since Symbian 2.0
williamr@4
   503
     * @return Skin background context.
williamr@4
   504
     */
williamr@4
   505
    IMPORT_C MAknsControlContext* SkinBackgroundContext() const;
williamr@4
   506
    /**
williamr@4
   507
     * Modify properties of the skin context (background).
williamr@4
   508
     *
williamr@4
   509
     * @since Symbian 2.0
williamr@4
   510
     * @param aId Skin background identifier.
williamr@4
   511
     * @param aRect Skin background rectangle.
williamr@4
   512
     */
williamr@4
   513
    IMPORT_C void SetBackgroundSkinStyle(const TAknsItemID *aId,
williamr@4
   514
                                         const TRect &aRect);
williamr@4
   515
    
williamr@4
   516
    /**
williamr@4
   517
     * Modify properties of the skin context (AB-column).
williamr@4
   518
     *
williamr@4
   519
     * @since Symbian 2.0
williamr@4
   520
     * @param aId Skin background identifier.
williamr@4
   521
     * @param aTileRect Skin background area from LAF.
williamr@4
   522
     */
williamr@4
   523
    IMPORT_C void SetSkinStyle(const TAknsItemID* aId, const TRect& aTileRect);
williamr@4
   524
    
williamr@4
   525
    /**
williamr@4
   526
     * Modify position of the parent for list default context.
williamr@4
   527
     *
williamr@4
   528
     * @since Symbian 2.0
williamr@4
   529
     * @param aPos The new position.
williamr@4
   530
     */
williamr@4
   531
    IMPORT_C void SetSkinParentPos(const TPoint& aPos);
williamr@4
   532
   
williamr@4
   533
    /**
williamr@4
   534
     * Modify properties of the skin context (list ending)*
williamr@4
   535
     
williamr@4
   536
     * @since Symbian 2.0
williamr@4
   537
     * @param listEndId List ending skin background identifier.
williamr@4
   538
     * @param aRect List ending background area from LAF.
williamr@4
   539
     */
williamr@4
   540
    IMPORT_C void SetListEndSkinStyle(const TAknsItemID *listEndId,
williamr@4
   541
                                      const TRect &aRect);
williamr@4
   542
williamr@4
   543
    /**
williamr@4
   544
     * Gets RespectFocus flag.
williamr@4
   545
     *
williamr@4
   546
     * @return RespectFocus flag. @c ETrue if list item highlights are only 
williamr@4
   547
     *         shown  when the list is has been focused on.
williamr@4
   548
     */
williamr@4
   549
    IMPORT_C TBool RespectFocus() const;
williamr@4
   550
    
williamr@4
   551
    /**
williamr@4
   552
     * Sets RespectFocus flag.
williamr@4
   553
     *
williamr@4
   554
     * @param aBool Value of RespectFocus flag. @c ETrue means that the 
williamr@4
   555
     *        list item highlight is only shown if list is focused on.
williamr@4
   556
     */
williamr@4
   557
    IMPORT_C void SetRespectFocus(TBool aBool);
williamr@4
   558
williamr@4
   559
    /**
williamr@4
   560
     * Set list higlight skin style.
williamr@4
   561
     *
williamr@4
   562
     * @since Symbian 2.0
williamr@4
   563
     * @param aFrameId The id for the frame.
williamr@4
   564
     * @param aFrameCenterId The id for the frame center.
williamr@4
   565
     */
williamr@4
   566
    IMPORT_C void SetSkinHighlightFrame(const TAknsItemID* aFrameId,
williamr@4
   567
                                        const TAknsItemID* aFrameCenterId);
williamr@4
   568
    /**
williamr@4
   569
     * Set popup skin style.
williamr@4
   570
     *
williamr@4
   571
     * @since Symbian 2.0
williamr@4
   572
     * @param aFrameId The id for the frame.
williamr@4
   573
     * @param aFrameCenterId The id for the frame center.
williamr@4
   574
     */
williamr@4
   575
    IMPORT_C void SetSkinPopupFrame(const TAknsItemID* aFrameId, 
williamr@4
   576
                                    const TAknsItemID* aFrameCenterId);
williamr@4
   577
    
williamr@4
   578
    /**
williamr@4
   579
     * Set popup skin frame position.
williamr@4
   580
     *
williamr@4
   581
     * @since Symbian 2.0
williamr@4
   582
     * @param aOuterRect Outer position of the frame.
williamr@4
   583
     * @param aInnerRect Inner position of the frame.
williamr@4
   584
     */
williamr@4
   585
    IMPORT_C void SetSkinPopupFramePosition(const TRect& aOuterRect,
williamr@4
   586
                                            const TRect& aInnerRect);
williamr@4
   587
williamr@4
   588
    /**
williamr@4
   589
     * Enable or disable logical to visual reordering in listbox data text
williamr@4
   590
     * drawing. By default, it is enabled. This has any effect only when
williamr@4
   591
     * bidirectional text is rendered.
williamr@4
   592
     *
williamr@4
   593
     * If you convert text to visual order prior to passing it to the listbox
williamr@4
   594
     * (for example by wrapping text to lines with methods in
williamr@4
   595
     * @c AknBidiTextUtils), then you should disable conversion in listbox by
williamr@4
   596
     * calling this method.
williamr@4
   597
     *
williamr@4
   598
     * @since Symbian 2.0
williamr@4
   599
     * @param aUseConversion Enable (@c ETrue) or disable 
williamr@4
   600
     *        (@c EFalse) conversion.
williamr@4
   601
     */
williamr@4
   602
    IMPORT_C void UseLogicalToVisualConversion( TBool aUseConversion );
williamr@4
   603
williamr@4
   604
    /**
williamr@4
   605
     * Enables or disables marquee.
williamr@4
   606
     *
williamr@4
   607
     * @param aEnable @c ETrue if On, @c EFalse if Off.
williamr@4
   608
     */
williamr@4
   609
    IMPORT_C void EnableMarqueeL(TBool aEnable);
williamr@4
   610
    
williamr@4
   611
    /**
williamr@4
   612
     * Determines if marquee is on.
williamr@4
   613
     *
williamr@4
   614
     * @return Flag indicating if marquee is on (@c ETrue on, @c EFalse off)  
williamr@4
   615
     */
williamr@4
   616
#ifdef __WINS__
williamr@4
   617
    IMPORT_C const TBool IsMarqueeOn();
williamr@4
   618
#else
williamr@4
   619
    IMPORT_C TBool IsMarqueeOn();
williamr@4
   620
#endif // __WINS__
williamr@4
   621
    /**
williamr@4
   622
     * Function that is called when the owning control has gained the focus.
williamr@4
   623
     * Causes that animation is continued because the control is visible and
williamr@4
   624
     * focused.
williamr@4
   625
     */
williamr@4
   626
    void FocusGained();
williamr@4
   627
williamr@4
   628
    /**
williamr@4
   629
     * Function that is called when the owning control has lost the focus.
williamr@4
   630
     * Causes the animation to pause, even if the control is partially
williamr@4
   631
     * visible.
williamr@4
   632
     */
williamr@4
   633
    void FocusLost();
williamr@4
   634
    
williamr@4
   635
    /**
williamr@4
   636
     * Handles the skin change situation. Causes change of animation.
williamr@4
   637
     *
williamr@4
   638
     * @param aType Type of resource change.
williamr@4
   639
     */
williamr@4
   640
    void HandleResourceChange( TInt aType );
williamr@4
   641
    
williamr@4
   642
    /**
williamr@4
   643
     * Gets animation used for drawing the list highlight.
williamr@4
   644
     * May return NULL, in which case the normal skinned highlight should be
williamr@4
   645
     * drawn. This pointer is valid only during the draw -> you should not
williamr@4
   646
     * store it locally outside draw scope.
williamr@4
   647
     *
williamr@4
   648
     * @return Animation used for drawing the list highlight.
williamr@4
   649
     */
williamr@4
   650
    IMPORT_C const CAknsEffectAnim* HighlightAnim() const;
williamr@4
   651
williamr@4
   652
    /**
williamr@4
   653
     * This method should be called before drawing animated highlight. It will
williamr@4
   654
     * sync the animation with the background under the current highlight (only
williamr@4
   655
     * when current item index has changed).
williamr@4
   656
     */
williamr@4
   657
    IMPORT_C void AboutToDrawHighlightAnim() const;
williamr@4
   658
williamr@4
   659
    /**
williamr@4
   660
     * Sets the observer for overriding default highlight input layer drawing
williamr@4
   661
     * functionality. Note that you should still call 
williamr@4
   662
     * @c AboutToDrawHighlightAnim (it will call the observer if it is set).
williamr@4
   663
     *
williamr@4
   664
     * @param aDrawer Highlight animation drawer.
williamr@4
   665
     */
williamr@4
   666
    IMPORT_C void SetHighlightAnimBackgroundDrawer( 
williamr@4
   667
                                       MListBoxAnimBackgroundDrawer* aDrawer );
williamr@4
   668
williamr@4
   669
    /**
williamr@4
   670
     * Changes item cell size and resizes highlight animation. Called by list
williamr@4
   671
     * when item cell size changes. If you are using non-standard highlight 
williamr@4
   672
     * sizes make sure to sync the list item cell size.
williamr@4
   673
     *
williamr@4
   674
     * @param aSize New cell size.
williamr@4
   675
     */
williamr@4
   676
    IMPORT_C void SetItemCellSize( const TSize& aSize );
williamr@4
   677
williamr@4
   678
    /**
williamr@4
   679
    * @return ETrue if highlight animation exists, EFalse otherwise.
williamr@4
   680
    *
williamr@4
   681
    * @since 3.1
williamr@4
   682
    */
williamr@4
   683
    IMPORT_C TBool HasHighlightAnim() const;
williamr@4
   684
    /**
williamr@4
   685
    * The preferred method for drawing highlight animation in derived classes.
williamr@4
   686
    * Before calling this method you should check that highlight animation
williamr@4
   687
    * exists by calling HasHighlightAnim. In case of draw failure you should
williamr@4
   688
    * default to normal skinned highlight drawing. For example:
williamr@4
   689
    *
williamr@4
   690
    * TBool drawOk = EFalse;
williamr@4
   691
    *
williamr@4
   692
    * if( HasHighlightAnim() )
williamr@4
   693
    *     {
williamr@4
   694
    *     drawOk = DrawHighlightAnim( gc, rect );
williamr@4
   695
    *     }
williamr@4
   696
    *
williamr@4
   697
    * if( !drawOk )
williamr@4
   698
    *     {
williamr@4
   699
    *     ...do normal skinned draw
williamr@4
   700
    *     }
williamr@4
   701
    *
williamr@4
   702
    * @param aGc   Graphics context for blitting animation frame
williamr@4
   703
    * @param aRect Target rect for blitting animation frame
williamr@4
   704
    * @return The draw status, ETrue if drawing was ok, EFalse otherwise.
williamr@4
   705
    *
williamr@4
   706
    * @since 3.1
williamr@4
   707
    */
williamr@4
   708
    IMPORT_C TBool DrawHighlightAnim( CBitmapContext& aGc, const TRect& aRect ) const;
williamr@4
   709
    /**
williamr@4
   710
    * Creates pictograph interface.
williamr@4
   711
    * Only effective in Japanese variant.
williamr@4
   712
    * Called by the listbox.
williamr@4
   713
    */
williamr@4
   714
    void CreatePictographInterfaceL();
williamr@4
   715
williamr@4
   716
    /**
williamr@4
   717
     * Creates marquee control.
williamr@4
   718
     * Called by the listbox.
williamr@4
   719
     */
williamr@4
   720
    void CreateMarqueeControlL();
williamr@4
   721
williamr@4
   722
    /**
williamr@4
   723
     * Resets the marquee animation data.
williamr@4
   724
     */
williamr@4
   725
    void ResetMarquee();
williamr@4
   726
williamr@4
   727
    /**
williamr@4
   728
     * Gets the current list item index that is / was drawn by marquee.
williamr@4
   729
     *
williamr@4
   730
     * @return Index of the item that is / was drawn by marquee.
williamr@4
   731
     */
williamr@4
   732
    TInt CurrentMarqueeItemIndex();
williamr@4
   733
    
williamr@4
   734
    /**
williamr@4
   735
     * Sets the current list item index that was drawn by marquee.
williamr@4
   736
     *
williamr@4
   737
     * @param aIndex Index of list item.
williamr@4
   738
     */
williamr@4
   739
    void SetCurrentMarqueeItemIndex(TInt aIndex);
williamr@4
   740
williamr@4
   741
    /**
williamr@4
   742
     * Sets the current list item index (not for marquee). Since Symbian 3.0 
williamr@4
   743
     * causes highlight animation to change its background (only if the current
williamr@4
   744
     * item index changes). Don't call this method if the index is not the 
williamr@4
   745
     * current item index.
williamr@4
   746
     *
williamr@4
   747
     * @param aIndex Index number of list item.
williamr@4
   748
     */
williamr@4
   749
    void SetCurrentItemIndex(TInt aIndex);
williamr@4
   750
williamr@4
   751
    // previous method was used both as current item index AND as currently
williamr@4
   752
    // drawn item index. Not really good idea.
williamr@4
   753
    void SetCurrentlyDrawnItemIndex( TInt aIndex );
williamr@4
   754
williamr@4
   755
    /**
williamr@4
   756
     * Sets the font attached to the cell for each row separately.
williamr@4
   757
     *
williamr@4
   758
     * @param aRowIndex Row, which subcells are to be changed.
williamr@4
   759
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   760
     * @param aFont Font to be used.
williamr@4
   761
     */
williamr@4
   762
    IMPORT_C void SetSubCellFontForRowL(TInt aRowIndex, 
williamr@4
   763
                                        TInt aSubCellIndex, 
williamr@4
   764
                                        const CFont* aFont);
williamr@4
   765
williamr@4
   766
    /**
williamr@4
   767
     * Gets font attached to the row and cell.
williamr@4
   768
     *
williamr@4
   769
     * @param aRow Index number of the row.
williamr@4
   770
     * @param aSubCellIndex Index number of the subcell.
williamr@4
   771
     * @return Font handle.
williamr@4
   772
     */
williamr@4
   773
    IMPORT_C const CFont* RowAndSubCellFont(TInt aRow, 
williamr@4
   774
                                            TInt aSubCellIndex) const;
williamr@4
   775
williamr@4
   776
    /**
williamr@4
   777
     * Enables or disables transparency effect i.e. does the listbox draw its
williamr@4
   778
     * own background or not.
williamr@4
   779
     *
williamr@4
   780
     * @param aDrawBackground @c EFalse enables transparency, @c ETrue disables.
williamr@4
   781
     */ 
williamr@4
   782
    IMPORT_C void SetDrawBackground(const TBool aDrawBackground);
williamr@4
   783
williamr@4
   784
    /**
williamr@4
   785
     * Checks if the list is transparent and drawing the background 
williamr@4
   786
     * that would fall behind it.
williamr@4
   787
     * 
williamr@4
   788
     * @return @c EFalse if transparent, @c ETrue otherwise.
williamr@4
   789
     */ 
williamr@4
   790
    TBool IsBackgroundDrawingEnabled() const;
williamr@4
   791
williamr@4
   792
    /**
williamr@4
   793
     * Enables or disables drawing background after scrollbar.
williamr@4
   794
     *
williamr@4
   795
     * @param aDrawBackground Default is @c ETrue which means that Scrollbar
williamr@4
   796
     *        is drawn first.
williamr@4
   797
     */ 
williamr@4
   798
    void SetDrawScrollbarBackground(const TBool aDrawBackground);
williamr@4
   799
williamr@4
   800
    /**
williamr@4
   801
     * Is the listbox drawing the background behind the scrollbar or not.
williamr@4
   802
     *
williamr@4
   803
     * @return @c ETrue if background is drawn after scrollbar, @c EFalse
williamr@4
   804
     *         otherwise. 
williamr@4
   805
     */ 
williamr@4
   806
    TBool IsScrollbarBackgroundDrawingEnabled() const;
williamr@4
   807
williamr@4
   808
    /**
williamr@4
   809
     * Sets position of listbox separator line.
williamr@4
   810
     *
williamr@4
   811
     * @param aPosition Position in which separator line is placed.
williamr@4
   812
     */
williamr@4
   813
    IMPORT_C void SetSeparatorLinePosition(TAknSeparatorLinePosition aPosition);
williamr@4
   814
williamr@4
   815
    /**
williamr@4
   816
     * Gets separator line position.
williamr@4
   817
     *
williamr@4
   818
     * @return Position of separator line.
williamr@4
   819
     */
williamr@4
   820
    IMPORT_C TAknSeparatorLinePosition SeparatorLinePosition() const;
williamr@4
   821
williamr@4
   822
    /**
williamr@4
   823
     *
williamr@4
   824
     * @deprecated
williamr@4
   825
     *
williamr@4
   826
     * Gets layout data needed for separator lines drawing.
williamr@4
   827
     *
williamr@4
   828
     * @return Layout data.
williamr@4
   829
     */
williamr@4
   830
    IMPORT_C CAknLayoutData* LayoutData() const;
williamr@4
   831
williamr@4
   832
    /**
williamr@4
   833
     *
williamr@4
   834
     * @deprecated
williamr@4
   835
     *
williamr@4
   836
     * Gets LayOutInit flag used for drawing separator lines in lists.
williamr@4
   837
     *
williamr@4
   838
     * @internal
williamr@4
   839
     * @return LayOutInit flag.
williamr@4
   840
     */
williamr@4
   841
    IMPORT_C TBool LayoutInit() const;
williamr@4
   842
    
williamr@4
   843
    /**
williamr@4
   844
     *
williamr@4
   845
     * @deprecated
williamr@4
   846
     *
williamr@4
   847
     * Sets LayOutInit flag used for drawing separator lines in lists.
williamr@4
   848
     *
williamr@4
   849
     * @internal
williamr@4
   850
     * @param aValue LayOutInit flag value.
williamr@4
   851
     */
williamr@4
   852
    IMPORT_C void SetLayoutInit(TBool aValue);
williamr@4
   853
williamr@4
   854
    /**
williamr@4
   855
     * Enables or disables underlining per text subcell only if 
williamr@4
   856
     * @c TListItemProperties also has underlining enabled. If this method is
williamr@4
   857
     * not called and @c TListItemProperties has underlining enabled, drawing
williamr@4
   858
     * will revert to old style where only first text subcell will be underlined.
williamr@4
   859
     *
williamr@4
   860
     * @since S60 3.1
williamr@4
   861
     * @param aUnderlinedCells Bitmask of cells to be underlined.
williamr@4
   862
     */    
williamr@4
   863
    IMPORT_C void SetSubcellUnderlined( TBitFlags32 aUnderlinedCells );
williamr@4
   864
williamr@4
   865
    /**
williamr@4
   866
    *
williamr@4
   867
    * enables certain highlight skinning for
williamr@4
   868
    * radibutton / checkbox set style lists
williamr@4
   869
    *
williamr@4
   870
    * should be used only by avkon internally
williamr@4
   871
    *
williamr@4
   872
    * @since S60 3.1
williamr@4
   873
    * 
williamr@4
   874
    */
williamr@4
   875
williamr@4
   876
    void UseHighlightIconSwapping( TBool aUse );
williamr@4
   877
    TBool UseHighlightIconSwapping() const;
williamr@4
   878
williamr@4
   879
    // next methods are only used inside the drawing algorithm.
williamr@4
   880
    // The set methods are also const because they do not change observable behavior of the system.
williamr@4
   881
    TSize SubCellRealSize(TInt aSubCellIndex) const;
williamr@4
   882
    void SetSubCellRealSize(TInt aSubCellIndex, TSize aRealSize) const;
williamr@4
   883
    //
williamr@4
   884
    TSize SubCellRealTextSize(TInt aSubCellIndex) const;
williamr@4
   885
    void SetSubCellRealTextSize(TInt aSubCellIndex, TSize aRealSize) const;
williamr@4
   886
    
williamr@4
   887
williamr@4
   888
    struct SSubCell
williamr@4
   889
        {
williamr@4
   890
        SSubCell() { }
williamr@4
   891
        TInt iSubCell; // Must be first entry
williamr@4
   892
        
williamr@4
   893
        TInt iWidth;
williamr@4
   894
        TMargins iMargin;
williamr@4
   895
        const CFont* iBaseFont;
williamr@4
   896
        TInt iActualFontIndex;
williamr@4
   897
        TBool iGraphics;
williamr@4
   898
        TBool iTransparent;
williamr@4
   899
        TBool iNotAlwaysDrawn;
williamr@4
   900
        CGraphicsContext::TTextAlign iAlign;
williamr@4
   901
        CGraphicsContext::TPenStyle iRightSeparatorStyle;
williamr@4
   902
        
williamr@4
   903
        TPoint iPosition;
williamr@4
   904
        TInt iBaseline;
williamr@4
   905
        TSize iSize;
williamr@4
   906
williamr@4
   907
        TBool iUseSubCellColors; // this is set if someone calls SetSubCellColorsL()
williamr@4
   908
        TColors iColors;
williamr@4
   909
        TInt iTextClipGap;
williamr@4
   910
williamr@4
   911
        TBool iNumberCell;
williamr@4
   912
        // the next ones change during drawing algorithm
williamr@4
   913
        __MUTABLE TSize iRealSize;
williamr@4
   914
        __MUTABLE TSize iRealTextSize;
williamr@4
   915
        };
williamr@4
   916
williamr@4
   917
protected:
williamr@4
   918
williamr@4
   919
    /**
williamr@4
   920
     * C++ default constructor.
williamr@4
   921
     */
williamr@4
   922
    IMPORT_C CFormattedCellListBoxData();
williamr@4
   923
williamr@4
   924
    /**
williamr@4
   925
     * Second phase constructor. Highlight animation will be 
williamr@4
   926
     * created by default (if it is provided by the skin).
williamr@4
   927
     */
williamr@4
   928
    IMPORT_C void ConstructLD();
williamr@4
   929
williamr@4
   930
    /**
williamr@4
   931
     * Second phase constructor for subclasses that want to override highlight
williamr@4
   932
     * animation creation.
williamr@4
   933
     *
williamr@4
   934
     * @param aAnimationIID Skin ItemID of the constructed animation. Passing
williamr@4
   935
     *        @c KAknsIIDNone will disable highlight animation.
williamr@4
   936
     */
williamr@4
   937
    IMPORT_C void ConstructLD(const TAknsItemID& aAnimationIID);
williamr@4
   938
williamr@4
   939
    /**
williamr@4
   940
     * Main drawing algorithm used for drawing S60 list item. 
williamr@4
   941
     * @c Draw() method should call this method after clearing the list item
williamr@4
   942
     * area and drawing the highlight.
williamr@4
   943
     *
williamr@4
   944
     * @param aProperties Properties attached to the list item.
williamr@4
   945
     * @param aGc Graphics Context used for drawing the list item.
williamr@4
   946
     * @param aText A text string describing the list item cells.
williamr@4
   947
     * @param aRect The area of the screen for the whole list item.
williamr@4
   948
     * @param aHighlight Whether the list item is selected.
williamr@4
   949
     * @param aColors The colors used for drawing the item.
williamr@4
   950
     * @panic EAknPanicFormattedCellListInvalidBitmapIndex The defined bitmap
williamr@4
   951
     *        index is invalid.
williamr@4
   952
     * @panic EAknPanicOutOfRange The defined index is out of the range. 
williamr@4
   953
     */
williamr@4
   954
    IMPORT_C void DrawFormatted(TListItemProperties aProperties,
williamr@4
   955
                                CWindowGc& aGc,
williamr@4
   956
                                const TDesC* aText,
williamr@4
   957
                                const TRect& aRect,
williamr@4
   958
                                TBool aHighlight,
williamr@4
   959
                                const TColors& aColors) const;
williamr@4
   960
williamr@4
   961
    /**
williamr@4
   962
    * Draws list items.
williamr@4
   963
    *
williamr@4
   964
    * @param aProperties Properties attached to the list item.
williamr@4
   965
    * @param aGc Graphics Context used for drawing the list item.
williamr@4
   966
    * @param aText A text string describing the list item cells.
williamr@4
   967
    * @param aRect The area of the screen for the whole list item.
williamr@4
   968
    * @param aHighlight Whether the list item is selected.
williamr@4
   969
    * @param aColors The colors used for drawing the item.
williamr@4
   970
    * @internal
williamr@4
   971
    */
williamr@4
   972
    void DrawFormattedSimple( TListItemProperties& aProperties,
williamr@4
   973
                              CWindowGc& aGc,
williamr@4
   974
                              const TDesC* aText,
williamr@4
   975
                              const TRect& aRect,
williamr@4
   976
                              TBool aHighlight,
williamr@4
   977
                              const TColors& aColors ) const;
williamr@4
   978
private:
williamr@4
   979
    /**
williamr@4
   980
    * @internal
williamr@4
   981
    */
williamr@4
   982
    void DrawFormattedOld( TListItemProperties& aProperties,
williamr@4
   983
                           CWindowGc& aGc,
williamr@4
   984
                           const TDesC* aText,
williamr@4
   985
                           const TRect& aItemRect,
williamr@4
   986
                           TBool aHighlight,
williamr@4
   987
                           const TColors& aColors ) const;
williamr@4
   988
williamr@4
   989
    /**
williamr@4
   990
    * @internal helper
williamr@4
   991
    */
williamr@4
   992
    void BitBltColored( CWindowGc&      aGc,
williamr@4
   993
                        TBool           aHighlight,
williamr@4
   994
                        const CGulIcon* aIcon,
williamr@4
   995
                        TInt            aSubcell,
williamr@4
   996
                        TBool           aColorIcon,
williamr@4
   997
                        const TRect&    aGraphicRect ) const;
williamr@4
   998
williamr@4
   999
williamr@4
  1000
public:
williamr@4
  1001
    /**
williamr@4
  1002
     * Customizes marquee default behavior. 
williamr@4
  1003
     * Use this before enabling marquee ( @c EnableMarqueeL() ), otherwise 
williamr@4
  1004
     * marquee behavior will change during animation.
williamr@4
  1005
     *
williamr@4
  1006
     * @since S60 2.8
williamr@4
  1007
     * @param aLoops Max number of loops to be executed (default 1).
williamr@4
  1008
     * @param aScrollAmount The amount of pixels scrolled per frame (default 6).
williamr@4
  1009
     * @param aScrollDelay The delay between each loop
williamr@4
  1010
     *                     (in microseconds, default 1000000 microseconds).
williamr@4
  1011
     * @param aInterval The interval between frame updates after
williamr@4
  1012
     *                  the initial delay, in microseconds.
williamr@4
  1013
     */
williamr@4
  1014
    IMPORT_C void SetMarqueeParams(const TInt aLoops,
williamr@4
  1015
                                   const TInt aScrollAmount, 
williamr@4
  1016
                                   const TInt aScrollDelay, 
williamr@4
  1017
                                   const TInt aInterval);
williamr@4
  1018
williamr@4
  1019
williamr@4
  1020
    /**
williamr@4
  1021
    * @internal helper
williamr@4
  1022
    */
williamr@4
  1023
    void SetClippedByWrap( TUint32 aClippedCells, TBool aUseClippedByWrap );
williamr@4
  1024
            
williamr@4
  1025
    /**
williamr@4
  1026
    * Tells whether current item has clipped text cells
williamr@4
  1027
    * @since S60 3.2
williamr@4
  1028
    * @return bitfield of clipped subcells
williamr@4
  1029
    */
williamr@4
  1030
    IMPORT_C TUint32 CurrentItemTextWasClipped() const;
williamr@4
  1031
williamr@4
  1032
protected: // non-exported!
williamr@4
  1033
williamr@4
  1034
    /**
williamr@4
  1035
     * Gets list box extension, which is used for adding more funtionality to
williamr@4
  1036
     * list boxes without destroying compatibility with previous versions. 
williamr@4
  1037
     *
williamr@4
  1038
     * @return Pointer to the list box extension.
williamr@4
  1039
     */
williamr@4
  1040
    CFormattedCellListBoxDataExtension* Extension();
williamr@4
  1041
williamr@4
  1042
    /**
williamr@4
  1043
     * Gets list box extension, which is used for adding more funtionality to
williamr@4
  1044
     * list boxes without destroying compatibility with previous versions. 
williamr@4
  1045
     *
williamr@4
  1046
     * @return Pointer to the list box extension.
williamr@4
  1047
     */
williamr@4
  1048
    CFormattedCellListBoxDataExtension* Extension() const;
williamr@4
  1049
williamr@4
  1050
public:
williamr@4
  1051
    /**
williamr@4
  1052
     * Renders a default animated highlight.
williamr@4
  1053
     *
williamr@4
  1054
     * @param aGc Graphics context used for drawing.
williamr@4
  1055
     * @param aItemRect the area of the screen for drawing.
williamr@4
  1056
     * @param aHighlight If @c ETrue highlight is rendered
williamr@4
  1057
     *        if @c EFalse, nothing is done.
williamr@4
  1058
     */
williamr@4
  1059
    void DrawDefaultHighlight(CWindowGc &aGc,
williamr@4
  1060
                              const TRect &aItemRect,
williamr@4
  1061
                              TBool aHighlight) const;
williamr@4
  1062
williamr@4
  1063
    /**
williamr@4
  1064
     * Renders a settings animated highlight.
williamr@4
  1065
     *
williamr@4
  1066
     * @param aGc Graphics context used for drawing.
williamr@4
  1067
     * @param aItemRect the area of the screen for drawing.
williamr@4
  1068
     * @param aHighlight If @c ETrue highlight is rendered 
williamr@4
  1069
     *        if @c EFalse, nothing is done.
williamr@4
  1070
     */
williamr@4
  1071
    void DrawSettingHighlight(CWindowGc &aGc,
williamr@4
  1072
                              const TRect &aItemRect,
williamr@4
  1073
                              TBool aHighlight) const;
williamr@4
  1074
williamr@4
  1075
    /**
williamr@4
  1076
     * Renders a popup animated highlight.
williamr@4
  1077
     *
williamr@4
  1078
     * @param aGc Graphics context used for drawing.
williamr@4
  1079
     * @param aItemRect the area of the screen for drawing.
williamr@4
  1080
     * @param aHighlight If @c ETrue highlight is rendered 
williamr@4
  1081
     *        if @c EFalse, nothing is done.
williamr@4
  1082
     */
williamr@4
  1083
    void DrawPopupHighlight(CWindowGc &aGc,
williamr@4
  1084
                            const TRect &aItemRect,
williamr@4
  1085
                            TBool aHighlight) const;
williamr@4
  1086
williamr@4
  1087
    /**
williamr@4
  1088
     * Draws a popup frame.
williamr@4
  1089
     *
williamr@4
  1090
     * @param aGc Graphics context used for drawing.
williamr@4
  1091
     */
williamr@4
  1092
    void DrawPopupFrame(CWindowGc &aGc) const;
williamr@4
  1093
williamr@4
  1094
    /**
williamr@4
  1095
     * Disables logical-to-visual conversion in subcells between indexes.
williamr@4
  1096
     *
williamr@4
  1097
     * @param aFirstIndex First subcell not to use logical-to-visual conversion.
williamr@4
  1098
     * @param aSecondIndex Last subcell not to use logical-to-visual conversion.
williamr@4
  1099
     */
williamr@4
  1100
    void SetWordWrappedSubcellIndices( TInt aFirstIndex, TInt aSecondIndex );
williamr@4
  1101
williamr@4
  1102
    /**
williamr@4
  1103
     * Sets the size of the subcell's icon.
williamr@4
  1104
     *
williamr@4
  1105
     * @internal
williamr@4
  1106
     * @param aIndex Subcell to modify.
williamr@4
  1107
     * @param aSize New size for the icon.
williamr@4
  1108
     */
williamr@4
  1109
    IMPORT_C void SetSubCellIconSize(TInt aIndex, TSize aSize);
williamr@4
  1110
williamr@4
  1111
    /**
williamr@4
  1112
     * Gets the size of the subcell's icon.
williamr@4
  1113
     *
williamr@4
  1114
     * @internal
williamr@4
  1115
     * @param aIndex Subcell to query.
williamr@4
  1116
     * @return Size of the subcell's icon.
williamr@4
  1117
     */
williamr@4
  1118
    TSize GetSubCellIconSize(TInt aIndex);
williamr@4
  1119
williamr@4
  1120
    /**
williamr@4
  1121
     * Create and set the defaul skin context. Needed by the dynamic skin support.
williamr@4
  1122
     *
williamr@4
  1123
     * @internal
williamr@4
  1124
     * @panic EAknPanicNullPointer Panics if @c iExtension has not been defined.
williamr@4
  1125
     */
williamr@4
  1126
    void SetupSkinContextL();
williamr@4
  1127
williamr@4
  1128
    /**
williamr@4
  1129
     * Sets a text color if enhanced skin support is available.
williamr@4
  1130
     *
williamr@4
  1131
     * @internal
williamr@4
  1132
     * @param aIndex Index Number of text color in @c TAknsQsnTextColorsIndex.
williamr@4
  1133
     * @see @c TAknsQsnTextColorsIndex.
williamr@4
  1134
     */
williamr@4
  1135
    void SetESSTextColor( TAknsQsnTextColorsIndex aIndex );
williamr@4
  1136
williamr@4
  1137
    /**
williamr@4
  1138
     * Set a highlighted text color if enhanced skin support is available.
williamr@4
  1139
     *
williamr@4
  1140
     * @internal
williamr@4
  1141
     * @param aIndex Index Number of text color in @c TAknsQsnTextColorsIndex.
williamr@4
  1142
     * @see @c TAknsQsnTextColorsIndex.
williamr@4
  1143
     */
williamr@4
  1144
    void SetESSHighlightedTextColor( TAknsQsnTextColorsIndex aIndex );
williamr@4
  1145
williamr@4
  1146
    /**
williamr@4
  1147
     * Set window line layout for the defined sub cell.
williamr@4
  1148
     *
williamr@4
  1149
     * @internal
williamr@4
  1150
     * @param aSubCell Target cell for which the layout is changed.
williamr@4
  1151
     * @param aGraphicLayout The new layout.
williamr@4
  1152
     */
williamr@4
  1153
    void SetGraphicSubCellL(TInt aSubCell, const TAknWindowLineLayout& aGraphicLayout);
williamr@4
  1154
    
williamr@4
  1155
    /**
williamr@4
  1156
     * Support for new layouts.
williamr@4
  1157
     *
williamr@4
  1158
     * Set text line layout for the defined sub cell.
williamr@4
  1159
     *
williamr@4
  1160
     * @internal
williamr@4
  1161
     * @param aSubCell Target cell.
williamr@4
  1162
     * @param aTextLayout The new layout. 
williamr@4
  1163
     */
williamr@4
  1164
    void SetTextSubCellL(TInt aSubCell,const TAknTextLineLayout& aTextLayout);
williamr@4
  1165
williamr@4
  1166
williamr@4
  1167
    /**
williamr@4
  1168
     * Support for new layouts.
williamr@4
  1169
     *
williamr@4
  1170
     * @internal
williamr@4
  1171
     * Changes setting of a graphical sub cell which is contained by the 
williamr@4
  1172
     * defined text sub cell. 
williamr@4
  1173
     *
williamr@4
  1174
     * @param aSubCell Target text sub cell.
williamr@4
  1175
     * @param aTextLayout New text layout. 
williamr@4
  1176
     * @param aAffectedSubCell The graphical sub cell affected by the change. 
williamr@4
  1177
     */
williamr@4
  1178
    void SetConditionalSubCellL(TInt aSubCell,
williamr@4
  1179
                                const TAknTextLineLayout& aTextLayout,
williamr@4
  1180
                                TInt aAffectedSubCell);
williamr@4
  1181
williamr@4
  1182
    /**
williamr@4
  1183
    * Checks if the list box uses scalable layouts.
williamr@4
  1184
    *
williamr@4
  1185
    * @internal
williamr@4
  1186
    */
williamr@4
  1187
    TBool UsesScalableLayoutData() const;
williamr@4
  1188
    /**
williamr@4
  1189
    * @internal. Do NOT use.
williamr@4
  1190
    */
williamr@4
  1191
    void  UseScalableLayoutData( TBool aUse );
williamr@4
  1192
        
williamr@4
  1193
    /**
williamr@4
  1194
    * @internal
williamr@4
  1195
    */
williamr@4
  1196
    void SetStretchableGraphicSubCellL(TInt aSubCell, 
williamr@4
  1197
                                       const TAknWindowComponentLayout& aNormalLayout, 
williamr@4
  1198
                                       const TAknWindowComponentLayout& aStretchedLayout);
williamr@4
  1199
    /**
williamr@4
  1200
    * @internal
williamr@4
  1201
    */
williamr@4
  1202
    void SetStretchableTextSubCellL(TInt aSubCell,                                      
williamr@4
  1203
                                       const TAknTextComponentLayout& aNormalLayout, 
williamr@4
  1204
                                       const TAknTextComponentLayout& aStretchedLayout);
williamr@4
  1205
    /**
williamr@4
  1206
    * @internal
williamr@4
  1207
    */
williamr@4
  1208
    void SetStretchableConditionalSubCellL(TInt aSubCell,
williamr@4
  1209
                                           const TAknTextComponentLayout& aNormalLayout,
williamr@4
  1210
                                           const TAknTextComponentLayout& aStretchedLayout,
williamr@4
  1211
                                           TInt aNormalSubCell,
williamr@4
  1212
                                           TInt aStretchedSubCell );
williamr@4
  1213
    /**
williamr@4
  1214
    * @internal
williamr@4
  1215
    */
williamr@4
  1216
    void ResetSLSubCellArray();                                           
williamr@4
  1217
williamr@4
  1218
    /**
williamr@4
  1219
    * @internal
williamr@4
  1220
    */
williamr@4
  1221
    void EnableStretching(const TBool aEnabled);
williamr@4
  1222
    /**
williamr@4
  1223
    * @internal
williamr@4
  1224
    */
williamr@4
  1225
    TBool StretchingEnabled() const;
williamr@4
  1226
    /**
williamr@4
  1227
    * @internal
williamr@4
  1228
    */
williamr@4
  1229
    void HideSecondRow(const TBool aHide);
williamr@4
  1230
    /**
williamr@4
  1231
    * @internal
williamr@4
  1232
    */
williamr@4
  1233
    TBool SecondRowHidden() const;
williamr@4
  1234
    /**
williamr@4
  1235
    * @internal
williamr@4
  1236
    */
williamr@4
  1237
    void SubCellsMightIntersect( const TBool aMightIntersect );
williamr@4
  1238
williamr@4
  1239
    // Drop shadows can be toggled on/off in
williamr@4
  1240
    // "transparent" lists (eg. transparent camera setting page).
williamr@4
  1241
    // ETrue = on, EFalse = off
williamr@4
  1242
    /**
williamr@4
  1243
    * @internal
williamr@4
  1244
    */
williamr@4
  1245
    void ToggleDropShadows( const TBool aEnable );
williamr@4
  1246
williamr@4
  1247
    // changes tactile feedback behaviour
williamr@4
  1248
    // ETrue  - feedback for any item
williamr@4
  1249
    // EFalse - feedback for focused item only
williamr@4
  1250
    /**
williamr@4
  1251
    * @internal
williamr@4
  1252
    */
williamr@4
  1253
    void SetFeedbackForAllItems( TBool aFeedbackForAllItems );
williamr@4
  1254
    // gets tactile feedback behaviour
williamr@4
  1255
    // ETrue  - feedback for any item
williamr@4
  1256
    // EFalse - feedback for focused item only
williamr@4
  1257
    /**
williamr@4
  1258
    * @internal
williamr@4
  1259
    */
williamr@4
  1260
    TBool FeedbackForAllItems();
williamr@4
  1261
williamr@4
  1262
    /**
williamr@4
  1263
    * Returns ETrue if kinetic scrolling is enabled.
williamr@4
  1264
    * @internal
williamr@4
  1265
    * @since S60 5.0
williamr@4
  1266
    * @return ETrue if kinetic scrolling feature is enabled.
williamr@4
  1267
    */
williamr@4
  1268
    TBool KineticScrollingEnabled() const;
williamr@4
  1269
    
williamr@4
  1270
    /**
williamr@4
  1271
    * Returns instance of CEikListBox.
williamr@4
  1272
    * @internal
williamr@4
  1273
    * @since S60 5.0
williamr@4
  1274
    * @return Instance of CEikListBox.
williamr@4
  1275
    */
williamr@4
  1276
    CEikListBox* ListBox() const;
williamr@4
  1277
williamr@4
  1278
    
williamr@4
  1279
private:
williamr@4
  1280
    void DoConstructL( const TAknsItemID& aAnimationIID );
williamr@4
  1281
williamr@4
  1282
    const TColors &Colors(TInt aItemIndex, TInt aSubCell) const;
williamr@4
  1283
    TInt LastSubCell() const;
williamr@4
  1284
    void AddSubCellL(TInt aSubCell);
williamr@4
  1285
    SSubCell& At(TInt aArrayIndex);
williamr@4
  1286
    const SSubCell& At(TInt aArrayIndex) const;
williamr@4
  1287
    TInt FindSubCellIndex(TInt& aArrayIndex,TInt aSubCell) const;
williamr@4
  1288
    void FindSubCellIndexOrAddL(TInt& aArrayIndex,TInt aSubCell);
williamr@4
  1289
    TInt AddActualFontL(const CFont* aBaseFont);
williamr@4
  1290
    void SetUnderlineStyle( TListItemProperties aProperties, CWindowGc& aGc, TInt aSubCell ) const;
williamr@4
  1291
    void CheckIfSubCellsIntersect( TAknTextLineLayout* aLayouts, TBool* aResults, const TDesC& aText, const TRect& aItemRect ) const;
williamr@4
  1292
williamr@4
  1293
private:
williamr@4
  1294
    CArrayFix<SSubCell>* iSubCellArray;
williamr@4
  1295
    CArrayPtr<CGulIcon>* iIconArray;
williamr@4
  1296
    friend class CFormattedCellListBoxItemDrawer; // this is for "lastsubcell" -access.
williamr@4
  1297
    TColors defaultcolors;
williamr@4
  1298
    CFormattedCellListBoxDataExtension *iExtension; 
williamr@4
  1299
    };
williamr@4
  1300
williamr@4
  1301
// CLASS DECLARATION
williamr@4
  1302
/**
williamr@4
  1303
* CSettingItemEditingListBoxData draws list items for setting page
williamr@4
  1304
* Special feature of this class is the rectangular style of highlight used in 
williamr@4
  1305
* settings
williamr@4
  1306
*
williamr@4
  1307
* @lib avkon
williamr@4
  1308
*/
williamr@4
  1309
class CSettingItemEditingListBoxData : public CFormattedCellListBoxData
williamr@4
  1310
    {
williamr@4
  1311
public:
williamr@4
  1312
    IMPORT_C static CSettingItemEditingListBoxData* NewL();
williamr@4
  1313
    IMPORT_C virtual void Draw(TListItemProperties aProperties,
williamr@4
  1314
                   CWindowGc& aGc,
williamr@4
  1315
                   const TDesC* aText,
williamr@4
  1316
                   const TRect& aRect,
williamr@4
  1317
                   TBool aHighlight,
williamr@4
  1318
                   const TColors& aColors) const;
williamr@4
  1319
    };
williamr@4
  1320
williamr@4
  1321
// CLASS DECLARATION
williamr@4
  1322
/**
williamr@4
  1323
* CSettingItemEditingListBoxData draws list items for form popup fields
williamr@4
  1324
* Special feature of this class is the rectangular style of highlight used in 
williamr@4
  1325
* popup fields.
williamr@4
  1326
*
williamr@4
  1327
* @lib avkon
williamr@4
  1328
*/
williamr@4
  1329
class CFormGraphicListBoxData : public CFormattedCellListBoxData
williamr@4
  1330
    {
williamr@4
  1331
public:
williamr@4
  1332
    IMPORT_C static CFormGraphicListBoxData* NewL();
williamr@4
  1333
    IMPORT_C virtual void Draw(TListItemProperties aProperties,
williamr@4
  1334
                   CWindowGc& aGc,
williamr@4
  1335
                   const TDesC* aText,
williamr@4
  1336
                   const TRect& aRect,
williamr@4
  1337
                   TBool aHighlight,
williamr@4
  1338
                   const TColors& aColors) const;
williamr@4
  1339
    };
williamr@4
  1340
williamr@4
  1341
williamr@4
  1342
// CLASS DECLARATION
williamr@4
  1343
/**
williamr@4
  1344
* CPopupFormattedListBoxData draws list items for popup windows
williamr@4
  1345
* Special feature of this class is the narrower style of highlight used in 
williamr@4
  1346
* popups.
williamr@4
  1347
*
williamr@4
  1348
* @lib avkon
williamr@4
  1349
*/
williamr@4
  1350
class CPopupFormattedListBoxData : public CFormattedCellListBoxData
williamr@4
  1351
    {
williamr@4
  1352
public:
williamr@4
  1353
    IMPORT_C static CPopupFormattedListBoxData* NewL();
williamr@4
  1354
    IMPORT_C virtual void Draw(TListItemProperties aProperties,
williamr@4
  1355
                   CWindowGc& aGc,
williamr@4
  1356
                   const TDesC* aText,
williamr@4
  1357
                   const TRect& aRect,
williamr@4
  1358
                   TBool aHighlight,
williamr@4
  1359
                   const TColors& aColors) const;
williamr@4
  1360
    };
williamr@4
  1361
williamr@4
  1362
/**
williamr@4
  1363
 * CPopupFormattedListBoxData draws list items for grids.
williamr@4
  1364
 * Special feature of this class is the rectangular highlight used in grids.
williamr@4
  1365
 *
williamr@4
  1366
 * @lib avkon
williamr@4
  1367
  */
williamr@4
  1368
class CFormattedCellGridData : public CFormattedCellListBoxData
williamr@4
  1369
    {
williamr@4
  1370
williamr@4
  1371
public:
williamr@4
  1372
williamr@4
  1373
    /**
williamr@4
  1374
     * Symbian two-phase constructor.
williamr@4
  1375
     */
williamr@4
  1376
    IMPORT_C static CFormattedCellGridData* NewL();
williamr@4
  1377
 
williamr@4
  1378
    /**
williamr@4
  1379
     * From @c CFormattedCellListBoxData.
williamr@4
  1380
     *
williamr@4
  1381
     * This is the only method that needs to be implemented in this class and
williamr@4
  1382
     * it draws the whole list item.
williamr@4
  1383
     *
williamr@4
  1384
     * @param aProperties Properties attached to the list item.
williamr@4
  1385
     * @param aGc Graphics Context used for drawing the list item.
williamr@4
  1386
     * @param aText A text string describing the list item cells.
williamr@4
  1387
     * @param aRect The area of the screen for the whole list item.
williamr@4
  1388
     * @param aHighlight Whether the list item is selected.
williamr@4
  1389
     * @param aColors The colors used for drawing the item.
williamr@4
  1390
     */
williamr@4
  1391
    IMPORT_C virtual void Draw(TListItemProperties aProperties,
williamr@4
  1392
                               CWindowGc& aGc,
williamr@4
  1393
                               const TDesC* aText,
williamr@4
  1394
                               const TRect& aRect,
williamr@4
  1395
                               TBool aHighlight,
williamr@4
  1396
                               const TColors& aColors) const;
williamr@4
  1397
    };
williamr@4
  1398
williamr@4
  1399
#endif  // __EIKFRLBD_H__
williamr@4
  1400