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