idlehomescreen/widgetmanager/inc/wmeffectmanager.h
branchRCL_3
changeset 83 5456b4e8b3a8
equal deleted inserted replaced
82:5f0182e07bfb 83:5456b4e8b3a8
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies)..
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * CImageConverter declaration
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef WMEFFECTMANAGER_H
       
    20 #define WMEFFECTMANAGER_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 
       
    25 class CCoeEnv;
       
    26 class CAlfEffectObserver;
       
    27 
       
    28 // CONSTANTS
       
    29 // Effects
       
    30 const TInt KAppStartEffectStyle = 1007;
       
    31 const TInt KAppExitEffectStyle = 1008;
       
    32 
       
    33 /**
       
    34  *  Struct which holds needed info of effect.
       
    35  */
       
    36 NONSHARABLE_STRUCT( TWmEffect )
       
    37     {
       
    38     TInt iState;
       
    39     TInt iType;
       
    40     TInt iId;
       
    41     };
       
    42 
       
    43 /**
       
    44  *  Effect manager.
       
    45  *  Handles starting and ending effects.
       
    46  *
       
    47  *  @since S60 v5.0
       
    48  */
       
    49 NONSHARABLE_CLASS( CWmEffectManager ) : public CBase
       
    50     {
       
    51 public:
       
    52     /**
       
    53      * Two-phased constructor.
       
    54      * @return new instance of CWmEffectManager.
       
    55      */
       
    56     static CWmEffectManager* NewL( CCoeEnv& aCoeEnv );
       
    57 
       
    58     /**
       
    59      * Destructor.
       
    60      */
       
    61     ~CWmEffectManager();
       
    62     
       
    63 public:
       
    64     /**
       
    65      * Begin handling of fullscreen effect.
       
    66      * @param aId effect id
       
    67      */
       
    68     void BeginFullscreenEffectL( TInt aId );
       
    69     
       
    70     /**
       
    71      * When UiRendered is called effect is ended and will be drawn
       
    72      */
       
    73     void UiRendered();
       
    74     
       
    75     /**
       
    76      * Returns true if effect is ongoing.
       
    77      */
       
    78     TBool IsEffectActive();
       
    79     
       
    80 private:    
       
    81     /**
       
    82      * C++ default constructor.
       
    83      */
       
    84     CWmEffectManager( CCoeEnv& aCoeEnv );
       
    85 
       
    86     /**
       
    87      * By default Symbian 2nd phase constructor is private.
       
    88      */
       
    89     void ConstructL();
       
    90     
       
    91 private:
       
    92     /**
       
    93      * Starts fullscreen effect.
       
    94      * @param aEffect effect data
       
    95      * @return ETrue if effect is started, EFalse otherwise.
       
    96      */
       
    97     TBool DoBeginFullscreenEffect( TWmEffect& aEffect );
       
    98     
       
    99     /**
       
   100      * Waits ongoing effect to complete.
       
   101      * @param aInterval Time to wait for complete.
       
   102      * @return ETrue if effect completed in given time, EFalse otherwise.
       
   103      */
       
   104     TBool WaitActiveEffect( TInt aInterval );
       
   105     
       
   106     /**
       
   107      * Removes and destroys effect from effect list.
       
   108      * @param aEffect effect data
       
   109      */
       
   110     void RemoveEffect( TWmEffect* aEffect );
       
   111     
       
   112 private: // data
       
   113     /**
       
   114      * List of started effects.
       
   115      */
       
   116     RPointerArray<TWmEffect> iEffects;
       
   117     
       
   118     /**
       
   119      * COE env
       
   120      */
       
   121     CCoeEnv& iCoeEnv;
       
   122     
       
   123     /**
       
   124      * Effect observer
       
   125      */
       
   126     CAlfEffectObserver* iObserver;
       
   127     };
       
   128 
       
   129 #endif // WMEFFECTMANAGER_H
       
   130 
       
   131 // End of file