29 NO_DIR, |
29 NO_DIR, |
30 FORWARD_DIR, |
30 FORWARD_DIR, |
31 BACKWARD_DIR, |
31 BACKWARD_DIR, |
32 }NavigationDir; |
32 }NavigationDir; |
33 |
33 |
34 class GlxState : public QObject |
34 class GlxState: public QObject |
35 { |
35 { |
36 Q_OBJECT |
36 Q_OBJECT |
37 |
37 |
38 public : |
38 public: |
39 /* |
39 /** |
40 * Constructor |
40 * Constructor |
41 * id = state id, state is and view id should be same |
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 |
42 * preState = previous state pointer. It value will be null, if it is only one state in the stack |
43 */ |
43 */ |
44 GlxState(qint32 id, GlxState *preState); |
44 GlxState( qint32 id, GlxState *preState ); |
45 virtual ~GlxState(); |
45 |
46 /* |
46 /** |
47 * It compare the states. |
47 * Destructor |
48 * ToDo: It is not used any where so may be removed later |
48 */ |
49 */ |
49 virtual ~GlxState(); |
50 bool compare (qint32 id) const; |
50 |
51 /* |
51 /** |
52 * Return the state id of the function |
52 * compare() - It wiil compare the states, is it same or different state. |
53 */ |
53 * @param - Id of the state |
54 qint32 id() const { return mId; } |
54 * @return - return the true if the state is same else false |
55 /* |
55 */ |
56 * Retrun the pointer of the the previous state |
56 bool compare( qint32 id ) const; |
57 */ |
57 |
58 GlxState * previousState( ) const { return mPreState; } |
58 /** |
59 /* |
59 * id() - Return the state id of the state |
60 * Pure virtual function. It is default event handler of the state |
60 * @return - return the state id of the state |
61 */ |
61 */ |
62 virtual void eventHandler(qint32 &id) = 0; |
62 qint32 id() const |
63 /* |
63 { |
64 * This funtion use for set the internal state of a state |
64 return mId; |
65 * default implementation |
65 } |
66 */ |
66 |
67 virtual void setState(int internalState) {Q_UNUSED( internalState )} |
67 /** |
68 /* |
68 * previousState() - Retrun the pointer of the the previous state |
69 * This funtion return the internal state of a state |
69 * @return - Retrun the pointer of the the previous state |
70 * default implementation |
70 */ |
71 */ |
71 GlxState * previousState() const |
72 virtual int state( ) const { return 0; } |
72 { |
73 /* |
73 return mPreState; |
74 * This function set the view transtion effect parameter. |
74 } |
75 * These values is use for run the animation for vies transtion |
75 |
76 * In the case of forward direction it should call with the next state and in the case of back ward direction |
76 /** |
77 * it should call with the current state |
77 * eventHandler() - Pure virtual function. It is default event handler of the state |
78 * effect = View transtion id |
78 * @param - command or event id |
79 * viewEffect = to play the animation on which views |
79 */ |
80 */ |
80 virtual void eventHandler( qint32 &id ) = 0; |
81 virtual void setTranstionParameter(NavigationDir dir, GlxEffect &effect, GlxViewEffect &viewEffect); |
81 |
|
82 /** |
|
83 * setState() - This funtion use for set the internal state of a state |
|
84 * default implementation |
|
85 * @param - internal state of the state |
|
86 */ |
|
87 virtual void setState( int internalState ) |
|
88 { |
|
89 Q_UNUSED( internalState ) |
|
90 } |
|
91 |
|
92 /** |
|
93 * commandId() - it will return the current runing command id |
|
94 * @reutn - command id |
|
95 */ |
|
96 virtual qint32 commandId() |
|
97 { |
|
98 return -1; |
|
99 } |
|
100 |
|
101 /** |
|
102 * state() - This funtion return the internal state of a state |
|
103 * default implementation |
|
104 * @return - internal state |
|
105 */ |
|
106 virtual int state() const |
|
107 { |
|
108 return 0; |
|
109 } |
|
110 |
|
111 /** |
|
112 * setTranstionParameter() - This function set the view transtion effect parameter. |
|
113 * These values is use for run the animation for vies transtion |
|
114 * In the case of forward direction it should call with the next state and in the case of back ward direction |
|
115 * it should call with the current state |
|
116 * @param View transtion id |
|
117 * @param to play the animation on which views |
|
118 */ |
|
119 virtual void setTranstionParameter( NavigationDir dir, GlxEffect &effect, GlxViewEffect &viewEffect ); |
82 |
120 |
83 private: |
121 private: |
84 const qint32 mId; |
122 const qint32 mId; |
85 GlxState *mPreState; //contain the pointer of previous state |
123 GlxState *mPreState; //contain the pointer of previous state |
86 }; |
124 }; |