diff -r 96907930389d -r 12af337248b1 calendarui/controller/src/calenidlestate.cpp --- a/calendarui/controller/src/calenidlestate.cpp Thu Aug 19 09:53:43 2010 +0300 +++ b/calendarui/controller/src/calenidlestate.cpp Tue Aug 31 15:13:43 2010 +0300 @@ -22,22 +22,26 @@ #include "calencontroller.h" #include "calenstatemachine.h" #include "calennotifier.h" +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "calenidlestateTraces.h" +#endif // ---------------------------------------------------------------------------- -// CCalenIdleState::NewLC +// CalenIdleState::NewLC // First stage construction // ---------------------------------------------------------------------------- CCalenIdleState* CCalenIdleState::NewLC( CCalenController& aController, RHashSet& aOutstandingNotifications ) { - TRACE_ENTRY_POINT; - + OstTraceFunctionEntry0( CCALENIDLESTATE_NEWLC_ENTRY ); + CCalenIdleState* self = new ( ELeave ) CCalenIdleState( aController, aOutstandingNotifications ); CleanupStack::PushL( self ); self->ConstructL(); - TRACE_EXIT_POINT; + OstTraceFunctionExit0( CCALENIDLESTATE_NEWLC_EXIT ); return self; } @@ -47,10 +51,11 @@ // ---------------------------------------------------------------------------- void CCalenIdleState::ConstructL() { - TRACE_ENTRY_POINT; + OstTraceFunctionEntry0( CCALENIDLESTATE_CONSTRUCTL_ENTRY ); + BaseConstructL(); - TRACE_EXIT_POINT; + OstTraceFunctionExit0( CCALENIDLESTATE_CONSTRUCTL_EXIT ); } // ---------------------------------------------------------------------------- @@ -61,9 +66,9 @@ RHashSet& aOutstandingNotifications ) : CCalenState( aController, aOutstandingNotifications ) { - TRACE_ENTRY_POINT; + OstTraceFunctionEntry0( CCALENIDLESTATE_CCALENIDLESTATE_ENTRY ); - TRACE_EXIT_POINT; + OstTraceFunctionExit0( CCALENIDLESTATE_CCALENIDLESTATE_EXIT ); } // ---------------------------------------------------------------------------- @@ -72,9 +77,9 @@ // ---------------------------------------------------------------------------- CCalenIdleState::~CCalenIdleState() { - TRACE_ENTRY_POINT; + OstTraceFunctionEntry0( DUP1_CCALENIDLESTATE_CCALENIDLESTATE_ENTRY ); - TRACE_EXIT_POINT; + OstTraceFunctionExit0( DUP1_CCALENIDLESTATE_CCALENIDLESTATE_EXIT ); } // ---------------------------------------------------------------------------- @@ -84,7 +89,7 @@ TBool CCalenIdleState::HandleCommandL( const TCalenCommand& aCommand, CCalenStateMachine& aStateMachine ) { - TRACE_ENTRY_POINT; + OstTraceFunctionEntry0( CCALENIDLESTATE_HANDLECOMMANDL_ENTRY ); TInt cmd = aCommand.Command(); MCalenCommandHandler* handler = iController.GetCommandHandlerL( cmd ); @@ -96,11 +101,21 @@ switch( cmd ) { case ECalenMonthView: - case ECalenWeekView: case ECalenDayView: - case ECalenTodoView: + case ECalenAgendaView: + case ECalenStartActiveStep: + { + // set previous state to idle + CCalenStateMachine::TCalenStateIndex cachedState = GetCurrentState(aStateMachine); + SetCurrentState( aStateMachine, CCalenStateMachine::ECalenPopulationState ); + SetCurrentPreviousState( aStateMachine, cachedState ); + ActivateCurrentStateL(aStateMachine); + cmdUsed = ETrue; + } + break; + case ECalenTodoEditor: + case ECalenTodoEditorDone: case ECalenForwardsToDayView: - case ECalenForwardsToWeekView: case ECalenNextView: case ECalenPrevView: case ECalenSwitchView: @@ -120,16 +135,7 @@ cmdUsed = ETrue; break; - case ECalenStartActiveStep: - { - // set previous state to idle - CCalenStateMachine::TCalenStateIndex cachedState = GetCurrentState(aStateMachine); - SetCurrentState( aStateMachine, CCalenStateMachine::ECalenPopulationState ); - SetCurrentPreviousState( aStateMachine, cachedState ); - ActivateCurrentStateL(aStateMachine); - cmdUsed = ETrue; - } - break; + case ECalenEventView: case ECalenMissedEventView: { @@ -142,11 +148,11 @@ } break; case ECalenNewMeeting: - case ECalenNewTodo: case ECalenNewAnniv: case ECalenNewDayNote: case ECalenNewReminder: case ECalenNewMeetingRequest: + case ECalenNewEntry: case ECalenEditCurrentEntry: case ECalenEditSeries: case ECalenEditOccurrence: @@ -207,35 +213,8 @@ case ECalenGetLocation: case ECalenShowLocation: case ECalenGetLocationAndSave: - { - CCalenStateMachine::TCalenStateIndex cachedState = GetCurrentState(aStateMachine); - SetCurrentState( aStateMachine, CCalenStateMachine::ECalenMapState ); - SetCurrentPreviousState( aStateMachine, cachedState ); - ActivateCurrentStateL(aStateMachine); - cmdUsed = ETrue; - } - break; - case ECalenEventViewFromAlarm: - case ECalenEventViewFromAlarmStopOnly: - { - CCalenStateMachine::TCalenStateIndex cachedState = GetCurrentState(aStateMachine); - SetCurrentState( aStateMachine, CCalenStateMachine::ECalenAlarmState); - SetCurrentPreviousState( aStateMachine, cachedState ); - ActivateCurrentStateL(aStateMachine); - cmdUsed = ETrue; - } - break; - case ECalenAddAttachment: - case ECalenRemoveAttachment: - case ECalenViewAttachmentList: - { - CCalenStateMachine::TCalenStateIndex cachedState = GetCurrentState(aStateMachine); - SetCurrentState( aStateMachine, CCalenStateMachine::ECalenAttachmentState ); - SetCurrentPreviousState( aStateMachine, cachedState ); - ActivateCurrentStateL(aStateMachine); - cmdUsed = ETrue; - } - break; + { + } default: // This a valid custom command as there is a command handler // do not modify the new start and remain in idle. @@ -246,7 +225,7 @@ RequestCallbackL( handler, aCommand ); - TRACE_EXIT_POINT; + OstTraceFunctionExit0( CCALENIDLESTATE_HANDLECOMMANDL_EXIT ); return cmdUsed; } @@ -257,11 +236,11 @@ void CCalenIdleState::HandleNotificationL(const TCalenNotification& aNotification, CCalenStateMachine& aStateMachine) { - TRACE_ENTRY_POINT; + OstTraceFunctionEntry0( CCALENIDLESTATE_HANDLENOTIFICATIONL_ENTRY ); CCalenState::HandleNotificationL( aNotification, aStateMachine ); - TRACE_EXIT_POINT; + OstTraceFunctionExit0( CCALENIDLESTATE_HANDLENOTIFICATIONL_EXIT ); } // end of file