ui/viewutilities/effectengine/inc/glxeffectengine.h
changeset 36 6481344a6d67
equal deleted inserted replaced
33:1ee2af37811f 36:6481344a6d67
       
     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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef GLXEFFECTENGINE_H
       
    20 #define GLXEFFECTENGINE_H
       
    21 
       
    22 #ifdef BUILD_GLXVIEWUTILITIES
       
    23 #define GLX_VIEWUTILITIES_EXPORT Q_DECL_EXPORT
       
    24 #else
       
    25 #define GLX_VIEWUTILITIES_EXPORT Q_DECL_IMPORT
       
    26 #endif
       
    27 
       
    28 #include <QObject>
       
    29 #include <hbeffect.h>
       
    30 #include <QString>
       
    31 #include <QHash>
       
    32 #include <QList>
       
    33 #include "glxuistd.h"
       
    34 
       
    35 
       
    36 class QStringList ;
       
    37 class GlxTransitionEffectSetting ;
       
    38 class GlxEffectPluginBase;
       
    39 class GlxEffectPluginResolver;
       
    40 
       
    41 /*
       
    42  * It is customise class for Photo Application to run the effect.
       
    43  */
       
    44 
       
    45 class GLX_VIEWUTILITIES_EXPORT GlxEffectEngine : public QObject
       
    46 {
       
    47     Q_OBJECT
       
    48     
       
    49 public:
       
    50     /*
       
    51      * Constructor
       
    52      */
       
    53     GlxEffectEngine( );
       
    54     /*
       
    55      * Destructor
       
    56      */
       
    57     ~GlxEffectEngine();
       
    58     
       
    59     /*
       
    60      * Register the item type with selected effect
       
    61      * User can change the effect at run time so it is required to register and deregister the effect
       
    62      * before playing the effect.
       
    63      */
       
    64     void registerEffect(const QString &itemType);
       
    65     
       
    66     /*
       
    67      * Deregister the current register slide show effect
       
    68      */
       
    69     void deRegisterEffect(const QString &itemType);
       
    70     
       
    71    /*  
       
    72     *  To register a set of transition effect 
       
    73     *  e.g "grid to full screeen", "fullscreen to grid"  
       
    74     */  
       
    75     void registerTransitionEffect();
       
    76     
       
    77     /*
       
    78      * Deregister the set of register transition effect
       
    79      */
       
    80     void deregistertransitionEffect();
       
    81     
       
    82     /*
       
    83      * Run the effect on single item
       
    84      */
       
    85     void runEffect(QGraphicsItem *  item, const QString &  itemType ); 
       
    86     
       
    87     /*
       
    88      * Run the effect on multiple item
       
    89      */
       
    90     void runEffect(QList< QGraphicsItem * > &  items, const QString &  itemType );
       
    91     
       
    92     /*
       
    93      * Run the transition effect 
       
    94      */
       
    95     void runEffect(QList< QGraphicsItem * > &  items, GlxEffect transitionEffect);
       
    96     
       
    97     /*
       
    98      * Cancel the runing effect on the given item
       
    99      */
       
   100     void cancelEffect(QGraphicsItem *  item);
       
   101     
       
   102     /*
       
   103      * Cancel the running effect on the given items
       
   104      */
       
   105     void cancelEffect( const QList< QGraphicsItem * > &  items );
       
   106     
       
   107     /*
       
   108      * cancel the runing transition effect
       
   109      */
       
   110     void cancelEffect(QList< QGraphicsItem * > &  items, GlxEffect transitionEffect);
       
   111     
       
   112     /*
       
   113      * Return the running status of the given item
       
   114      */
       
   115     bool isEffectRuning(QGraphicsItem *  item);
       
   116     
       
   117     /*
       
   118      * return the running status of given items
       
   119      */
       
   120     bool isEffectRuning(const QList< QGraphicsItem * > &  items);
       
   121     
       
   122 signals:
       
   123     /*
       
   124      * emit the signal of effect finished
       
   125      */
       
   126     void effectFinished();
       
   127     
       
   128 public slots:
       
   129     /*
       
   130      * Slot to monitor the slide show effect finished
       
   131      */
       
   132     void slideShowEffectFinished( const HbEffect::EffectStatus &status );
       
   133     
       
   134     /*
       
   135      * Slot to monitor the transi
       
   136      */
       
   137     void transitionEffectFinished( const HbEffect::EffectStatus &status );
       
   138 
       
   139 private:
       
   140     /*
       
   141      * Initialise the all transition effect
       
   142      */
       
   143     void initTransitionEffect();
       
   144     
       
   145     /*
       
   146      * Clear the all transition effect
       
   147      */
       
   148     void cleanTransitionEfffect();
       
   149     
       
   150 private:
       
   151     int mNbrEffectRunning;               //containe the number of effect running
       
   152     GlxEffectPluginBase *mEffectPlugin;  //No ownership
       
   153     QHash<GlxEffect, GlxTransitionEffectSetting *> mTransitionEffectList;
       
   154     GlxEffect mTransitionEffect;
       
   155     GlxEffectPluginResolver *mEffectResolver;
       
   156 };
       
   157 
       
   158 #endif /*GLXEFFECTENGINE_H*/