dependencies/extended_skin_api/AknsEffectAnim.h
author MattD <mattd@symbian.org>
Thu, 01 Apr 2010 14:59:15 +0100
branchv5backport
changeset 50 d717d18a59d5
parent 34 1494d39c2fee
permissions -rw-r--r--
Made a minor error with all the messing around with aknlayout.lag which meant it got performed on the default branch.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
     1
/*
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
     2
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
     3
* All rights reserved.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
     4
* This component and the accompanying materials are made available
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
     6
* which accompanies this distribution, and is available
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
     8
*
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
     9
* Initial Contributors:
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    11
*
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    12
* Contributors:
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    13
*
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    14
* Description:  ?Description
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    15
*
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    16
*/
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    17
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    18
#ifndef AKNSEFFECTANIM_H
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    19
#define AKNSEFFECTANIM_H
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    20
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    21
// INCLUDE FILES
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    22
#include <gdi.h> // For TDisplayMode
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    23
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    24
// CONSTANTS
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    25
enum TAknsAnimState
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    26
    {
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    27
    EAknsAnimStateStopped       = 0,
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    28
    EAknsAnimStateRunning       = 1,
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    29
    EAknsAnimStatePaused        = 2,
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    30
    EAknsAnimStateFinished      = 3
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    31
    };
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    32
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    33
// In milliseconds
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    34
const TInt KAknsEffectAnimDefaultIdleInterval = 333;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    35
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    36
// FORWARD DECLARATIONS
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    37
class CFbsBitGc;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    38
class CWindowGc;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    39
class CBitmapContext;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    40
class CFbsBitmap;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    41
class TAknsItemID;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    42
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    43
class CAknsAlAnimatorBmp;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    44
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    45
// CLASS DECLARATION
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    46
/**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    47
* Animation user must implement this interface to receive notification when a
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    48
* new animation frame is ready to be drawn.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    49
*
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    50
* @since 3.0
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    51
*/
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    52
class MAknsEffectAnimObserver
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    53
    {
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    54
    public:
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    55
        /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    56
        * Animation frame is ready to be drawn.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    57
        *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    58
        * @param aError  KErrNone if frame has been succesfully created and is
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    59
        *   available for drawing. If !KErrNone the animation has internally
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    60
        *   failed.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    61
        * @param aAnimId  Reserved for future use
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    62
        */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    63
        virtual void AnimFrameReady( TInt aError, TInt aAnimId ) = 0;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    64
    };
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    65
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    66
// CLASS DECLARATION
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    67
/**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    68
* Animation controller for using effect animations.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    69
*
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    70
* @since 3.0
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    71
*/
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    72
class CAknsEffectAnim: public CBase
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    73
    {
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    74
public: // Constructors
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    75
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    76
    * Creates a new animation controller. Full construction requires a call to
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    77
    * ConstructFromSkinL. Leaves with KErrNotSupported if highlight animations
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    78
    * have been disabled, see AknsUtils::SetAvkonHighlightAnimationEnabledL.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    79
    *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    80
    * @param aObserver Must be non-NULL
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    81
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    82
    IMPORT_C static CAknsEffectAnim* NewL( MAknsEffectAnimObserver* aObserver );
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    83
    IMPORT_C virtual ~CAknsEffectAnim();
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    84
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    85
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    86
    * Constructs animation from skin item. Leaves if animation construction
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    87
    * fails.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    88
    * @param aItemID Animation skin item ID
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    89
    * @return ETrue if the animation was found from the skin, EFalse if it was
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    90
    *         not found.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    91
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    92
    IMPORT_C TBool ConstructFromSkinL( const TAknsItemID& aItemID );
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    93
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    94
private:
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    95
    CAknsEffectAnim();
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    96
    void ConstructL( MAknsEffectAnimObserver* aObserver );
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    97
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    98
public: // Interface for using the animation
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
    99
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   100
    * Starts the animation from the very beginning.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   101
    *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   102
    * @return Error code, KErrNone if operation was succesfull. If returned
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   103
    *   error code != KErrNone the operation has failed (OOM, internal
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   104
    *   misconfiguration etc). Recommended action is to delete the animation
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   105
    *   and fall back to normal rendering. Returns KErrNotReady if input layers
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   106
    *   have not been configured.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   107
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   108
    IMPORT_C TInt Start();
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   109
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   110
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   111
    * Stops the animation. Input layers are released, output layer is kept.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   112
    *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   113
    * @return Error code, KErrNone if operation was succesfull. If returned
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   114
    *   error code != KErrNone the operation has failed (OOM, internal
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   115
    *   misconfiguration etc). Recommended action is to delete the animation
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   116
    *   and fall back to normal rendering.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   117
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   118
    IMPORT_C TInt Stop();
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   119
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   120
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   121
    * Pauses the animation. Input layers are not released.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   122
    *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   123
    * @return Error code, KErrNone if operation was succesfull. If returned
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   124
    *   error code != KErrNone the operation has failed (OOM, internal
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   125
    *   misconfiguration etc). Recommended action is to delete the animation
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   126
    *   and fall back to normal rendering.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   127
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   128
    IMPORT_C TInt Pause();
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   129
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   130
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   131
    * Continues the animation from the state where it was paused.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   132
    *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   133
    * @return Error code, KErrNone if operation was succesfull. If returned
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   134
    *   error code != KErrNone the operation has failed (OOM, internal
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   135
    *   misconfiguration etc). Recommended action is to delete the animation
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   136
    *   and fall back to normal rendering.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   137
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   138
    IMPORT_C TInt Continue();
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   139
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   140
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   141
    * @return The current state of animation. Possible state values are
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   142
    * described in TAknsAnimState.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   143
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   144
    IMPORT_C TInt State();
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   145
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   146
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   147
    * Renders the current animation frame with the provided graphics context.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   148
    * The animation may have an output mask. The output mask will be used in
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   149
    * the rendering if it exists. Otherwise nonmasked renderig will be used.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   150
    * Rendering will use BitBlt. For more specialized rendering use the exposed
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   151
    * output bitmaps.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   152
    *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   153
    * @param aGc The graphics context used for rendering.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   154
    * @param aGcRect The frame is blit to this rectangle on the graphics
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   155
    *   context target.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   156
    * @return ETrue if rendering was successfull, EFalse otherwise.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   157
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   158
    IMPORT_C TBool Render( CFbsBitGc& aGc, const TRect& aGcRect ) const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   159
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   160
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   161
    * Similar to the other Render, this version is just for the window graphics
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   162
    * context.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   163
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   164
    IMPORT_C TBool Render( CWindowGc& aGc, const TRect& aGcRect ) const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   165
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   166
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   167
    * Similar to the other renders, this version is just for the bitmap
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   168
    * graphics context.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   169
    *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   170
    * @since 3.1
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   171
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   172
    IMPORT_C TBool Render( CBitmapContext& aGc, const TRect& aGcRect ) const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   173
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   174
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   175
    * @return The current animation output frame. Can be NULL if e.g. called
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   176
    *         before configuring animation layers.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   177
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   178
    IMPORT_C const CFbsBitmap* OutputRgb() const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   179
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   180
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   181
    * @return The current animation output frame mask. Output mask is optional
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   182
    *         --> can be NULL at any given time.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   183
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   184
    IMPORT_C const CFbsBitmap* OutputAlpha() const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   185
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   186
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   187
    * @return The minimum allowed size of animation.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   188
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   189
    IMPORT_C TSize MinimumSize() const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   190
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   191
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   192
    * @return The current size of animation.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   193
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   194
    IMPORT_C TSize Size() const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   195
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   196
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   197
    * @return ETrue if input layer is required for correct rendering but it is
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   198
    *         not currently present.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   199
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   200
    IMPORT_C TBool NeedsInputLayer() const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   201
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   202
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   203
    * Starts configuring input layers, should be called prior to Begin() and
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   204
    * Continue() to restore input layers to animation. Configure sequence is as
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   205
    * follows:
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   206
    * 1. Call BeginConfigLayers to start configuration
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   207
    * 2. Use InputRgbGc and InputAlphaGc to prepare input layers
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   208
    * 3. Call EndConfigLayers to end configuration
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   209
    *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   210
    * @param aNewSize  The layer size, must be larger than or equal to minimum
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   211
    *   size. Providing size smaller than minimum size will lead to leave with
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   212
    *   KErrArgument.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   213
    * @param aAboutToStart If animation is about to be started or continued
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   214
    *   after layer configuration this should be set to ETrue (to keep input
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   215
    *   layers). Otherwise EFalse should be used.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   216
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   217
    IMPORT_C void BeginConfigInputLayersL( const TSize& aNewSize,
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   218
                                           TBool aAboutToStart );
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   219
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   220
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   221
    * Graphics context for drawing the input layer RGB. Can be NULL, in this
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   222
    * case animation is not expecting input layer.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   223
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   224
    IMPORT_C CFbsBitGc* InputRgbGc() const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   225
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   226
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   227
    * Graphics context for drawing the input layer alpha. Can be NULL, in this
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   228
    * case animation is not expecting input layer alpha.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   229
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   230
    IMPORT_C CFbsBitGc* InputAlphaGc() const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   231
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   232
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   233
    * Ends layer configuration.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   234
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   235
    IMPORT_C void EndConfigInputLayersL();
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   236
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   237
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   238
    * Renders the output layer once without notifying the animation observer.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   239
    * Doesn't set animator error state if fails.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   240
    * @return The status of rendering, if KErrNone rendering was ok, if
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   241
    *         !KErrNone either rendering failed or animator is already in
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   242
    *         error state.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   243
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   244
    IMPORT_C TInt UpdateOutput();
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   245
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   246
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   247
    * When animation is idling it won't update the actual animation. Observer
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   248
    * AnimFrameReady will be called when idle timer timeouts. Animation
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   249
    * observer should check there whether or not animation is idling and ignore
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   250
    * redraw calls caused by idling.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   251
    *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   252
    * Only animations in state EAknsAnimStateRunning can be set idling. Setting
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   253
    * idling causes the animation to go in paused state. Trying to idle
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   254
    * animation in any other state will be silently ignored. Also, idling is
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   255
    * interrupted when animation is started, stoppped, paused or continued.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   256
    * Idling is not interrupted if the animation is resized when being idled.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   257
    * Idling can be reset, e.g. calling SetIdling multiple times is ok.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   258
    *
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   259
    * @param aInterval Idling interval in milliseconds. Using the default value
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   260
    *                  KAknsEffectAnimDefaultIdleInterval is recommended.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   261
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   262
    IMPORT_C void SetIdling( TInt aIntervalMs );
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   263
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   264
    /**
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   265
    * @return ETrue if animation is idling, EFalse otherwise.
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   266
    */
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   267
    IMPORT_C TBool IsIdling() const;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   268
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   269
private:
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   270
    CAknsAlAnimatorBmp* iAnim;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   271
    TInt iAboutToStart;
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   272
    };
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   273
1494d39c2fee added few more dependencies
kashif.sayed
parents:
diff changeset
   274
#endif // AKNSEFFECTANIM_H