9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: Calendar state machine |
14 * Description: Calendar state machine |
15 * |
15 * |
16 */ |
16 */ |
17 |
|
18 |
17 |
19 |
18 |
20 // includes |
19 // includes |
21 #include "calenbackgroundstate.h" |
20 #include "calenbackgroundstate.h" |
22 #include "calendarui_debug.h" // Debug macros |
21 #include "calendarui_debug.h" // Debug macros |
107 break; |
106 break; |
108 case ECalenEventView: |
107 case ECalenEventView: |
109 SetCurrentState(aStateMachine,CCalenStateMachine::ECalenViewingState); |
108 SetCurrentState(aStateMachine,CCalenStateMachine::ECalenViewingState); |
110 cmdUsed = ETrue; |
109 cmdUsed = ETrue; |
111 break; |
110 break; |
112 case ECalenEventViewFromAlarm: |
111 case ECalenFasterAppExit: |
113 case ECalenEventViewFromAlarmStopOnly: |
112 if(iPreviousState == CCalenStateMachine::ECalenDeletingState) |
114 SetCurrentState(aStateMachine,CCalenStateMachine::ECalenAlarmState); |
|
115 cmdUsed = ETrue; |
|
116 break; |
|
117 case ECalenFasterAppExit: |
|
118 if(iPreviousState == CCalenStateMachine::ECalenMapState) |
|
119 { |
|
120 // Issue map launch cancel notification |
|
121 iController.BroadcastNotification(ECalenNotifyCancelMapLaunch); |
|
122 SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState ); |
|
123 ActivateCurrentStateL(aStateMachine); |
|
124 cmdUsed = ETrue; |
|
125 break; |
|
126 } |
|
127 else if(iPreviousState == CCalenStateMachine::ECalenDeletingState) |
|
128 { |
113 { |
129 // Issue ECalenNotifyDeleteFailed notification to cancel the delete |
114 // Issue ECalenNotifyDeleteFailed notification to cancel the delete |
130 iController.BroadcastNotification(ECalenNotifyDeleteFailed); |
115 iController.BroadcastNotification(ECalenNotifyDeleteFailed); |
131 SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState ); |
116 SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState ); |
132 ActivateCurrentStateL(aStateMachine); |
117 ActivateCurrentStateL(aStateMachine); |
133 cmdUsed = ETrue; |
118 cmdUsed = ETrue; |
134 } |
119 } |
135 else if( iPreviousState == CCalenStateMachine::ECalenSettingsState |
120 else |
|
121 { |
|
122 if( iPreviousState == CCalenStateMachine::ECalenSettingsState |
136 || iPreviousState == CCalenStateMachine::ECalenEditingState |
123 || iPreviousState == CCalenStateMachine::ECalenEditingState |
137 || iPreviousState == CCalenStateMachine::ECalenSendingState |
124 || iPreviousState == CCalenStateMachine::ECalenSendingState ) |
138 || iPreviousState == CCalenStateMachine::ECalenIdleState |
125 { |
139 || iPreviousState == CCalenStateMachine::ECalenViewingState) |
126 SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState ); |
140 { |
127 ActivateCurrentStateL(aStateMachine); |
141 SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState ); |
128 cmdUsed = ETrue; |
142 ActivateCurrentStateL(aStateMachine); |
129 } |
143 cmdUsed = ETrue; |
130 } |
144 } |
|
145 default: |
131 default: |
146 break; |
132 break; |
147 } |
133 } |
148 if(cmdUsed) |
134 |
149 RequestCallbackL( handler, aCommand ); |
135 RequestCallbackL( handler, aCommand ); |
150 |
136 |
151 TRACE_EXIT_POINT; |
137 TRACE_EXIT_POINT; |
152 return cmdUsed; |
138 return cmdUsed; |
153 } |
139 } |