#include "ClICalendarEventChangedEventListener.h"
class EventPresentationModel
- : public virtual ICalendarAppStatusChangedEventListener
+ : public virtual Tizen::Social::ICalendarbookEventListener
+ , public virtual ICalendarAppStatusChangedEventListener
{
public:
result Construct(const Tizen::Social::RecordId eventId = Tizen::Social::INVALID_RECORD_ID);
bool IsSaved(void) const;
bool IsEditable(void) const;
bool IsRecurring(void) const;
+ bool IsEventValid(void) const;
result RemoveEvent(bool deleteOriginal = true);
result SetCalendar(const Tizen::Social::RecordId calendarId);
virtual void OnForeground(void);
virtual void OnBackground(void);
+ virtual void OnCalendarEventsChanged(const Tizen::Base::Collection::IList& eventChangeInfoList);
+ virtual void OnCalendarTodosChanged(const Tizen::Base::Collection::IList& todoChangeInfoList);
+
private:
void FireCalendarEventChangedEvent(void);
void
EventDetailsForm::OnCalendarEventChanged(void)
{
- __pTableView->UpdateTableView();
+ if(__pPm->IsEventValid() == false)
+ {
+ if(__pThreeButtonPopup != null && __pThreeButtonPopup->GetShowState() == true)
+ {
+ __pThreeButtonPopup->SetShowState(false);
+ }
+ if(__pTwoButtonPopup != null && __pTwoButtonPopup->GetShowState() == true)
+ {
+ __pTwoButtonPopup->SetShowState(false);
+ }
+ SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT));
+
+ }
+ else
+ {
+ __pTableView->UpdateTableView();
+ }
}
TableViewItem*
EventPresentationModel::Construct(const RecordId eventId)
{
__pCalendarbook = new (std::nothrow) Calendarbook();
- __pCalendarbook->Construct();
+ __pCalendarbook->Construct(*this);
result r = SetEventId(eventId);
TryCatch(r == E_SUCCESS, , "[%s] Unable to construct EventPresentationModel.", GetErrorMessage(r));
return __pEventInstance->GetOriginalEventId();
}
return __pEvent->GetRecordId();
+
}
String
delete pEnum;
}
}
+
+bool
+EventPresentationModel::IsEventValid(void) const
+{
+
+ CalEvent* pEvent = __pCalendarbook->GetEventN(__pEvent->GetRecordId());
+ if (pEvent)
+ {
+ delete pEvent;
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
+
+void
+EventPresentationModel::OnCalendarEventsChanged(const IList& eventChangeInfoList)
+{
+ FireCalendarEventChangedEvent();
+}
+
+void
+EventPresentationModel::OnCalendarTodosChanged(const IList& todoChangeInfoList)
+{
+
+}
AppLogDebug("focusedDate: %ls", focusedDate.ToString().GetPointer());
DateTime adjustFocusedDate = focusedDate;
adjustFocusedDate.AddMonths(__pPm->GetCurrentMonth() - adjustFocusedDate.GetMonth());
+ adjustFocusedDate.AddYears(__pPm->GetCurrentYear() - adjustFocusedDate.GetYear());
AppLogDebug("adjustFocusedDate: %ls", adjustFocusedDate.ToString().GetPointer());
__pPm->SetCurrentDate(adjustFocusedDate);
__pListViewEvent->UpdateList();