ui/viewmanagement/statehandler/inc/glxbasestate.h
changeset 23 74c9f037fd5d
child 71 27f2d7aec52a
equal deleted inserted replaced
5:f7f0874bfe7d 23:74c9f037fd5d
       
     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 
       
    20 #ifndef GLXBASESTATE_H
       
    21 #define GLXBASESTATE_H
       
    22 
       
    23 #include <QObject>
       
    24 #include <glxviewids.h>
       
    25 #include <glxuistd.h>
       
    26 
       
    27 typedef enum
       
    28 {
       
    29     NO_DIR,
       
    30     FORWARD_DIR,
       
    31     BACKWARD_DIR,    
       
    32 }NavigationDir;
       
    33 
       
    34 class GlxState : public QObject
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38 public :
       
    39  /*
       
    40   * Constructor
       
    41   * id = state id, state is and view id should be same
       
    42   * preState = previous state pointer. It value will be null, if it is only one state in the stack
       
    43   */
       
    44 	GlxState(qint32 id, GlxState *preState);
       
    45 	virtual ~GlxState();
       
    46 /*
       
    47  * It compare the states.
       
    48  * ToDo: It is not used any where so may be removed later
       
    49  */	
       
    50 	bool compare (qint32 id) const;
       
    51 /*
       
    52  * Return the state id of the function
       
    53  */ 
       
    54 	qint32 id() const { return mId; }
       
    55 /*
       
    56  * Retrun the pointer of the the previous state
       
    57  */ 
       
    58 	GlxState * previousState( ) const { return mPreState; }
       
    59 /*
       
    60  * Pure virtual function. It is default event handler of the state
       
    61  */	
       
    62 	virtual void eventHandler(qint32 &id)  = 0;
       
    63 /*
       
    64  * This funtion use for set the internal state of a state
       
    65  * default implementation
       
    66  */	
       
    67 	virtual void setState(int internalState) {Q_UNUSED( internalState )}
       
    68 /*
       
    69  * This funtion return the internal state of a state
       
    70  * default implementation
       
    71  */
       
    72 	virtual int state( ) const { return 0; }
       
    73 /*
       
    74  * This function set the view transtion effect parameter.
       
    75  * These values is use for run the animation for vies transtion
       
    76  * In the case of forward direction it should call with the next state and in the case of back ward direction
       
    77  * it should call with the current state
       
    78  * effect = View transtion id
       
    79  * viewEffect = to play the animation on which views
       
    80  */	
       
    81 	virtual void setTranstionParameter(NavigationDir dir, GlxEffect &effect, GlxViewEffect &viewEffect);
       
    82 
       
    83 private:
       
    84     const qint32 mId;
       
    85     GlxState *mPreState; //contain the pointer of previous state	
       
    86 };
       
    87 
       
    88 
       
    89 
       
    90 #endif /* GLXBASESTATE_H */