calendarui/controller/src/calenviewmanager.cpp
changeset 80 fa7c359294fa
parent 68 a5a1242fd2e8
equal deleted inserted replaced
77:b0711afde476 80:fa7c359294fa
   219 		ActivateDefaultViewL(ECalenAgendaView);
   219 		ActivateDefaultViewL(ECalenAgendaView);
   220 		// Add agenda view to mainwindow.
   220 		// Add agenda view to mainwindow.
   221 		mController.MainWindow().addView(mCalenAgendaView);
   221 		mController.MainWindow().addView(mCalenAgendaView);
   222 		mController.MainWindow().setCurrentView(mCalenAgendaView);
   222 		mController.MainWindow().setCurrentView(mCalenAgendaView);
   223 		mController.MainWindow().addView(mCalenAgendaViewAlt);
   223 		mController.MainWindow().addView(mCalenAgendaViewAlt);
       
   224 	} else if (view == ECalenDayView) {
       
   225 	    mFirstView = ECalenDayView;
       
   226 	    loadDayView();
       
   227 	    ActivateDefaultViewL(ECalenDayView);
       
   228 	    // Add day view to mainwindow.
       
   229         mController.MainWindow().addView(mCalenDayView);
       
   230         mController.MainWindow().setCurrentView(mCalenDayView);
   224 	}
   231 	}
   225 	OstTraceFunctionExit0( CALENVIEWMANAGER_CONSTRUCTANDACTIVATEVIEW_EXIT );
   232 	OstTraceFunctionExit0( CALENVIEWMANAGER_CONSTRUCTANDACTIVATEVIEW_EXIT );
   226 }
   233 }
   227 
   234 
   228 // ----------------------------------------------------------------------------
   235 // ----------------------------------------------------------------------------
   388 {
   395 {
   389     OstTraceFunctionEntry0( CALENVIEWMANAGER_CONSTRUCTOTHERVIEWS_ENTRY );
   396     OstTraceFunctionEntry0( CALENVIEWMANAGER_CONSTRUCTOTHERVIEWS_ENTRY );
   390     
   397     
   391 	// Load all other views except mFirstView
   398 	// Load all other views except mFirstView
   392 	
   399 	
   393 	// NOTE: Right now, since Calendar has only two views, month view 
   400 	// NOTE: Right now, since Calendar has three views, month view, day view 
   394 	// and agenda view, when client launches agenda view, then there is no need
   401 	// and agenda view, when client launches agenda view, then there is no need
   395 	// to construct the month view as per UI REQ., but tomorrow if new views
   402 	// to construct the month view as per UI REQ., but tomorrow if new views
   396 	// come after agenda view, then we need to construct those views if they are
   403 	// come after agenda view, then we need to construct those views if they are
   397 	// native views. Right now, there is a event viewer but its not a native
   404 	// native views. Right now, day view will be constructed as we need to 
   398 	// view. Hence, if agenda view is launched, dont construct month view
   405     // provide an option in options menu to switch between day view and agenda view
   399 	if (mFirstView != ECalenAgendaView) // check if agenda view is not already loaded
   406     // There is a event viewer but its not a native view, so no need to constrcut it
   400 		{
   407     // It will be constrcuted on demand.
       
   408 	// Hence, if agenda view is launched, constrcut the day vuew but dont construct month view.
       
   409     // Vice-versa for when day view is maunched as first view
       
   410 	if (mFirstView == ECalenMonthView) {
   401 		// Load all other views 
   411 		// Load all other views 
   402 		loadAgendaView();
   412 		loadAgendaView();
   403 		
   413 		
   404 		if (!mCalenDayView) {
   414 		if (!mCalenDayView) {
   405 		    loadDayView();
   415 		    loadDayView();
   406 		}
   416 		}
   407 	}
   417 	} else if (mFirstView == ECalenAgendaView) { //agenda view was launched as first view
   408 	else //agenda view was launched as first view
   418 	    // Load day view
   409 	    {
   419 	    if (!mCalenDayView) {
   410 		// No implementation yet. UI specs not clear
   420             loadDayView();
   411 		// to be commented in with some more code once UI specs is frozen
   421         }
   412 		// for agenda view launching as first view after it was saved as activity
   422     } else if (mFirstView == ECalenDayView) { // Day view was launched as first view
   413 		// when it was launched from month view
   423         // Load agenda view
   414         // loadMonthView();
   424         loadAgendaView();
   415         // mCalenMonthView->doLazyLoading();
   425     }
   416 	    }
       
   417 
   426 
   418 	// Setup the settings view
   427 	// Setup the settings view
   419 	mSettingsView = new CalenSettingsView(mController.Services());
   428 	mSettingsView = new CalenSettingsView(mController.Services());
   420 	
   429 	
   421 	OstTraceFunctionExit0( CALENVIEWMANAGER_CONSTRUCTOTHERVIEWS_EXIT );
   430 	OstTraceFunctionExit0( CALENVIEWMANAGER_CONSTRUCTOTHERVIEWS_EXIT );
   556 	mCurrentViewId = defaultView;
   565 	mCurrentViewId = defaultView;
   557 	if (ECalenMonthView == defaultView) {
   566 	if (ECalenMonthView == defaultView) {
   558 		mCalenMonthView->doPopulation();
   567 		mCalenMonthView->doPopulation();
   559 	} else if (ECalenAgendaView == defaultView) {
   568 	} else if (ECalenAgendaView == defaultView) {
   560 		mCalenAgendaView->doPopulation();
   569 		mCalenAgendaView->doPopulation();
   561 	}
   570 	} else if (ECalenDayView == defaultView) {
       
   571         mCalenDayView->doPopulation();
       
   572     }
       
   573 	
   562 	OstTraceFunctionExit0( CALENVIEWMANAGER_ACTIVATEDEFAULTVIEWL_EXIT );
   574 	OstTraceFunctionExit0( CALENVIEWMANAGER_ACTIVATEDEFAULTVIEWL_EXIT );
   563 }
   575 }
   564 
   576 
   565 // ----------------------------------------------------------------------------
   577 // ----------------------------------------------------------------------------
   566 // Refresh current view.
   578 // Refresh current view.