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 |
17 |
18 |
18 |
19 |
19 // includes |
20 // includes |
20 #include "calenpopulationstate.h" |
21 #include "calenpopulationstate.h" |
21 #include "calendarui_debug.h" // Debug macros |
22 #include "calendarui_debug.h" // Debug macros |
22 #include "calencontroller.h" |
23 #include "calencontroller.h" |
23 #include "calenstatemachine.h" |
24 #include "calenstatemachine.h" |
24 #include "calennotifier.h" |
25 #include "calennotifier.h" |
25 #include "OstTraceDefinitions.h" |
|
26 #ifdef OST_TRACE_COMPILER_IN_USE |
|
27 #include "calenpopulationstateTraces.h" |
|
28 #endif |
|
29 |
26 |
30 // ---------------------------------------------------------------------------- |
27 // ---------------------------------------------------------------------------- |
31 // CalenPopulationState::NewLC |
28 // CCalenPopulationState::NewLC |
32 // First stage construction |
29 // First stage construction |
33 // ---------------------------------------------------------------------------- |
30 // ---------------------------------------------------------------------------- |
34 CCalenPopulationState* CCalenPopulationState::NewLC( CCalenController& aController, |
31 CCalenPopulationState* CCalenPopulationState::NewLC( CCalenController& aController, |
35 RHashSet<TCalenNotification>& aOutstandingNotifications ) |
32 RHashSet<TCalenNotification>& aOutstandingNotifications ) |
36 { |
33 { |
37 OstTraceFunctionEntry0( CCALENPOPULATIONSTATE_NEWLC_ENTRY ); |
34 TRACE_ENTRY_POINT; |
38 |
35 |
39 CCalenPopulationState* self = new( ELeave ) CCalenPopulationState( aController, aOutstandingNotifications ); |
36 CCalenPopulationState* self = new( ELeave ) CCalenPopulationState( aController, aOutstandingNotifications ); |
40 CleanupStack::PushL( self ); |
37 CleanupStack::PushL( self ); |
41 self->ConstructL(); |
38 self->ConstructL(); |
42 |
39 |
43 OstTraceFunctionExit0( CCALENPOPULATIONSTATE_NEWLC_EXIT ); |
40 TRACE_EXIT_POINT; |
44 return self; |
41 return self; |
45 } |
42 } |
46 |
43 |
47 // ---------------------------------------------------------------------------- |
44 // ---------------------------------------------------------------------------- |
48 // CCalenPopulationState::ConstructL |
45 // CCalenPopulationState::ConstructL |
49 // Second stage construction |
46 // Second stage construction |
50 // ---------------------------------------------------------------------------- |
47 // ---------------------------------------------------------------------------- |
51 void CCalenPopulationState::ConstructL() |
48 void CCalenPopulationState::ConstructL() |
52 { |
49 { |
53 OstTraceFunctionEntry0( CCALENPOPULATIONSTATE_CONSTRUCTL_ENTRY ); |
50 TRACE_ENTRY_POINT; |
54 |
|
55 BaseConstructL(); |
51 BaseConstructL(); |
56 |
52 |
57 OstTraceFunctionExit0( CCALENPOPULATIONSTATE_CONSTRUCTL_EXIT ); |
53 TRACE_EXIT_POINT; |
58 } |
54 } |
59 |
55 |
60 // ---------------------------------------------------------------------------- |
56 // ---------------------------------------------------------------------------- |
61 // CCalenPopulationState::CCalenPopulationState |
57 // CCalenPopulationState::CCalenPopulationState |
62 // C++ Constructor |
58 // C++ Constructor |
63 // ---------------------------------------------------------------------------- |
59 // ---------------------------------------------------------------------------- |
64 CCalenPopulationState::CCalenPopulationState( CCalenController& aController, |
60 CCalenPopulationState::CCalenPopulationState( CCalenController& aController, |
65 RHashSet<TCalenNotification>& aOutstandingNotifications ) |
61 RHashSet<TCalenNotification>& aOutstandingNotifications ) |
66 : CCalenState( aController, aOutstandingNotifications ) |
62 : CCalenState( aController, aOutstandingNotifications ) |
67 { |
63 { |
68 OstTraceFunctionEntry0( CCALENPOPULATIONSTATE_CCALENPOPULATIONSTATE_ENTRY ); |
64 TRACE_ENTRY_POINT; |
69 |
65 |
70 OstTraceFunctionExit0( CCALENPOPULATIONSTATE_CCALENPOPULATIONSTATE_EXIT ); |
66 TRACE_EXIT_POINT; |
71 } |
67 } |
72 |
68 |
73 // ---------------------------------------------------------------------------- |
69 // ---------------------------------------------------------------------------- |
74 // CCalenPopulationState::CCalenPopulationState |
70 // CCalenPopulationState::CCalenPopulationState |
75 // Destructor |
71 // Destructor |
76 // ---------------------------------------------------------------------------- |
72 // ---------------------------------------------------------------------------- |
77 CCalenPopulationState::~CCalenPopulationState() |
73 CCalenPopulationState::~CCalenPopulationState() |
78 { |
74 { |
79 OstTraceFunctionEntry0( DUP1_CCALENPOPULATIONSTATE_CCALENPOPULATIONSTATE_ENTRY ); |
75 TRACE_ENTRY_POINT; |
80 |
76 |
81 OstTraceFunctionExit0( DUP1_CCALENPOPULATIONSTATE_CCALENPOPULATIONSTATE_EXIT ); |
77 TRACE_EXIT_POINT; |
82 } |
78 } |
83 |
79 |
84 // ---------------------------------------------------------------------------- |
80 // ---------------------------------------------------------------------------- |
85 // CCalenPopulationState::HandleCommandL |
81 // CCalenPopulationState::HandleCommandL |
86 // From CCalenState |
82 // From CCalenState |
87 // ---------------------------------------------------------------------------- |
83 // ---------------------------------------------------------------------------- |
88 TBool CCalenPopulationState::HandleCommandL( const TCalenCommand& aCommand, |
84 TBool CCalenPopulationState::HandleCommandL( const TCalenCommand& aCommand, |
89 CCalenStateMachine& aStateMachine ) |
85 CCalenStateMachine& aStateMachine ) |
90 { |
86 { |
91 OstTraceFunctionEntry0( CCALENPOPULATIONSTATE_HANDLECOMMANDL_ENTRY ); |
87 TRACE_ENTRY_POINT; |
92 |
|
93 TInt cmd = aCommand.Command(); |
88 TInt cmd = aCommand.Command(); |
94 MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd ); |
89 MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd ); |
95 |
90 |
96 ASSERT( handler ); // FIXME: error ui |
91 ASSERT( handler ); // FIXME: error ui |
97 |
92 |
103 ActivateCurrentStateL(aStateMachine); |
98 ActivateCurrentStateL(aStateMachine); |
104 RequestCallbackL( handler, aCommand ); |
99 RequestCallbackL( handler, aCommand ); |
105 cmdUsed = ETrue; |
100 cmdUsed = ETrue; |
106 } |
101 } |
107 |
102 |
108 OstTraceFunctionExit0( CCALENPOPULATIONSTATE_HANDLECOMMANDL_EXIT ); |
103 TRACE_EXIT_POINT; |
109 return cmdUsed; |
104 return cmdUsed; |
110 } |
105 } |
111 |
106 |
112 // ---------------------------------------------------------------------------- |
107 // ---------------------------------------------------------------------------- |
113 // CCalenPopulationState::HandleNotificationL |
108 // CCalenPopulationState::HandleNotificationL |
114 // From CCalenState |
109 // From CCalenState |
115 // ---------------------------------------------------------------------------- |
110 // ---------------------------------------------------------------------------- |
116 void CCalenPopulationState::HandleNotificationL(const TCalenNotification& aNotification, |
111 void CCalenPopulationState::HandleNotificationL(const TCalenNotification& aNotification, |
117 CCalenStateMachine& aStateMachine ) |
112 CCalenStateMachine& aStateMachine ) |
118 { |
113 { |
119 OstTraceFunctionEntry0( CCALENPOPULATIONSTATE_HANDLENOTIFICATIONL_ENTRY ); |
114 TRACE_ENTRY_POINT; |
120 |
115 |
121 switch ( aNotification ) |
116 switch ( aNotification ) |
122 { |
117 { |
123 case ECalenNotifyViewPopulationComplete: |
118 case ECalenNotifyViewPopulationComplete: |
124 { |
119 { |