calendarui/views/src/calennativeview.cpp
changeset 83 5aadd1120515
parent 81 ce92091cbd61
child 89 b57382753122
equal deleted inserted replaced
82:dcd0ca396fa1 83:5aadd1120515
    51  Default constructor.
    51  Default constructor.
    52  */
    52  */
    53 CalenNativeView::CalenNativeView(MCalenServices &services) :
    53 CalenNativeView::CalenNativeView(MCalenServices &services) :
    54 	mServices(services),
    54 	mServices(services),
    55 	mEntriesInDataBase(false),
    55 	mEntriesInDataBase(false),
    56 	mIsCapturedScreenShotValid(false),
    56 	mDatePicker(0),
    57 	mDatePicker(0)
    57     mIsCapturedScreenShotValid(false),
       
    58     mForcedExit(false)
    58 {
    59 {
    59     OstTraceFunctionEntry0( CALENNATIVEVIEW_CALENNATIVEVIEW_ENTRY );
    60     OstTraceFunctionEntry0( CALENNATIVEVIEW_CALENNATIVEVIEW_ENTRY );
    60     
    61     
    61 	setTitle(hbTrId("txt_calendar_title_calendar"));
    62 	setTitle(hbTrId("txt_calendar_title_calendar"));
    62 	 //initialize the activity 
    63 	 //initialize the activity 
    67 
    68 
    68 	notificationArray.Append(ECalenNotifySystemTimeChanged);
    69 	notificationArray.Append(ECalenNotifySystemTimeChanged);
    69 	notificationArray.Append(ECalenNotifySystemLocaleChanged);
    70 	notificationArray.Append(ECalenNotifySystemLocaleChanged);
    70 	notificationArray.Append(ECalenNotifyContextChanged);
    71 	notificationArray.Append(ECalenNotifyContextChanged);
    71 	notificationArray.Append(ECalenNotifyCloseDialogs);
    72 	notificationArray.Append(ECalenNotifyCloseDialogs);
    72 
    73 	notificationArray.Append(ECalenNotifyForcedExit);
    73 	mServices.RegisterForNotificationsL(this, notificationArray);
    74 	mServices.RegisterForNotificationsL(this, notificationArray);
    74 
    75 
    75 	CleanupStack::PopAndDestroy(&notificationArray);
    76 	CleanupStack::PopAndDestroy(&notificationArray);
    76 	
    77 	
    77 	OstTraceFunctionExit0( CALENNATIVEVIEW_CALENNATIVEVIEW_EXIT );
    78 	OstTraceFunctionExit0( CALENNATIVEVIEW_CALENNATIVEVIEW_EXIT );
    94 {
    95 {
    95     OstTraceFunctionEntry0( CALENNATIVEVIEW_POPULATIONCOMPLETE_ENTRY );
    96     OstTraceFunctionEntry0( CALENNATIVEVIEW_POPULATIONCOMPLETE_ENTRY );
    96     
    97     
    97 	// Population is complete, issue the notification
    98 	// Population is complete, issue the notification
    98 	mServices.IssueNotificationL(ECalenNotifyViewPopulationComplete);
    99 	mServices.IssueNotificationL(ECalenNotifyViewPopulationComplete);
    99 	
   100 	//if entry is created in editor, and app closed from either 
       
   101 	// task switcher or red key
       
   102 	//latest entry should be shown in activity
       
   103 	//provide uinfo to user that entry get saved
       
   104 	if(mForcedExit){
       
   105 	    captureScreenshot(true);
       
   106 	    saveActivity();    
       
   107 	}
       
   108 	else{
       
   109 	    captureScreenshot(false);
       
   110 	}
   100 	OstTraceFunctionExit0( CALENNATIVEVIEW_POPULATIONCOMPLETE_EXIT );
   111 	OstTraceFunctionExit0( CALENNATIVEVIEW_POPULATIONCOMPLETE_EXIT );
   101 }
   112 }
   102 
   113 
   103 /*!
   114 /*!
   104  Slot for delete before date
   115  Slot for delete before date
   260 		}
   271 		}
   261 		break;
   272 		break;
   262 		case ECalenNotifyCloseDialogs: {
   273 		case ECalenNotifyCloseDialogs: {
   263 			// Emit the signal to close the dialogs which are already opened
   274 			// Emit the signal to close the dialogs which are already opened
   264 			emit closeDialogs();
   275 			emit closeDialogs();
       
   276 		}
       
   277 		break;
       
   278 		case ECalenNotifyForcedExit:{
       
   279             mForcedExit = true;
   265 		}
   280 		}
   266 		break;
   281 		break;
   267 		default:
   282 		default:
   268 			break;
   283 			break;
   269 	}
   284 	}