epoc32/include/mw/aknsdrawutils.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
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@2
     1
/*
williamr@2
     2
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  Defines a public static class AknsDrawUtils and related 
williamr@2
    15
*                constants.
williamr@2
    16
*
williamr@2
    17
*/
williamr@2
    18
williamr@2
    19
williamr@2
    20
#ifndef AKNSDRAWUTILS_H
williamr@2
    21
#define AKNSDRAWUTILS_H
williamr@2
    22
williamr@2
    23
// INCLUDES
williamr@2
    24
#include <AknsUtils.h>
williamr@2
    25
williamr@2
    26
// CONSTANTS
williamr@2
    27
williamr@2
    28
/**
williamr@2
    29
* Default value for drawing parameters.
williamr@2
    30
*
williamr@2
    31
* @since 2.0
williamr@2
    32
*/
williamr@2
    33
static const TInt KAknsDrawParamDefault                 = 0x0;
williamr@2
    34
williamr@2
    35
/**
williamr@2
    36
* Drawing parameter that limits processing of layout levels to the first one.
williamr@2
    37
* This can be used to temporarily disable secondary layout levels.
williamr@2
    38
*
williamr@2
    39
* @since 2.0
williamr@2
    40
*/
williamr@2
    41
static const TInt KAknsDrawParamLimitToFirstLevel       = 0x1;
williamr@2
    42
williamr@2
    43
/**
williamr@2
    44
* Drawing parameter that suspends clearing under images. Only the first
williamr@2
    45
* layout level is affected.
williamr@2
    46
*
williamr@2
    47
* @since 2.0
williamr@2
    48
*/
williamr@2
    49
static const TInt KAknsDrawParamNoClearUnderImage       = 0x2;
williamr@2
    50
williamr@2
    51
/**
williamr@2
    52
* Drawing parameter that causes the layouts and bitmaps to be prepared,
williamr@2
    53
* but no actual drawing takes place.
williamr@2
    54
*
williamr@2
    55
* @since 2.8
williamr@2
    56
*/
williamr@2
    57
static const TInt KAknsDrawParamPrepareOnly             = 0x04;
williamr@2
    58
williamr@2
    59
/**
williamr@2
    60
* Drawing parameter that draws only the RGB channel of data.
williamr@2
    61
*
williamr@2
    62
* @since 3.0
williamr@2
    63
*/
williamr@2
    64
static const TInt KAknsDrawParamRGBOnly                 = 0x8;
williamr@2
    65
williamr@2
    66
/**
williamr@2
    67
* Drawing parameter that draws only the alpha channel of data. If the data
williamr@2
    68
* is unmasked, the result is undefined.
williamr@2
    69
*
williamr@2
    70
* @since 3.0
williamr@2
    71
*/
williamr@2
    72
static const TInt KAknsSDMAlphaOnly                     = 0x10;
williamr@2
    73
/**
williamr@2
    74
* Drawing parameter that allows empty SCALABLEITEMS to use
williamr@2
    75
* the parent bitmap directly
williamr@2
    76
*
williamr@2
    77
* @since 3.0
williamr@2
    78
*/
williamr@2
    79
static const TInt KAknsDrawParamChained                     = 0x20;
williamr@2
    80
williamr@2
    81
/**
williamr@2
    82
* Forces drawing the bottom level in chain to use RGBOnly. Bottom level is the
williamr@2
    83
* first drawn level, visually the bottom most level.
williamr@2
    84
*
williamr@2
    85
* @since 3.0
williamr@2
    86
*/
williamr@2
    87
static const TInt KAknsDrawParamBottomLevelRGBOnly            = 0x40;
williamr@2
    88
williamr@2
    89
/**
williamr@2
    90
* Ignores layer mask when drawing layers.
williamr@2
    91
*
williamr@2
    92
* @since 3.2
williamr@2
    93
*/
williamr@2
    94
williamr@2
    95
static const TInt KAknsDrawParamIgnoreLayerMask               = 0x80;
williamr@2
    96
williamr@2
    97
/**
williamr@2
    98
* Direction, from where notes and queries slide to the screen.
williamr@2
    99
*
williamr@2
   100
* @since 3.1
williamr@2
   101
*/
williamr@2
   102
enum TSlidingMode
williamr@2
   103
    {
williamr@2
   104
    /** Sliding is disabled either by skin or compile time */
williamr@2
   105
    ESlidingDisabled = 0,
williamr@2
   106
williamr@2
   107
    /** Slide from the CBA side */
williamr@2
   108
    ESlidingFromCBA,
williamr@2
   109
williamr@2
   110
    /** Slide from left */
williamr@2
   111
    ESlidingFromLeft,
williamr@2
   112
williamr@2
   113
    /** Slide from topleft */
williamr@2
   114
    ESlidingFromTopLeft, 
williamr@2
   115
williamr@2
   116
    /** Slide from top */
williamr@2
   117
    ESlidingFromTop,
williamr@2
   118
williamr@2
   119
    /** Slide from topright */
williamr@2
   120
    ESlidingFromTopRight, 
williamr@2
   121
williamr@2
   122
    /** Slide from right */
williamr@2
   123
    ESlidingFromRight, 
williamr@2
   124
williamr@2
   125
    /** Slide from bottomright */
williamr@2
   126
    ESlidingFromBottomRight, 
williamr@2
   127
williamr@2
   128
    /** Slide from bottom */
williamr@2
   129
    ESlidingFromBottom, 
williamr@2
   130
williamr@2
   131
    /** Slide from bottomleft */
williamr@2
   132
    ESlidingFromBottomLeft,
williamr@2
   133
williamr@2
   134
    /** Slide from random direction (any of the 8 directions) */
williamr@2
   135
    ESlidingFromRandom
williamr@2
   136
    };
williamr@2
   137
williamr@2
   138
williamr@2
   139
// FORWARD DECLARATIONS
williamr@2
   140
class MAknsSkinInstance;
williamr@2
   141
class MAknsControlContext;
williamr@2
   142
class CWindowGc;
williamr@2
   143
class CFbsBitGc;
williamr@2
   144
class CCoeControl;
williamr@2
   145
williamr@2
   146
// CLASS DECLARATION
williamr@2
   147
williamr@2
   148
/**
williamr@2
   149
* Static utility class to support Avkon Skins drawing operations.
williamr@2
   150
* AknsDrawUtils provides utility methods to perform skin-aware drawing
williamr@2
   151
* operations, such as background drawing.
williamr@2
   152
*
williamr@2
   153
* This is a public static class with exported functions.
williamr@2
   154
* The class is not intended for derivation outside the library.
williamr@2
   155
*
williamr@2
   156
* @lib AknSkins.lib
williamr@2
   157
*
williamr@2
   158
* @since 2.0
williamr@2
   159
*/
williamr@2
   160
class AknsDrawUtils
williamr@2
   161
    {
williamr@2
   162
    public: // New functions        
williamr@2
   163
williamr@2
   164
        /**
williamr@2
   165
        * Returns pointer to the current control context.
williamr@2
   166
        * If aMop parameter is specified retrieves the nearest control context
williamr@2
   167
        * in control hierarchy. If none is found (or @c NULL parameter was
williamr@2
   168
        * given) returns @c NULL.
williamr@2
   169
        *
williamr@2
   170
        * @since 2.0
williamr@2
   171
        *
williamr@2
   172
        * @param aMop Object provider to be used to find the control context
williamr@2
   173
        *   or @c NULL.
williamr@2
   174
        *
williamr@2
   175
        * @return Pointer to the nearest control context or @c NULL if none 
williamr@2
   176
        *   was found.
williamr@2
   177
        */
williamr@2
   178
        IMPORT_C static MAknsControlContext* ControlContext( 
williamr@2
   179
            const MObjectProvider* aMop );
williamr@2
   180
williamr@2
   181
        /**
williamr@2
   182
        * Returns pointer to the control context of the parent of the given
williamr@2
   183
        * control. The context possibly supplied by the control itself is ignored.
williamr@2
   184
        *
williamr@2
   185
        * @since 2.6
williamr@2
   186
        *
williamr@2
   187
        * @param aControl Pointer to CCoeControl or @c NULL.
williamr@2
   188
        *
williamr@2
   189
        * @return Pointer to the nearest control context of the parent control
williamr@2
   190
        *   or @c NULL if none was found.
williamr@2
   191
        */
williamr@2
   192
        IMPORT_C static MAknsControlContext* ControlContextOfParent( 
williamr@2
   193
            const CCoeControl* aControl );
williamr@2
   194
williamr@2
   195
        /**
williamr@2
   196
        * Draws background with assumed origin.
williamr@2
   197
        * Draws bacground to the specified rectangle. Origin is assumed
williamr@2
   198
        * to be (0,0). This overload can not be used with parent absolute 
williamr@2
   199
        * layouts.
williamr@2
   200
        *
williamr@2
   201
        * See @c DrawBackground for details on chained layouts.
williamr@2
   202
        *
williamr@2
   203
        * @since 2.0
williamr@2
   204
        *
williamr@2
   205
        * @param aInstance Pointer to skin instance as obtained from
williamr@2
   206
        *   AknsUtils::SkinInstance(). If @c NULL rectangle is cleared
williamr@2
   207
        *   without bitmap.
williamr@2
   208
        *
williamr@2
   209
        * @param aContext Control context to obtain context specific 
williamr@2
   210
        *   information about background drawing. If @c NULL and skin
williamr@2
   211
        *   instance was given, default parameters are used.
williamr@2
   212
        *
williamr@2
   213
        * @param aGc Graphics context to be used for drawing.
williamr@2
   214
        *
williamr@2
   215
        * @param aRect Rectangle to be drawn.
williamr@2
   216
        *
williamr@2
   217
        * @return ETrue if background was drawn with a bitmap, EFalse
williamr@2
   218
        *   otherwise.
williamr@2
   219
        */
williamr@2
   220
        IMPORT_C static TBool Background( MAknsSkinInstance* aInstance,
williamr@2
   221
            MAknsControlContext* aContext, CWindowGc& aGc, const TRect& aRect );
williamr@2
   222
williamr@2
   223
        /**
williamr@2
   224
        * Draws background with proper origin.
williamr@2
   225
        * Draws bacground to the specified rectangle. The origin is queried
williamr@2
   226
        * from the control position list (if given using 
williamr@2
   227
        * AknsUtils::RegisterControlPosition). If not found, the origin is
williamr@2
   228
        * queried from the given control, which may result in a window server
williamr@2
   229
        * flush.
williamr@2
   230
        *
williamr@2
   231
        * See @c DrawBackground for details on chained layouts.
williamr@2
   232
        *
williamr@2
   233
        * @since 2.0
williamr@2
   234
        *
williamr@2
   235
        * @param aInstance Pointer to skin instance as obtained from
williamr@2
   236
        *   AknsUtils::SkinInstance(). If @c NULL rectangle is cleared
williamr@2
   237
        *   without bitmap.
williamr@2
   238
        *
williamr@2
   239
        * @param aContext Control context to obtain context specific 
williamr@2
   240
        *   information about background drawing. Must be specified, if
williamr@2
   241
        *   aInstance is not @c NULL.
williamr@2
   242
        *
williamr@2
   243
        * @param aControl Control that knows the current window.
williamr@2
   244
        *   Must be specified if parent absolute layout can be used,
williamr@2
   245
        *   otherwise @c NULL may be given.
williamr@2
   246
        *
williamr@2
   247
        * @param aGc Graphics context to be used for drawing.
williamr@2
   248
        *
williamr@2
   249
        * @param aRect Rectangle to be drawn.
williamr@2
   250
        *
williamr@2
   251
        * @return ETrue if background was drawn with a bitmap, EFalse
williamr@2
   252
        *   otherwise. Note that many scalable skins implicitly define
williamr@2
   253
        *   background bitmaps for seemingly blank areas.
williamr@2
   254
        */
williamr@2
   255
        IMPORT_C static TBool Background( MAknsSkinInstance* aInstance,
williamr@2
   256
            MAknsControlContext* aContext, const CCoeControl* aControl,
williamr@2
   257
            CWindowGc& aGc, const TRect& aRect );
williamr@2
   258
williamr@2
   259
        /**
williamr@2
   260
        * Draws background with proper origin and drawing parameters.
williamr@2
   261
        * Draws bacground to the specified rectangle. The origin is queried
williamr@2
   262
        * from the control position list (if given using 
williamr@2
   263
        * AknsUtils::RegisterControlPosition). If not found, the origin is
williamr@2
   264
        * queried from the given control, which may result in a window server
williamr@2
   265
        * flush. Drawing parameters may be used to control drawing.
williamr@2
   266
        *
williamr@2
   267
        * See @c DrawBackground for details on chained layouts.
williamr@2
   268
        *
williamr@2
   269
        * @since 2.0
williamr@2
   270
        *
williamr@2
   271
        * @param aInstance Pointer to skin instance as obtained from
williamr@2
   272
        *   AknsUtils::SkinInstance(). If @c NULL rectangle is cleared
williamr@2
   273
        *   without bitmap.
williamr@2
   274
        *
williamr@2
   275
        * @param aContext Control context to obtain context specific 
williamr@2
   276
        *   information about background drawing. Must be specified, if
williamr@2
   277
        *   aInstance is not @c NULL.
williamr@2
   278
        *
williamr@2
   279
        * @param aControl Control that knows the current window.
williamr@2
   280
        *   Must be specified if parent absolute layout can be used,
williamr@2
   281
        *   otherwise @c NULL may be given.
williamr@2
   282
        *
williamr@2
   283
        * @param aGc Graphics context to be used for drawing.
williamr@2
   284
        *
williamr@2
   285
        * @param aRect Rectangle to be drawn.
williamr@2
   286
        *
williamr@2
   287
        * @param aDrawParam Bitwise combination of drawing parameters. 
williamr@2
   288
        *   @c KAknsDrawParamDefault should be used if no special handling 
williamr@2
   289
        *   is required.
williamr@2
   290
        *
williamr@2
   291
        * @return ETrue if background was drawn with a bitmap, EFalse
williamr@2
   292
        *   otherwise. Note that many scalable skins implicitly define
williamr@2
   293
        *   background bitmaps for seemingly blank areas.
williamr@2
   294
        */
williamr@2
   295
        IMPORT_C static TBool Background( MAknsSkinInstance* aInstance,
williamr@2
   296
            MAknsControlContext* aContext, const CCoeControl* aControl,
williamr@2
   297
            CWindowGc& aGc, const TRect& aRect, const TInt aDrawParam );
williamr@2
   298
williamr@2
   299
        /**
williamr@2
   300
        * Draws background to the given graphics context.
williamr@2
   301
        * The origin is queried from the control position list (if given using
williamr@2
   302
        * AknsUtils::RegisterControlPosition). If not found, the origin is
williamr@2
   303
        * queried from the given control, which may result in a window server
williamr@2
   304
        * flush.
williamr@2
   305
        *
williamr@2
   306
        * If background contains multiple layers, they are drawn in the
williamr@2
   307
        * sequence specified by the context. If multiple contexts are chained
williamr@2
   308
        * (using @c SetParentContext), they are drawn in reverse order, i.e.
williamr@2
   309
        * the context given as parameter to this method call is drawn last.
williamr@2
   310
        *
williamr@2
   311
        * Drawing parameter KAknsDrawParamNoClearUnderImage is automatically
williamr@2
   312
        * assumed for all the chained contexts, except the deepest one.
williamr@2
   313
        *
williamr@2
   314
        * @since 2.0
williamr@2
   315
        *
williamr@2
   316
        * @param aInstance Pointer to skin instance as obtained from
williamr@2
   317
        *   AknsUtils::SkinInstance(). If @c NULL rectangle is cleared
williamr@2
   318
        *   without bitmap.
williamr@2
   319
        *
williamr@2
   320
        * @param aContext Control context to obtain context specific 
williamr@2
   321
        *   information about background drawing. Must be specified, if
williamr@2
   322
        *   aInstance is not @c NULL.
williamr@2
   323
        *
williamr@2
   324
        * @param aControl Control that knows the current window.
williamr@2
   325
        *   Must be specified if parent absolute layout can be used,
williamr@2
   326
        *   otherwise @c NULL may be given.
williamr@2
   327
        *
williamr@2
   328
        * @param aGc Graphics context to be used for drawing.
williamr@2
   329
        *
williamr@2
   330
        * @param aDstPos Destination position (top-left corner of the area
williamr@2
   331
        *   to be drawn) in graphics context coordinate system.
williamr@2
   332
        *
williamr@2
   333
        * @param aControlRect Rectangle (in the control coordinate system) 
williamr@2
   334
        *   to be drawn.
williamr@2
   335
        *
williamr@2
   336
        * @param aDrawParam Bitwise combination of drawing parameters. 
williamr@2
   337
        *   @c KAknsDrawParamDefault should be used if no special handling 
williamr@2
   338
        *   is required.
williamr@2
   339
        *
williamr@2
   340
        * @return ETrue if background was drawn with a bitmap, EFalse
williamr@2
   341
        *   otherwise. Note that many scalable skins implicitly define
williamr@2
   342
        *   background bitmaps for seemingly blank areas.
williamr@2
   343
        */
williamr@2
   344
        IMPORT_C static TBool DrawBackground( MAknsSkinInstance* aInstance,
williamr@2
   345
            MAknsControlContext* aContext, const CCoeControl* aControl,
williamr@2
   346
            CBitmapContext& aGc, const TPoint& aDstPos,
williamr@2
   347
            const TRect& aControlRect, const TInt aDrawParam );
williamr@2
   348
williamr@2
   349
        /**
williamr@2
   350
        * Draws background between rects.
williamr@2
   351
        * Draws bacground between specified rectangles. Origin is assumed
williamr@2
   352
        * to be (0,0).
williamr@2
   353
        *
williamr@2
   354
        * See @c DrawBackground for details on chained layouts.
williamr@2
   355
        *
williamr@2
   356
        * @since 2.0
williamr@2
   357
        *
williamr@2
   358
        * @param aInstance Pointer to skin instance as obtained from
williamr@2
   359
        *   AknsUtils::SkinInstance(). If @c NULL rectangle is cleared
williamr@2
   360
        *   without bitmap.
williamr@2
   361
        *
williamr@2
   362
        * @param aContext Control context to obtain context specific 
williamr@2
   363
        *   information about background drawing. If @c NULL and skin
williamr@2
   364
        *   instance was given, default parameters are used.
williamr@2
   365
        *
williamr@2
   366
        * @param aGc Graphics context to be used for drawing.
williamr@2
   367
        *
williamr@2
   368
        * @param aOuterRect Outer rectangle.
williamr@2
   369
        *
williamr@2
   370
        * @param aInnerRect Inner rectangle.
williamr@2
   371
        *
williamr@2
   372
        * @return ETrue if background was drawn with a bitmap, EFalse
williamr@2
   373
        *   otherwise. Note that many scalable skins implicitly define
williamr@2
   374
        *   background bitmaps for seemingly blank areas.
williamr@2
   375
        */
williamr@2
   376
        IMPORT_C static TBool BackgroundBetweenRects( 
williamr@2
   377
            MAknsSkinInstance* aInstance,
williamr@2
   378
            MAknsControlContext* aContext, CWindowGc& aGc, 
williamr@2
   379
            const TRect& aOuterRect,const TRect& aInnerRect );
williamr@2
   380
williamr@2
   381
        /**
williamr@2
   382
        * Draws background between rects.
williamr@2
   383
        * Draws bacground between specified rectangles. 
williamr@2
   384
        *
williamr@2
   385
        * See @c DrawBackground for details on chained layouts.
williamr@2
   386
        *
williamr@2
   387
        * @since 2.0
williamr@2
   388
        *
williamr@2
   389
        * @param aInstance Pointer to skin instance as obtained from
williamr@2
   390
        *   AknsUtils::SkinInstance(). If @c NULL rectangle is cleared
williamr@2
   391
        *   without bitmap.
williamr@2
   392
        *
williamr@2
   393
        * @param aContext Control context to obtain context specific 
williamr@2
   394
        *   information about background drawing. Must be specified if
williamr@2
   395
        *   aInstance is not @c NULL.
williamr@2
   396
        *
williamr@2
   397
        * @param aControl Control that knows the current window.
williamr@2
   398
        *   Must be specified if parent absolute layout can be used,
williamr@2
   399
        *   otherwise @c NULL may be given.
williamr@2
   400
        *
williamr@2
   401
        * @param aGc Graphics context to be used for drawing.
williamr@2
   402
        *
williamr@2
   403
        * @param aOuterRect Outer rectangle.
williamr@2
   404
        *
williamr@2
   405
        * @param aInnerRect Inner rectangle.
williamr@2
   406
        *
williamr@2
   407
        * @return ETrue if background was drawn with a bitmap, EFalse
williamr@2
   408
        *   otherwise. Note that many scalable skins implicitly define
williamr@2
   409
        *   background bitmaps for seemingly blank areas.
williamr@2
   410
        */
williamr@2
   411
        IMPORT_C static TBool BackgroundBetweenRects( 
williamr@2
   412
            MAknsSkinInstance* aInstance,
williamr@2
   413
            MAknsControlContext* aContext, const CCoeControl* aControl, 
williamr@2
   414
            CWindowGc& aGc, 
williamr@2
   415
            const TRect& aOuterRect,const TRect& aInnerRect );
williamr@2
   416
williamr@2
   417
        /**
williamr@2
   418
        * Draws background between rects.
williamr@2
   419
        * Draws bacground between specified rectangles with drawing parameters. 
williamr@2
   420
        *
williamr@2
   421
        * @since 2.0
williamr@2
   422
        *
williamr@2
   423
        * @param aInstance Pointer to skin instance as obtained from
williamr@2
   424
        *   AknsUtils::SkinInstance(). If @c NULL rectangle is cleared
williamr@2
   425
        *   without bitmap.
williamr@2
   426
        *
williamr@2
   427
        * @param aContext Control context to obtain context specific 
williamr@2
   428
        *   information about background drawing. Must be specified if
williamr@2
   429
        *   aInstance is not @c NULL.
williamr@2
   430
        *
williamr@2
   431
        * @param aControl Control that knows the current window.
williamr@2
   432
        *   Must be specified if parent absolute layout can be used,
williamr@2
   433
        *   otherwise @c NULL may be given.
williamr@2
   434
        *
williamr@2
   435
        * @param aGc Graphics context to be used for drawing.
williamr@2
   436
        *
williamr@2
   437
        * @param aOuterRect Outer rectangle.
williamr@2
   438
        *
williamr@2
   439
        * @param aInnerRect Inner rectangle.
williamr@2
   440
        *
williamr@2
   441
        * @param aDrawParam Bitwise combination of drawing parameters. 
williamr@2
   442
        *   @c KAknsDrawParamDefault should be used if no special handling 
williamr@2
   443
        *   is required.
williamr@2
   444
        *
williamr@2
   445
        * @return ETrue if background was drawn with a bitmap, EFalse
williamr@2
   446
        *   otherwise. Note that many scalable skins implicitly define
williamr@2
   447
        *   background bitmaps for seemingly blank areas.
williamr@2
   448
        */
williamr@2
   449
        IMPORT_C static TBool BackgroundBetweenRects( 
williamr@2
   450
            MAknsSkinInstance* aInstance,
williamr@2
   451
            MAknsControlContext* aContext, const CCoeControl* aControl, 
williamr@2
   452
            CWindowGc& aGc, 
williamr@2
   453
            const TRect& aOuterRect, const TRect& aInnerRect, 
williamr@2
   454
            const TInt aDrawParam );
williamr@2
   455
williamr@2
   456
        /**
williamr@2
   457
        * Determines whether background drawing would be done with
williamr@2
   458
        * a bitmap (deprecated).
williamr@2
   459
        *
williamr@2
   460
        * @param aInstance Pointer to skin instance. If @c NULL,
williamr@2
   461
        *   method returns EFalse.
williamr@2
   462
        *
williamr@2
   463
        * @param aContext Control context, or @c NULL if no context 
williamr@2
   464
        *   is used. Note that absence of control context affects
williamr@2
   465
        *   the result.
williamr@2
   466
        *
williamr@2
   467
        * @return @c ETrue if background would be drawn with a bitmap,
williamr@2
   468
        *   @c EFalse otherwise. If a scalable skin is currently active,
williamr@2
   469
        *   the return value is undefined, and does not necessarily
williamr@2
   470
        *   reflect the return value of the actual drawing operation.
williamr@2
   471
        *
williamr@2
   472
        * @deprecated This method is deprecated as of release 2.8.
williamr@2
   473
        *   Use the return values of background drawing functions to
williamr@2
   474
        *   determine whether the background was drawn with skinned
williamr@2
   475
        *   content. The return value is always ETrue starting from
williamr@2
   476
        *   rel 3.1
williamr@2
   477
        */
williamr@2
   478
        IMPORT_C static TBool HasBitmapBackground(
williamr@2
   479
            MAknsSkinInstance* aInstance,
williamr@2
   480
            MAknsControlContext* aContext );
williamr@2
   481
williamr@2
   482
        /**
williamr@2
   483
        * Draws a cached image (with its attributes specified in the skin)
williamr@2
   484
        * to the given rectangle.
williamr@2
   485
        *
williamr@2
   486
        * @param aInstance Pointer to the skin instance. If @c NULL,
williamr@2
   487
        *   the method returns immediately.
williamr@2
   488
        *
williamr@2
   489
        * @param aGc Graphics context to be used for drawing.
williamr@2
   490
        *
williamr@2
   491
        * @param aRect Rectangle specifying the pane used for drawing. The
williamr@2
   492
        *   image is laid out within the rectangle.
williamr@2
   493
        *
williamr@2
   494
        * @param aID Item ID of the image to be drawn.
williamr@2
   495
        */
williamr@2
   496
        IMPORT_C static void DrawCachedImage( MAknsSkinInstance* aInstance,
williamr@2
   497
            CWindowGc& aGc, const TRect& aRect, const TAknsItemID& aID );
williamr@2
   498
williamr@2
   499
        /**
williamr@2
   500
        * Draws a cached image (with its attributes specified in the skin)
williamr@2
   501
        * to the given rectangle in an off-screen graphics context.
williamr@2
   502
        *
williamr@2
   503
        * @since 2.8
williamr@2
   504
        *
williamr@2
   505
        * @param aInstance Pointer to the skin instance. If @c NULL,
williamr@2
   506
        *   the method returns immediately.
williamr@2
   507
        *
williamr@2
   508
        * @param aGc Bitmapped graphics context to be used for drawing.
williamr@2
   509
        *
williamr@2
   510
        * @param aRect Rectangle specifying the pane used for drawing. The
williamr@2
   511
        *   image is laid out within the rectangle.
williamr@2
   512
        *
williamr@2
   513
        * @param aID Item ID of the image to be drawn.
williamr@2
   514
        */
williamr@2
   515
        IMPORT_C static void DrawCachedImage( MAknsSkinInstance* aInstance,
williamr@2
   516
            CFbsBitGc& aGc, const TRect& aRect, const TAknsItemID& aID );
williamr@2
   517
williamr@2
   518
        /**
williamr@2
   519
        * Draws a frame (with cached images) to the specified area.
williamr@2
   520
        *
williamr@2
   521
        * @param aInstance Pointer to the skin instance. If @c NULL, the 
williamr@2
   522
        *   method returns EFalse.
williamr@2
   523
        *
williamr@2
   524
        * @param aGc Graphics context to be used for drawing.
williamr@2
   525
        *
williamr@2
   526
        * @param aOuterRect Outer rectangle of the frame. Frame elements
williamr@2
   527
        *   will be drawn within this rectangle.
williamr@2
   528
        *
williamr@2
   529
        * @param aInnerRect Inner rectangle of the frame. Frame center 
williamr@2
   530
        *   will be drawn within this rectangle.
williamr@2
   531
        *
williamr@2
   532
        * @param aFrameID Item ID of the entire frame.
williamr@2
   533
        *
williamr@2
   534
        * @param aCenterID Item ID of the center part of the frame. If
williamr@2
   535
        *   @c KAknsIIDNone, no center will be drawn. If @c KAknsIIDDefault,
williamr@2
   536
        *   the default value from the frame itself will be used. Other values,
williamr@2
   537
        *   the item to be used for the center part. If the frame is 
williamr@2
   538
        *   specified as 1 part graphics in the skin instead of 9 part
williamr@2
   539
        *   graphics, this parameter has no effect.
williamr@2
   540
        *
williamr@2
   541
        * @return EFalse, if the frame was not drawn at all. ETrue, if the
williamr@2
   542
        *   frame was (at least partially) drawn.
williamr@2
   543
        */
williamr@2
   544
        IMPORT_C static TBool DrawFrame( MAknsSkinInstance* aInstance,
williamr@2
   545
            CWindowGc& aGc, const TRect& aOuterRect, const TRect& aInnerRect, 
williamr@2
   546
            const TAknsItemID& aFrameID, const TAknsItemID& aCenterID );
williamr@2
   547
williamr@2
   548
        /**
williamr@2
   549
        * Prepares the frame graphics for drawing. This function should be
williamr@2
   550
        * called when the frame sizes are known and in places where Flushing
williamr@2
   551
        * the Window server buffer will not cause flicker. For example, a
williamr@2
   552
        * good place to call PrepareFrame() would be controls SizeChanged 
williamr@2
   553
        * function. Altough its not mandatory to call PrepareFrame()
williamr@2
   554
        * before DrawFrame(), it's highly recommended in order to avoid
williamr@2
   555
        * unnecessary flushes in the middle of the actual drawing routine. 
williamr@2
   556
        *
williamr@2
   557
        * Note that the rect parameters must be exactly the same for
williamr@2
   558
        * PrepareFrame and subsequent DrawFrame calls. Otherwise the 
williamr@2
   559
        * DrawFrame functions will cause a flush, which leads
williamr@2
   560
        * to flicker.
williamr@2
   561
        *
williamr@2
   562
        * @since 2.8
williamr@2
   563
        *
williamr@2
   564
        * @param aInstance Pointer to the skin instance. If @c NULL, the 
williamr@2
   565
        *   method returns EFalse.
williamr@2
   566
        *
williamr@2
   567
        * @param aOuterRect Outer rectangle of the frame. Frame elements
williamr@2
   568
        *   are scaled to this size.
williamr@2
   569
        *
williamr@2
   570
        * @param aInnerRect Inner rectangle of the frame. Frame center 
williamr@2
   571
        *   is scaled to this size
williamr@2
   572
        *
williamr@2
   573
        * @param aFrameID Item ID of the entire frame.
williamr@2
   574
        *
williamr@2
   575
        * @param aCenterID Item ID of the center part of the frame. If
williamr@2
   576
        *   @c KAknsIIDNone, no center part will be prepared.
williamr@2
   577
        *   If @c KAknsIIDDefault, the default value from the frame
williamr@2
   578
        *   itself will be used. Other values, the item to be used 
williamr@2
   579
        *   for the center part. If the frame is specified as 1 part
williamr@2
   580
        *   graphics in the skin instead of 9 part graphics, this
williamr@2
   581
        *   parameter has no effect.
williamr@2
   582
        *
williamr@2
   583
        * @return EFalse, if were nothing to prepare. ETrue, if the
williamr@2
   584
        *   frame was (at least partially) prepared.
williamr@2
   585
        */
williamr@2
   586
        IMPORT_C static TBool PrepareFrame( MAknsSkinInstance* aInstance,
williamr@2
   587
            const TRect& aOuterRect, const TRect& aInnerRect, 
williamr@2
   588
            const TAknsItemID& aFrameID, const TAknsItemID& aCenterID);
williamr@2
   589
williamr@2
   590
        /**
williamr@2
   591
        * Draws a frame (with cached images) to the specified area
williamr@2
   592
        * in an off-screen graphics context.
williamr@2
   593
        *
williamr@2
   594
        * @since 2.8
williamr@2
   595
        *
williamr@2
   596
        * @param aInstance Pointer to the skin instance. If @c NULL, the 
williamr@2
   597
        *   method returns EFalse.
williamr@2
   598
        *
williamr@2
   599
        * @param aGc Bitmapped graphics context to be used for drawing.
williamr@2
   600
        *
williamr@2
   601
        * @param aOuterRect Outer rectangle of the frame. Frame elements
williamr@2
   602
        *   will be drawn within this rectangle.
williamr@2
   603
        *
williamr@2
   604
        * @param aInnerRect Inner rectangle of the frame. Frame center 
williamr@2
   605
        *   will be drawn within this rectangle.
williamr@2
   606
        *
williamr@2
   607
        * @param aFrameID Item ID of the entire frame.
williamr@2
   608
        *
williamr@2
   609
        * @param aCenterID Item ID of the center part of the frame. If
williamr@2
   610
        *   @c KAknsIIDNone, no center will be drawn. If @c KAknsIIDDefault,
williamr@2
   611
        *   the default value from the frame itself will be used. Other values,
williamr@2
   612
        *   the item to be used for the center part. If unsure, specify
williamr@2
   613
        *   @c KAknsIIDDefault. If the frame is specified as 1 part 
williamr@2
   614
        *   graphics in the skin instead of 9 part graphics, this 
williamr@2
   615
        *   parameter has no effect.
williamr@2
   616
        *
williamr@2
   617
        * @param aDrawParam Bitwise combination of drawing parameters. 
williamr@2
   618
        *   @c KAknsDrawParamDefault should be used if no special handling 
williamr@2
   619
        *   is required.
williamr@2
   620
        *
williamr@2
   621
        * @return EFalse, if the frame was not drawn at all. ETrue, if the
williamr@2
   622
        *   frame was (at least partially) drawn.
williamr@2
   623
        */
williamr@2
   624
        IMPORT_C static TBool DrawFrame( MAknsSkinInstance* aInstance,
williamr@2
   625
            CFbsBitGc& aGc, const TRect& aOuterRect, const TRect& aInnerRect, 
williamr@2
   626
            const TAknsItemID& aFrameID, const TAknsItemID& aCenterID,
williamr@2
   627
            const TInt aDrawParam );
williamr@2
   628
williamr@2
   629
        /**
williamr@2
   630
        * Draws a frame (with cached images) to the specified area
williamr@2
   631
        * in an off-screen graphics context.
williamr@2
   632
        *
williamr@2
   633
        * @since 2.8
williamr@2
   634
        *
williamr@2
   635
        * @param aInstance Pointer to the skin instance. If @c NULL, the 
williamr@2
   636
        *   method returns EFalse.
williamr@2
   637
        *
williamr@2
   638
        * @param aGc Bitmapped graphics context to be used for drawing.
williamr@2
   639
        *
williamr@2
   640
        * @param aOuterRect Outer rectangle of the frame. Frame elements
williamr@2
   641
        *   will be drawn within this rectangle.
williamr@2
   642
        *
williamr@2
   643
        * @param aInnerRect Inner rectangle of the frame. Frame center 
williamr@2
   644
        *   will be drawn within this rectangle.
williamr@2
   645
        *
williamr@2
   646
        * @param aFrameID Item ID of the entire frame.
williamr@2
   647
        *
williamr@2
   648
        * @param aCenterID Item ID of the center part of the frame. If
williamr@2
   649
        *   @c KAknsIIDNone, no center will be drawn. If @c KAknsIIDDefault,
williamr@2
   650
        *   the default value from the frame itself will be used. Other values,
williamr@2
   651
        *   the item to be used for the center part. If unsure, specifi
williamr@2
   652
        *   @c KAknsIIDDefault. If the frame is specified as 1 part 
williamr@2
   653
        *   graphics in the skin instead of 9 part graphics, this
williamr@2
   654
        *   parameter has no effect.
williamr@2
   655
        *
williamr@2
   656
        * @return EFalse, if the frame was not drawn at all. ETrue, if the
williamr@2
   657
        *   frame was (at least partially) drawn.
williamr@2
   658
        */
williamr@2
   659
        IMPORT_C static TBool DrawFrame( MAknsSkinInstance* aInstance,
williamr@2
   660
            CFbsBitGc& aGc, const TRect& aOuterRect, const TRect& aInnerRect, 
williamr@2
   661
            const TAknsItemID& aFrameID, const TAknsItemID& aCenterID );
williamr@2
   662
williamr@2
   663
        /**
williamr@2
   664
        * Draws the specified part of the frame (with a cached image) to the
williamr@2
   665
        * specified rectangle.
williamr@2
   666
        *
williamr@2
   667
        * @par Compatibility note:
williamr@2
   668
        * Prior to Series 60 release 2.8, the entire outer rectangle could
williamr@2
   669
        * be given as the rectangle of a corner part. Due to scalable UI
williamr@2
   670
        * compatibility, this is no longer supported in release 2.8, and thus
williamr@2
   671
        * the exact corner rectangle is required. This funtion may not
williamr@2
   672
        * function correctly if the skin specifies the frame as 1 part
williamr@2
   673
        * graphics.
williamr@2
   674
        *
williamr@2
   675
        * @param aInstance Pointer to the skin instance. If @c NULL, the 
williamr@2
   676
        *   method returns @c EFalse.
williamr@2
   677
        *
williamr@2
   678
        * @param aGc Graphics context to be used for drawing.
williamr@2
   679
        *
williamr@2
   680
        * @param aRect Rectangle for drawing. This must be the rectangle
williamr@2
   681
        *   of the specific part of the drawn that will be drawn, e.g.
williamr@2
   682
        *   top-left corner rectangle if the top-left corner is being drawn.
williamr@2
   683
        *
williamr@2
   684
        * @param aFrameID Item ID of the entire frame.
williamr@2
   685
        *
williamr@2
   686
        * @param aFrameElement Element (index) of the frame element to
williamr@2
   687
        *   be drawn.
williamr@2
   688
        *
williamr@2
   689
        * @return ETrue, if the element was drawn. EFalse otherwise.
williamr@2
   690
        */
williamr@2
   691
        IMPORT_C static TBool DrawFramePart( MAknsSkinInstance* aInstance,
williamr@2
   692
            CWindowGc& aGc, const TRect& aRect, const TAknsItemID& aFrameID,
williamr@2
   693
            const TAknsFrameElementIndex aFrameElement );
williamr@2
   694
williamr@2
   695
        /**
williamr@2
   696
        * Returns a boolean value indicating whether list separator lines
williamr@2
   697
        * should be drawn.
williamr@2
   698
        *
williamr@2
   699
        * This method checks:
williamr@2
   700
        *  - The value of @c KAknsIIDPropertyListSeparatorLines property.
williamr@2
   701
        *  - The presence of (non-scalable) column bitmaps.
williamr@2
   702
        *       If found, @c EFalse is returned.
williamr@2
   703
        *  - The presence of generic list background (non-scalable).
williamr@2
   704
        *       If found, @c EFalse is returned.
williamr@2
   705
        *
williamr@2
   706
        * Note that the exact internal implementation of the checks is
williamr@2
   707
        * subject to change.
williamr@2
   708
        *
williamr@2
   709
        * @since 2.8
williamr@2
   710
        *
williamr@2
   711
        * @param aInstance Pointer to the skin instance. If @c NULL, 
williamr@2
   712
        *   the method returns @c ETrue.
williamr@2
   713
        *
williamr@2
   714
        * @return @c ETrue, if list separator lines should drawn. 
williamr@2
   715
        *   @c EFalse, if list separator lines should not be drawn
williamr@2
   716
        *   and, consequently, list column and slice bitmaps (if any) from the
williamr@2
   717
        *   skin content should be drawn.
williamr@2
   718
        */
williamr@2
   719
        IMPORT_C static TBool IsListSeperatorLines(
williamr@2
   720
            MAknsSkinInstance* aInstance );
williamr@2
   721
williamr@2
   722
        /**
williamr@2
   723
        * Returns an enum value indicating the way notes and queries appear
williamr@2
   724
        * to the screen (sliding animation)
williamr@2
   725
        *
williamr@2
   726
        * @since 3.1
williamr@2
   727
        *
williamr@2
   728
        * @param aInstance Pointer to the skin instance. If @c NULL, 
williamr@2
   729
        *   the method returns @c ESlidingDisabled.
williamr@2
   730
        *
williamr@2
   731
        * @return @c Sliding mode from enumeration TSlidingMode
williamr@2
   732
        */
williamr@2
   733
        IMPORT_C static TSlidingMode SlidingMode(
williamr@2
   734
            MAknsSkinInstance* aInstance );
williamr@2
   735
williamr@2
   736
    private: // Prohibited constructors and destructor
williamr@2
   737
        
williamr@2
   738
        // Construction prohibited (static class)
williamr@2
   739
        AknsDrawUtils();
williamr@2
   740
        // Destruction prohibited (static class)
williamr@2
   741
        ~AknsDrawUtils();
williamr@2
   742
    };
williamr@2
   743
williamr@2
   744
#endif // AKNSDRAWUTILS_H
williamr@2
   745
williamr@2
   746
// End of File