calendarui/views/src/calendaycontainer.cpp
branchRCL_3
changeset 60 96907930389d
parent 59 aba12c885d83
child 67 1539a383d7b6
equal deleted inserted replaced
59:aba12c885d83 60:96907930389d
   277         SetHighlightFromContextL();
   277         SetHighlightFromContextL();
   278         }
   278         }
   279     SetContextFromHighlightL();
   279     SetContextFromHighlightL();
   280 
   280 
   281     DestroyInstanceListL();
   281     DestroyInstanceListL();
   282 
   282     
       
   283     HBufC* emptyText = StringLoader::LoadLC(R_CALEN_QTN_CALE_NO_EVENTS,
       
   284                                                    iEikonEnv);
       
   285     //Whenever listbox is empty, it will set with this empty text.
       
   286     iListBox->View()->SetListEmptyTextL( *emptyText ); 
       
   287     CleanupStack::PopAndDestroy(emptyText);
       
   288     
   283     iListBox->HandleItemAdditionL(); // Is this causing unnecessary draw?
   289     iListBox->HandleItemAdditionL(); // Is this causing unnecessary draw?
   284 
   290 
   285     iListBox->View()->SetDisableRedraw(EFalse);
   291     iListBox->View()->SetDisableRedraw(EFalse);
   286     iListBox->SetFocus(ETrue);
   292     iListBox->SetFocus(ETrue);
   287     iListBox->DrawNow();
   293     iListBox->DrawNow();
  1458 
  1464 
  1459     if(! AknLayoutUtils::PenEnabled() )
  1465     if(! AknLayoutUtils::PenEnabled() )
  1460         {
  1466         {
  1461         return;
  1467         return;
  1462         }
  1468         }
  1463         
  1469     if(iView->IsEventViewLaunchedFromAlarm())
       
  1470         {
       
  1471         return;
       
  1472         }
  1464     if(aPointerEvent.iType == TPointerEvent::EButton1Down)
  1473     if(aPointerEvent.iType == TPointerEvent::EButton1Down)
  1465         {
  1474         {
  1466         this->GenerateTactileFeedback(); //Tactile feedback.
  1475         this->GenerateTactileFeedback(); //Tactile feedback.
  1467         control = iLayoutManager->ControlOrNull();
  1476         control = iLayoutManager->ControlOrNull();
  1468         if(control)
  1477         if(control)
  1844 // Stores the necessary information in the context
  1853 // Stores the necessary information in the context
  1845 // and returns ETrue if event has geo coordinates else EFalse
  1854 // and returns ETrue if event has geo coordinates else EFalse
  1846 // ----------------------------------------------------------------------------
  1855 // ----------------------------------------------------------------------------
  1847 TBool CCalenDayContainer::IsEventHasMapLocationL()
  1856 TBool CCalenDayContainer::IsEventHasMapLocationL()
  1848 	{
  1857 	{
       
  1858 	TRACE_ENTRY_POINT;
  1849 	MCalenContext& context = iServices.Context();
  1859 	MCalenContext& context = iServices.Context();
  1850 	TCalLocalUid instanceId = context.InstanceId().iEntryLocalUid;
  1860 	TCalLocalUid instanceId = context.InstanceId().iEntryLocalUid;
  1851 	
  1861 	
  1852 	CCalEntry* entry = iServices.EntryViewL(context.InstanceId().iColId)->FetchL(instanceId);
  1862 	CCalEntry* entry = iServices.EntryViewL(context.InstanceId().iColId)->FetchL(instanceId);
  1853 
  1863 	CleanupStack::PushL(entry);
  1854 	CCalGeoValue* geoValue = entry->GeoValueL();
  1864 	CCalGeoValue* geoValue = entry->GeoValueL();
       
  1865 	CleanupStack::PopAndDestroy(entry);
  1855 	if(geoValue)
  1866 	if(geoValue)
  1856 		{
  1867 		{
  1857 		delete geoValue;
  1868 		delete geoValue;
  1858 		delete entry;
       
  1859 		// Event has saved map location, put "Show on Map"
  1869 		// Event has saved map location, put "Show on Map"
       
  1870 		TRACE_EXIT_POINT;
  1860 		return 	ETrue;
  1871 		return 	ETrue;
  1861 		}
  1872 		}
  1862 	else
  1873 	else
  1863 		{
  1874 		{
       
  1875 		TRACE_EXIT_POINT;
  1864 		return EFalse;
  1876 		return EFalse;
  1865 		}
  1877 		}
  1866 	}
  1878 	}
  1867 	
  1879 	
  1868 // ----------------------------------------------------------------------------
  1880 // ----------------------------------------------------------------------------
  1869 // CCalenDayContainer::IsEventHasNoLocationTextL
  1881 // CCalenDayContainer::IsEventHasNoLocationTextL
  1870 // Returns ETrue if event has location text else EFalse
  1882 // Returns ETrue if event has location text else EFalse
  1871 // ----------------------------------------------------------------------------
  1883 // ----------------------------------------------------------------------------
  1872 TBool CCalenDayContainer::IsEventHasNoLocationTextL()
  1884 TBool CCalenDayContainer::IsEventHasNoLocationTextL()
  1873 	{
  1885 	{
       
  1886 	TRACE_ENTRY_POINT;
  1874 	MCalenContext& context = iServices.Context();
  1887 	MCalenContext& context = iServices.Context();
  1875 	TCalLocalUid instanceId = context.InstanceId().iEntryLocalUid;
  1888 	TCalLocalUid instanceId = context.InstanceId().iEntryLocalUid;
  1876 	
  1889 	
  1877 	CCalEntry* entry = iServices.EntryViewL(context.InstanceId().iColId)->FetchL(instanceId);
  1890 	CCalEntry* entry = iServices.EntryViewL(context.InstanceId().iColId)->FetchL(instanceId);
       
  1891 	CleanupStack::PushL(entry);
  1878 	TPtrC location = entry->LocationL();
  1892 	TPtrC location = entry->LocationL();
       
  1893 	
       
  1894 	TBool ret = EFalse;
  1879 	if(!location.Length())
  1895 	if(!location.Length())
  1880 		{
  1896 		{
  1881 		return ETrue;
  1897 		ret = ETrue;
  1882 		}
  1898 		}
  1883 	else
  1899 	CleanupStack::PopAndDestroy(entry);
  1884 		{
  1900 	TRACE_EXIT_POINT;
  1885 		return EFalse;
  1901 	return ret;
  1886 		}
       
  1887 	}
  1902 	}
  1888 // ----------------------------------------------------------------------------
  1903 // ----------------------------------------------------------------------------
  1889 // CCalenDayContainer::IsValidEntryL()
  1904 // CCalenDayContainer::IsValidEntryL()
  1890 // Check whether entry exists or not
  1905 // Check whether entry exists or not
  1891 // ----------------------------------------------------------------------------
  1906 // ----------------------------------------------------------------------------