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 "calendeletingstate.h" |
20 #include "calendeletingstate.h" |
22 #include "calendarui_debug.h" // Debug macros |
21 #include "calendarui_debug.h" // Debug macros |
23 #include "calencontroller.h" |
22 #include "calencontroller.h" |
24 #include "calenstatemachine.h" |
23 #include "calenstatemachine.h" |
25 #include "calennotifier.h" |
24 #include "calennotifier.h" |
|
25 #include "OstTraceDefinitions.h" |
|
26 #ifdef OST_TRACE_COMPILER_IN_USE |
|
27 #include "calendeletingstateTraces.h" |
|
28 #endif |
26 |
29 |
27 // ---------------------------------------------------------------------------- |
30 // ---------------------------------------------------------------------------- |
28 // CCalenDeletingState::NewLC |
31 // CCalenDeletingState::NewLC |
29 // First stage construction |
32 // First stage construction |
30 // ---------------------------------------------------------------------------- |
33 // ---------------------------------------------------------------------------- |
31 CCalenDeletingState* CCalenDeletingState::NewLC( CCalenController& aController, |
34 CCalenDeletingState* CCalenDeletingState::NewLC( CCalenController& aController, |
32 RHashSet<TCalenNotification>& aOutstandingNotifications ) |
35 RHashSet<TCalenNotification>& aOutstandingNotifications ) |
33 { |
36 { |
34 TRACE_ENTRY_POINT; |
37 OstTraceFunctionEntry0( CCALENDELETINGSTATE_NEWLC_ENTRY ); |
35 |
38 |
36 CCalenDeletingState* self = new( ELeave ) CCalenDeletingState( aController,aOutstandingNotifications ); |
39 CCalenDeletingState* self = new( ELeave ) CCalenDeletingState( aController,aOutstandingNotifications ); |
37 |
40 |
38 CleanupStack::PushL( self ); |
41 CleanupStack::PushL( self ); |
39 self->ConstructL(); |
42 self->ConstructL(); |
40 |
43 |
41 TRACE_EXIT_POINT; |
44 OstTraceFunctionExit0( CCALENDELETINGSTATE_NEWLC_EXIT ); |
42 return self; |
45 return self; |
43 } |
46 } |
44 |
47 |
45 // ---------------------------------------------------------------------------- |
48 // ---------------------------------------------------------------------------- |
46 // CCalenDeletingState::ConstructL |
49 // CCalenDeletingState::ConstructL |
47 // Second stage construction |
50 // Second stage construction |
48 // ---------------------------------------------------------------------------- |
51 // ---------------------------------------------------------------------------- |
49 void CCalenDeletingState::ConstructL() |
52 void CCalenDeletingState::ConstructL() |
50 { |
53 { |
51 TRACE_ENTRY_POINT; |
54 OstTraceFunctionEntry0( CCALENDELETINGSTATE_CONSTRUCTL_ENTRY ); |
|
55 |
52 BaseConstructL(); |
56 BaseConstructL(); |
53 |
57 |
54 TRACE_EXIT_POINT; |
58 OstTraceFunctionExit0( CCALENDELETINGSTATE_CONSTRUCTL_EXIT ); |
55 } |
59 } |
56 |
60 |
57 // ---------------------------------------------------------------------------- |
61 // ---------------------------------------------------------------------------- |
58 // CCalenDeletingState::CCalenDeletingState |
62 // CCalenDeletingState::CCalenDeletingState |
59 // C++ Constructor |
63 // C++ Constructor |
60 // ---------------------------------------------------------------------------- |
64 // ---------------------------------------------------------------------------- |
61 CCalenDeletingState::CCalenDeletingState( CCalenController& aController, |
65 CCalenDeletingState::CCalenDeletingState( CCalenController& aController, |
62 RHashSet<TCalenNotification>& aOutstandingNotifications ) |
66 RHashSet<TCalenNotification>& aOutstandingNotifications ) |
63 : CCalenState( aController, aOutstandingNotifications ) |
67 : CCalenState( aController, aOutstandingNotifications ) |
64 { |
68 { |
65 TRACE_ENTRY_POINT; |
69 OstTraceFunctionEntry0( CCALENDELETINGSTATE_CCALENDELETINGSTATE_ENTRY ); |
66 |
70 |
67 TRACE_EXIT_POINT; |
71 OstTraceFunctionExit0( CCALENDELETINGSTATE_CCALENDELETINGSTATE_EXIT ); |
68 } |
72 } |
69 |
73 |
70 // ---------------------------------------------------------------------------- |
74 // ---------------------------------------------------------------------------- |
71 // CCalenDeletingState::CCalenDeletingState |
75 // CCalenDeletingState::CCalenDeletingState |
72 // Destructor |
76 // Destructor |
73 // ---------------------------------------------------------------------------- |
77 // ---------------------------------------------------------------------------- |
74 CCalenDeletingState::~CCalenDeletingState() |
78 CCalenDeletingState::~CCalenDeletingState() |
75 { |
79 { |
76 TRACE_ENTRY_POINT; |
80 OstTraceFunctionEntry0( DUP1_CCALENDELETINGSTATE_CCALENDELETINGSTATE_ENTRY ); |
77 |
81 |
78 TRACE_EXIT_POINT; |
82 OstTraceFunctionExit0( DUP1_CCALENDELETINGSTATE_CCALENDELETINGSTATE_EXIT ); |
79 } |
83 } |
80 |
84 |
81 // ---------------------------------------------------------------------------- |
85 // ---------------------------------------------------------------------------- |
82 // CCalenDeletingState::HandleCommandL |
86 // CCalenDeletingState::HandleCommandL |
83 // From CCalenState |
87 // From CCCalenState |
84 // ---------------------------------------------------------------------------- |
88 // ---------------------------------------------------------------------------- |
85 TBool CCalenDeletingState::HandleCommandL( const TCalenCommand& aCommand, |
89 TBool CCalenDeletingState::HandleCommandL( const TCalenCommand& aCommand, |
86 CCalenStateMachine& aStateMachine ) |
90 CCalenStateMachine& aStateMachine ) |
87 { |
91 { |
88 TRACE_ENTRY_POINT; |
92 OstTraceFunctionEntry0( CCALENDELETINGSTATE_HANDLECOMMANDL_ENTRY ); |
89 |
93 |
90 TInt cmd = aCommand.Command(); |
94 TInt cmd = aCommand.Command(); |
91 MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd ); |
95 MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd ); |
92 |
96 |
93 ASSERT( handler ); // FIXME: error ui |
97 ASSERT( handler ); // FIXME: error ui |
94 |
98 |
95 TBool cmdUsed = EFalse; |
99 TBool cmdUsed = EFalse; |
96 |
100 |
97 if(ECalenDeleteEntryWithoutQuery == cmd) |
101 if( cmd == ECalenDeleteEntryWithoutQuery ) |
98 { |
102 { |
99 RequestCallbackL( handler, aCommand ); |
103 RequestCallbackL( handler, aCommand ); |
100 cmdUsed = ETrue; |
104 cmdUsed = ETrue; |
101 } |
105 } |
102 else if(ECalenFasterAppExit == cmd) |
106 else if( ECalenFasterAppExit == cmd ) |
103 { |
107 { |
104 SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState ); |
108 SetCurrentState( aStateMachine, CCalenStateMachine::ECalenIdleState ); |
105 ActivateCurrentStateL(aStateMachine); |
109 ActivateCurrentStateL(aStateMachine); |
106 RequestCallbackL( handler, aCommand ); |
110 RequestCallbackL( handler, aCommand ); |
107 cmdUsed = ETrue; |
111 cmdUsed = ETrue; |
108 } |
112 } |
109 else if(ECalenStartActiveStep == cmd) |
|
110 { |
|
111 RequestCallbackL( handler, aCommand ); |
|
112 cmdUsed = ETrue; |
|
113 } |
|
114 |
|
115 else if(ECalenMissedEventViewFromIdle == cmd) |
|
116 { |
|
117 RequestCallbackL( handler, aCommand ); |
|
118 cmdUsed = ETrue; |
|
119 } |
|
120 else if(ECalenMissedAlarmsViewFromIdle == cmd) |
|
121 { |
|
122 RequestCallbackL( handler, aCommand ); |
|
123 cmdUsed = ETrue; |
|
124 } |
|
125 |
113 |
126 TRACE_EXIT_POINT; |
114 OstTraceFunctionExit0( CCALENDELETINGSTATE_HANDLECOMMANDL_EXIT ); |
127 return cmdUsed; |
115 return cmdUsed; |
128 } |
116 } |
129 |
117 |
130 // ---------------------------------------------------------------------------- |
118 // ---------------------------------------------------------------------------- |
131 // CCalenDeletingState::HandleNotificationL |
119 // CCalenDeletingState::HandleNotificationL |
132 // From CCalenState |
120 // From CCCalenState |
133 // ---------------------------------------------------------------------------- |
121 // ---------------------------------------------------------------------------- |
134 void CCalenDeletingState::HandleNotificationL(const TCalenNotification& aNotification, |
122 void CCalenDeletingState::HandleNotificationL(const TCalenNotification& aNotification, |
135 CCalenStateMachine& aStateMachine ) |
123 CCalenStateMachine& aStateMachine ) |
136 { |
124 { |
137 TRACE_ENTRY_POINT; |
125 OstTraceFunctionEntry0( CCALENDELETINGSTATE_HANDLENOTIFICATIONL_ENTRY ); |
138 |
126 |
139 switch( aNotification ) |
127 switch( aNotification ) |
140 { |
128 { |
141 case ECalenNotifyEntryDeleted: // issued when new entry dialog is cancelled |
129 case ECalenNotifyEntryDeleted: // issued when new entry dialog is cancelled |
142 case ECalenNotifyInstanceDeleted: |
130 case ECalenNotifyInstanceDeleted: |