# HG changeset patch # User hgs # Date 1284966879 -19800 # Node ID 7ac58b2aae6f137184b6f2d4c825e54ff88fcdb3 # Parent 27feeedec7908d2f263a6bc4b28e091ed7727f4e 201037 diff -r 27feeedec790 -r 7ac58b2aae6f agendainterface/inc/CleanupResetAndDestroy.h --- a/agendainterface/inc/CleanupResetAndDestroy.h Mon Sep 06 15:58:44 2010 +0530 +++ b/agendainterface/inc/CleanupResetAndDestroy.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,10 +1,10 @@ /* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available -* under the terms of the License "Symbian Foundation License v1.0" +* under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available -* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. @@ -12,15 +12,14 @@ * Contributors: * * Description: Provides cleanup item to push ResetAndDestroy calls to - * cleanup stack. It is heavily used for RPointerArrays, - * which are used all over Symbian's CalenInterimAPI. - * Implementation is more or less copy-paste of - * cleanup item of Close method and CleanupClosePushL - * +* cleanup stack. It is heavily used for RPointerArrays, +* which are used all over Symbian's CalenInterimAPI. +* Implementation is more or less copy-paste of +* cleanup item of Close method and CleanupClosePushL +* */ - #ifndef __CLEANUPRESETANDDESTROY_H__ #define __CLEANUPRESETANDDESTROY_H__ diff -r 27feeedec790 -r 7ac58b2aae6f agendainterface/inc/CleanupResetAndDestroy.inl --- a/agendainterface/inc/CleanupResetAndDestroy.inl Mon Sep 06 15:58:44 2010 +0530 +++ b/agendainterface/inc/CleanupResetAndDestroy.inl Mon Sep 20 12:44:39 2010 +0530 @@ -1,10 +1,10 @@ /* -* Copyright (c) 2002-2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available -* under the terms of the License "Symbian Foundation License v1.0" +* under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available -* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. @@ -15,7 +15,7 @@ * cleanup stack. It is heavily used for RPointerArrays, * which are used all over Symbian's CalenInterimAPI. * Implementation is more or less copy-paste of -* cleanup item of Close method and CleanupClosePushL +* cleanup item of Close method and CleanupClosePushL * */ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/application/src/calenserviceprovider.cpp --- a/calendarui/application/src/calenserviceprovider.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/application/src/calenserviceprovider.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -48,6 +48,10 @@ // Launch the agenda view mController->handleServiceManagerSlot(ECalenAgendaView, date); break; + case CalenLauncher::DayView: + // Launch the day view + mController->handleServiceManagerSlot(ECalenDayView, date); + break; default: // Keep Quiet break; diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/caleneditor.pro --- a/calendarui/caleneditor/caleneditor.pro Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/caleneditor.pro Mon Sep 20 12:44:39 2010 +0530 @@ -36,7 +36,8 @@ LIBS += -lagendainterface \ -lcalencommonutils \ -lxqservice \ - -lcalenlauncher + -lcalenlauncher \ + -lbafl INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE } @@ -57,7 +58,7 @@ caleneditorreminderfield.h \ caleneditorrepeatfield.h \ caleneditordatahandler.h - + RESOURCES += caleneditor.qrc TRANSLATIONS += caleneditor.ts diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/inc/caleneditor_p.h --- a/calendarui/caleneditor/inc/caleneditor_p.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/inc/caleneditor_p.h Mon Sep 20 12:44:39 2010 +0530 @@ -28,6 +28,7 @@ //user includes #include #include +#include "calennotificationhandler.h" #include "caleneditorcommon.h" @@ -52,6 +53,7 @@ class CalenEditorReminderField; class CalenEditorRepeatField; class CalenEditorDataHandler; +class CEnvironmentChangeNotifier; // Receive system event notifications // Constants const int KNoOfDaysInWeek = 7; @@ -116,6 +118,16 @@ bool isEditRangeThisOnly(); bool isAllDayFieldAdded(); void forcedSaveEntry(); + + /** + * Called from CEnvironmentChangeNotifier when the + * system environment changes + * @param aThisPtr self pointer + * @return EFalse + */ + static TInt EnvChangeCallbackL( TAny* aThisPtr ); + TInt DoEnvChange(); + private: void edit(const QFile &handle, bool launchCalendar); void edit(AgendaEntry entry, bool launchCalendar); @@ -157,6 +169,7 @@ void enableFromTotimeFileds(bool, QDateTime, QDateTime); QDateTime defaultTimeSameDay( ); void refreshTimeForUncheckAllDay(); + void launchDialog(QString title); private slots: void handleSubjectChange(const QString subject); @@ -229,7 +242,10 @@ bool mOwnsAgendaUtil; bool mLaunchCalendar; bool mMenuItemAdded; - + + // Notifications about locale and time changes + CEnvironmentChangeNotifier* iEnvChangeNotifier; + bool iIgnoreFirstLocaleChange; private: friend class CalenEditor; #ifdef TESTCALENEDITOR diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/inc/caleneditorcustomitem.h --- a/calendarui/caleneditor/inc/caleneditorcustomitem.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/inc/caleneditorcustomitem.h Mon Sep 20 12:44:39 2010 +0530 @@ -88,8 +88,8 @@ HbPushButton *mRepeatUntilWidget; HbPushButton *mReminderTimeWidget; - HbDateTimePicker *mDatePicker; - HbDateTimePicker *mTimePicker; + QPointer mDatePicker; + QPointer mTimePicker; HbExtendedLocale mLocale; diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/inc/caleneditorreminderfield.h --- a/calendarui/caleneditor/inc/caleneditorreminderfield.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/inc/caleneditorreminderfield.h Mon Sep 20 12:44:39 2010 +0530 @@ -91,7 +91,7 @@ HbDataFormModel* mCalenEditorModel; HbDataFormModelItem* mReminderItem; HbDataFormModelItem *mCustomReminderTimeItem; - HbDateTimePicker *mTimePicker; + QPointer mTimePicker; QTime mReminderTimeForAllDay; QHash mReminderHash; bool mReminderTimeAdded; diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/inc/caleneditorrepeatfield.h --- a/calendarui/caleneditor/inc/caleneditorrepeatfield.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/inc/caleneditorrepeatfield.h Mon Sep 20 12:44:39 2010 +0530 @@ -53,7 +53,8 @@ void updateRepeatChoices(); void saveRepeatRule(); bool isRepeatUntilItemAdded(); - QDate repeatUntilDate(); + QDate repeatUntilDate(); + void refreshRepeatUntilDate(); private: void insertRepeatUntilItem(); @@ -88,7 +89,7 @@ HbDataFormModelItem* mRepeatItem; HbComboBox *mRepeatComboBox; HbDataFormModelItem *mCustomRepeatUntilItem; - HbDateTimePicker* mDatePicker; + QPointer mDatePicker; QDate mRepeatUntilDate; AgendaRepeatRule::RuleType mRepeatRuleType; int mRepeatRoleValue; diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/src/caleneditor_p.cpp --- a/calendarui/caleneditor/src/caleneditor_p.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/src/caleneditor_p.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -21,6 +21,9 @@ #include #include +#include // CEnvironmentChangeNotifier +#include // EActivePriorityLogonA + #include #include #include @@ -233,6 +236,16 @@ mAgendaUtil = agendaUtil; mOwnsAgendaUtil = false; } + + // Register for system environment changes + // TODO: these are temporary changes done in symbian way + // till we get proper QT support to listem for locale changes + TCallBack envCallback( EnvChangeCallbackL, this ); + iEnvChangeNotifier = + CEnvironmentChangeNotifier::NewL( EActivePriorityLogonA, envCallback ); + iEnvChangeNotifier->Start(); + iIgnoreFirstLocaleChange = ETrue; + OstTraceFunctionExit0( CALENEDITORPRIVATE_CALENEDITORPRIVATE_EXIT ); } @@ -285,6 +298,13 @@ delete mMainWindow; mMainWindow = 0; } + + if(iEnvChangeNotifier) { + iEnvChangeNotifier->Cancel(); + delete iEnvChangeNotifier; + iEnvChangeNotifier = 0; + } + OstTraceFunctionExit0( DUP1_CALENEDITORPRIVATE_CALENEDITORPRIVATE_EXIT ); } @@ -556,7 +576,10 @@ mCalenEditorForm = qobject_cast ( mEditorDocLoader->findWidget(CALEN_EDITOR_DATAFORM)); - + + // Enable the pixmap cache for better scrolling performance + mCalenEditorForm->setItemPixmapCacheEnabled(true); + mDescriptionAction = qobject_cast ( mEditorDocLoader->findObject( CALEN_EDITOR_ADD_DESCRIPTION_ACTION)); @@ -1807,6 +1830,18 @@ } /*! + Launch the notification dialog popup. + */ +void CalenEditorPrivate::launchDialog(QString title) +{ + OstTraceFunctionEntry0( CALENEDITORPRIVATE_LAUNCHDIALOG_ENTRY ); + HbNotificationDialog *notificationDialog = new HbNotificationDialog(); + notificationDialog->setTitle(title); + notificationDialog->setTimeout(HbPopup::ConfirmationNoteTimeout); + notificationDialog->show(); + OstTraceFunctionExit0( CALENEDITORPRIVATE_LAUNCHDIALOG_EXIT ); +} +/*! Save the entry \return true if entry is saved ,false otherwise */ @@ -1826,15 +1861,15 @@ } if (mNewEntry) { if(mEditedEntry->type() == AgendaEntry::TypeAppoinment) { - HbNotificationDialog::launchDialog(hbTrId("txt_calendar_dpopinfo_new_meeting_saved")); + launchDialog(hbTrId("txt_calendar_dpopinfo_new_meeting_saved")); } else if(isAllDayEvent()) { - HbNotificationDialog::launchDialog(hbTrId("txt_calendar_dpopinfo_new_all_day_event_saved")); + launchDialog(hbTrId("txt_calendar_dpopinfo_new_all_day_event_saved")); } } else { if(mEditedEntry->type() == AgendaEntry::TypeAppoinment) { - HbNotificationDialog::launchDialog(hbTrId("txt_calendar_dpopinfo_meeting_updated")); + launchDialog(hbTrId("txt_calendar_dpopinfo_meeting_updated")); } else if(isAllDayEvent()) { - HbNotificationDialog::launchDialog(hbTrId("txt_calendar_dpopinfo_all_day_event_updated")); + launchDialog(hbTrId("txt_calendar_dpopinfo_all_day_event_updated")); } } emit q_ptr->entrySaved(); @@ -2116,4 +2151,46 @@ } OstTraceFunctionExit0( CALENEDITORPRIVATE_FORCEDSAVEENTRY_EXIT ); } + + +// ---------------------------------------------------------------------------- +// CCalenNotifier::EnvChangeCallbackL +// CEnvironmentChangeNotifier callback. Calendar is only interested in: +// EChangesLocale - System locale changed +// EChangesMidnightCrossover - System time passed midnight +// EChangesSystemTime - System time changed +// (other items were commented in a header). +// ---------------------------------------------------------------------------- +// +TInt CalenEditorPrivate::EnvChangeCallbackL( TAny* aThisPtr ) +{ + // Return value for functions used as TCallBack objects should be EFalse + // unless the function is intended to be called again from a timer. + // return EFalse; + return static_cast(aThisPtr)->DoEnvChange(); +} +// ---------------------------------------------------------------------------- +// CCalenNotifier::DoEnvChange +// EnvChangeCallbackL calls this function +// ---------------------------------------------------------------------------- +// +TInt CalenEditorPrivate::DoEnvChange() +{ + if( iEnvChangeNotifier && (iEnvChangeNotifier->Change() & EChangesLocale) + && !iIgnoreFirstLocaleChange) { + mViewFromItem->populateDateTime(mEditedEntry->startTime(), true); + mViewToItem->populateDateTime(mEditedEntry->endTime(), false); + if (isAllDayEvent()) { + mReminderField->setDisplayTime(); + } + if (mRepeatField->isRepeatUntilItemAdded()) { + mRepeatField->refreshRepeatUntilDate(); + } + } + else { + iIgnoreFirstLocaleChange = EFalse; + } + return EFalse ; +} + // End of file --Don't remove this. diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/src/caleneditorcustomitem.cpp --- a/calendarui/caleneditor/src/caleneditorcustomitem.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/src/caleneditorcustomitem.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -339,6 +339,22 @@ r_qtn_date_usual_with_zero)); mPushButtonTime->setText(mLocale.format(defaultDateTime.time(), r_qtn_time_usual_with_zero)); + + // If the date/time pickers for start date/end date are open and + // locale changes happen, we need to refresh them with proper date/time formats + if(!(mDatePicker.isNull())) { + mDatePicker->setDisplayFormat(CalenDateUtils::dateFormatString()); + mDatePicker->setDate(mDate); + } + if(!(mTimePicker.isNull())) { + if(mLocale.timeStyle() == HbExtendedLocale::Time12) { + mTimePicker->setDisplayFormat("hh:mm ap"); + }else { + mTimePicker->setDisplayFormat("hh:mm"); + } + mTimePicker->setTime(mTime); + } + OstTraceFunctionExit0( CALENEDITORCUSTOMITEM_POPULATEDATETIME_EXIT ); } @@ -440,6 +456,7 @@ mDatePicker = new HbDateTimePicker(mDate, popUp); mDatePicker->setMinimumDate(mMinDate); mDatePicker->setMaximumDate(mMaxDate); + mDatePicker->setDisplayFormat(CalenDateUtils::dateFormatString()); mDatePicker->setDate(mDate); popUp->setContentWidget(mDatePicker); HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok"), popUp); diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/src/caleneditorreminderfield.cpp --- a/calendarui/caleneditor/src/caleneditorreminderfield.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/src/caleneditorreminderfield.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -59,6 +59,7 @@ mEditorForm(form), mCalenEditorModel(model), mCustomReminderTimeItem(0), + mTimePicker(0), mReminderTimeAdded(false) { OstTraceFunctionEntry0( CALENEDITORREMINDERFIELD_CALENEDITORREMINDERFIELD_ENTRY ); @@ -245,8 +246,10 @@ if (!repeatingEntry && sameDay && (currentTime.addSecs(offsetInMins * 60) >= mCalenEditor->editedEntry()->startTime().time())) { setCurrentIndex(ReminderOff); //Alarm has expired already, so making it off. //The slot for index 0 is not called, since after UpdateReminderChoicesForSameDay() - //index is 0 itself and there is no change. So explicitly calling it here. - handleReminderIndexChanged(0); + //index is 0 itself and there is no change. So explicitly setting the reminder here. + reminder.setTimeOffset(mReminderHash.value(ReminderOff)); + reminder.setAlarmSoundName(QString(" ")); + mCalenEditor->editedEntry()->setAlarm(reminder); } else { setSavedMeetingReminderIndex(); @@ -710,6 +713,17 @@ mReminderTimeForAllDay, r_qtn_time_usual_with_zero); mCustomReminderTimeItem->setContentWidgetData("text", timeString); + + // If the reminder time picker is open and locale changes happen, + // we need to refresh them dynamically with proper time formats + if(!(mTimePicker.isNull())) { + if(locale.timeStyle() == HbExtendedLocale::Time12) { + mTimePicker->setDisplayFormat("hh:mm ap"); + }else { + mTimePicker->setDisplayFormat("hh:mm"); + } + mTimePicker->setTime(mReminderTimeForAllDay); + } OstTraceFunctionExit0( CALENEDITORREMINDERFIELD_SETDISPLAYTIME_EXIT ); } diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/src/caleneditorrepeatfield.cpp --- a/calendarui/caleneditor/src/caleneditorrepeatfield.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/src/caleneditorrepeatfield.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -96,6 +96,7 @@ mRepeatItem(0), mRepeatComboBox(0), mCustomRepeatUntilItem(0), + mDatePicker(0), mRepeatRoleValue(0), mIsBiWeekly(false), mIsWorkdays(false), @@ -489,6 +490,7 @@ void CalenEditorRepeatField::launchRepeatUntilDatePicker() { OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_LAUNCHREPEATUNTILDATEPICKER_ENTRY ); + QDate minDate; HbDialog *popUp = new HbDialog(); // Set the parent for the dialog // Once the parent object is deleted the dialog will also be deleted @@ -502,36 +504,26 @@ if (mDatePicker) { mDatePicker = 0; } + mDatePicker = new HbDateTimePicker(mRepeatUntilDate, popUp); + if (mRepeatRuleType == AgendaRepeatRule::DailyRule) { - QDate minDate = mCalenEditor->editedEntry()->endTime().date().addDays(1); - mDatePicker = new HbDateTimePicker(mRepeatUntilDate, popUp); - mDatePicker->setMinimumDate(minDate); - mDatePicker->setMaximumDate(CalenDateUtils::maxTime().date()); - mDatePicker->setDate(mRepeatUntilDate); + minDate = mCalenEditor->editedEntry()->endTime().date().addDays(1); } else if (mRepeatRuleType == AgendaRepeatRule::WeeklyRule) { - QDate minDate; if (!mIsBiWeekly || mIsWorkdays) { minDate = mCalenEditor->editedEntry()->endTime().date().addDays(7); } else { minDate = mCalenEditor->editedEntry()->endTime().date().addDays(14); } - mDatePicker = new HbDateTimePicker(mRepeatUntilDate, popUp); - mDatePicker->setMinimumDate(minDate); - mDatePicker->setMaximumDate(CalenDateUtils::maxTime().date()); - mDatePicker->setDate(mRepeatUntilDate); } else if (mRepeatRuleType == AgendaRepeatRule::MonthlyRule) { - QDate minDate = mCalenEditor->editedEntry()->endTime().date().addMonths(1); - mDatePicker = new HbDateTimePicker(mRepeatUntilDate, popUp); - mDatePicker->setMinimumDate(minDate); - mDatePicker->setMaximumDate(CalenDateUtils::maxTime().date()); - mDatePicker->setDate(mRepeatUntilDate); + minDate = mCalenEditor->editedEntry()->endTime().date().addMonths(1); } else if (mRepeatRuleType == AgendaRepeatRule::YearlyRule) { - QDate minDate = mCalenEditor->editedEntry()->endTime().date().addYears(1); - mDatePicker = new HbDateTimePicker(mRepeatUntilDate, popUp); - mDatePicker->setMinimumDate(minDate); - mDatePicker->setMaximumDate(CalenDateUtils::maxTime().date()); - mDatePicker->setDate(mRepeatUntilDate); + minDate = mCalenEditor->editedEntry()->endTime().date().addYears(1); } + + mDatePicker->setMinimumDate(minDate); + mDatePicker->setMaximumDate(CalenDateUtils::maxTime().date()); + mDatePicker->setDisplayFormat(CalenDateUtils::dateFormatString()); + mDatePicker->setDate(mRepeatUntilDate); popUp->setContentWidget(mDatePicker); HbAction *okAction = new HbAction(hbTrId("txt_common_button_ok")); @@ -543,6 +535,21 @@ } /*! + Refreshes the repeat until date picker when locale with proper date format + */ +void CalenEditorRepeatField::refreshRepeatUntilDate() +{ + HbExtendedLocale locale = HbExtendedLocale::system(); + QString dateString = locale.format(mRepeatUntilDate, + r_qtn_date_usual_with_zero); + mCustomRepeatUntilItem->setContentWidgetData("text", dateString); + + if(!(mDatePicker.isNull())) { + mDatePicker->setDisplayFormat(CalenDateUtils::dateFormatString()); + mDatePicker->setDate(mRepeatUntilDate); + } +} +/*! Sets the repeat until date on the repeat until item */ void CalenEditorRepeatField::setRepeatUntilDate() @@ -550,13 +557,9 @@ OstTraceFunctionEntry0( CALENEDITORREPEATFIELD_SETREPEATUNTILDATE_ENTRY ); //Get the previous date which was set QDate previousDate = mRepeatUntilDate; - mRepeatUntilDate = mDatePicker->date(); - if (mRepeatUntilDate.isValid()) { - HbExtendedLocale locale = HbExtendedLocale::system(); - QString dateString = locale.format(mRepeatUntilDate, - r_qtn_date_usual_with_zero); - mCustomRepeatUntilItem->setContentWidgetData("text", dateString); - } + mRepeatUntilDate = mDatePicker->date(); + if (mRepeatUntilDate.isValid()) + refreshRepeatUntilDate(); mCalenEditor->updateReminderChoices(); // If the entry's repeatuntil date is changed from past to a future date // And if the alarm set set is off diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/traces/OstTraceDefinitions.h --- a/calendarui/caleneditor/traces/OstTraceDefinitions.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/traces/OstTraceDefinitions.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,3 +1,20 @@ +/* +* This is Default Licence added by TraceCompiler +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ #ifndef __OSTTRACEDEFINITIONS_H__ #define __OSTTRACEDEFINITIONS_H__ // OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/traces/caleneditorTraces.h --- a/calendarui/caleneditor/traces/caleneditorTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/traces/caleneditorTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,21 @@ -// Created by TraceCompiler 2.2.3 +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition of CalenEditor class. +* +*/ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CALENEDITORTRACES_H__ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/traces/caleneditor_pTraces.h --- a/calendarui/caleneditor/traces/caleneditor_pTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/traces/caleneditor_pTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,20 @@ -// Created by TraceCompiler 2.2.3 +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Definition file for class CalenEditorPrivate. + * + */ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CALENEDITOR_PTRACES_H__ @@ -158,6 +174,8 @@ #define CALENEDITORPRIVATE_GETREMINDERCOUNT_ENTRY 0x8a015e #define CALENEDITORPRIVATE_FORCEDSAVEENTRY_ENTRY 0x8a015f #define CALENEDITORPRIVATE_FORCEDSAVEENTRY_EXIT 0x8a0160 +#define CALENEDITORPRIVATE_LAUNCHDIALOG_ENTRY 0x8a0169 +#define CALENEDITORPRIVATE_LAUNCHDIALOG_EXIT 0x8a016a #endif diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/traces/caleneditorcustomitemTraces.h --- a/calendarui/caleneditor/traces/caleneditorcustomitemTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/traces/caleneditorcustomitemTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,20 @@ -// Created by TraceCompiler 2.2.3 +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Definition file for class CalenEditorCustomItem. + * + */ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CALENEDITORCUSTOMITEMTRACES_H__ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/traces/caleneditordatahandlerTraces.h --- a/calendarui/caleneditor/traces/caleneditordatahandlerTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/traces/caleneditordatahandlerTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,21 @@ -// Created by TraceCompiler 2.2.3 +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition of CalenEditorDataHandler class. +* +*/ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CALENEDITORDATAHANDLERTRACES_H__ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/traces/caleneditordocloaderTraces.h --- a/calendarui/caleneditor/traces/caleneditordocloaderTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/traces/caleneditordocloaderTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,20 @@ -// Created by TraceCompiler 2.2.3 +/* + * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: Definition file for class CalenEditorDocLoader. + * + */ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CALENEDITORDOCLOADERTRACES_H__ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/traces/caleneditorreminderfieldTraces.h --- a/calendarui/caleneditor/traces/caleneditorreminderfieldTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/traces/caleneditorreminderfieldTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,21 @@ -// Created by TraceCompiler 2.2.3 +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition of CalenEditorReminderField class. +* +*/ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CALENEDITORREMINDERFIELDTRACES_H__ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/traces/caleneditorrepeatfieldTraces.h --- a/calendarui/caleneditor/traces/caleneditorrepeatfieldTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/traces/caleneditorrepeatfieldTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,21 @@ -// Created by TraceCompiler 2.2.3 +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition of CalenEditorRepeatField class. +* +*/ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CALENEDITORREPEATFIELDTRACES_H__ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/caleneditor/traces/fixed_id.definitions --- a/calendarui/caleneditor/traces/fixed_id.definitions Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/caleneditor/traces/fixed_id.definitions Mon Sep 20 12:44:39 2010 +0530 @@ -1,3 +1,20 @@ +## +# This is Default Licence added by TraceCompiler +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +## #Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. [GROUP]TRACE_FLOW=0x8a [TRACE]TRACE_FLOW[0x8A]_CALENEDITORCUSTOMITEM_CALENEDITORCUSTOMITEM_ENTRY=0x9f @@ -161,6 +178,8 @@ [TRACE]TRACE_FLOW[0x8A]_CALENEDITORPRIVATE_ISREMINDERTIMEFORALLDAYADDED_ENTRY=0x92 [TRACE]TRACE_FLOW[0x8A]_CALENEDITORPRIVATE_ISREPEATUNTILITEMADDED_ENTRY=0x15c [TRACE]TRACE_FLOW[0x8A]_CALENEDITORPRIVATE_ISREPEATUNTILITEMADDED_EXIT=0x15d +[TRACE]TRACE_FLOW[0x8A]_CALENEDITORPRIVATE_LAUNCHDIALOG_ENTRY=0x169 +[TRACE]TRACE_FLOW[0x8A]_CALENEDITORPRIVATE_LAUNCHDIALOG_EXIT=0x16a [TRACE]TRACE_FLOW[0x8A]_CALENEDITORPRIVATE_LAUNCHSETTINGSVIEW_ENTRY=0x6e [TRACE]TRACE_FLOW[0x8A]_CALENEDITORPRIVATE_LAUNCHSETTINGSVIEW_EXIT=0x6f [TRACE]TRACE_FLOW[0x8A]_CALENEDITORPRIVATE_OPENEDITOR_ENTRY=0x28 diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/commonutils/bwins/calencommonutilsu.def --- a/calendarui/commonutils/bwins/calencommonutilsu.def Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/commonutils/bwins/calencommonutilsu.def Mon Sep 20 12:44:39 2010 +0530 @@ -18,4 +18,5 @@ ?futureOf@CalenDateUtils@@SA?AVQDateTime@@ABV2@H@Z @ 17 NONAME ; class QDateTime CalenDateUtils::futureOf(class QDateTime const &, int) ?now@CalenDateUtils@@SA?AVQDateTime@@XZ @ 18 NONAME ; class QDateTime CalenDateUtils::now(void) ?isAlldayEvent@CalenAgendaUtils@@SA_NABVAgendaEntry@@@Z @ 19 NONAME ; bool CalenAgendaUtils::isAlldayEvent(class AgendaEntry const &) + ?dateFormatString@CalenDateUtils@@SA?AVQString@@XZ @ 20 NONAME ; class QString CalenDateUtils::dateFormatString(void) diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/commonutils/eabi/calencommonutilsu.def --- a/calendarui/commonutils/eabi/calencommonutilsu.def Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/commonutils/eabi/calencommonutilsu.def Mon Sep 20 12:44:39 2010 +0530 @@ -18,4 +18,5 @@ _ZN14CalenDateUtils9timeOfDayERK9QDateTime @ 17 NONAME _ZN16CalenAgendaUtils16endsAtStartOfDayER11AgendaEntryRK9QDateTime @ 18 NONAME _ZN16CalenAgendaUtils13isAlldayEventERK11AgendaEntry @ 19 NONAME + _ZN14CalenDateUtils16dateFormatStringEv @ 20 NONAME diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/commonutils/inc/calendateutils.h --- a/calendarui/commonutils/inc/calendateutils.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/commonutils/inc/calendateutils.h Mon Sep 20 12:44:39 2010 +0530 @@ -120,6 +120,11 @@ static QDateTime defaultTime( const QDateTime& date ); static QDateTime futureOf(const QDateTime& dateTime, int numOfDays); + + /** + * @return the dateformat based current locale settings. + */ + static QString dateFormatString(); private: diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/commonutils/src/calendateutils.cpp --- a/calendarui/commonutils/src/calendateutils.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/commonutils/src/calendateutils.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -23,6 +23,8 @@ #include "calendateutils.h" #include +#include + // LOCAL CONSTANTS AND MACROS const int KDefaultStartTime(8); // 8 am ( 0 to 23 hour scale) @@ -266,4 +268,42 @@ result.setTime(dateTime.time()); return result; } + + /*! + Retruns the dateformat based current locale settings. + */ + QString CalenDateUtils::dateFormatString() + { + HbExtendedLocale locale = HbExtendedLocale::system(); + + QString dateFormat; + switch (locale.dateStyle()) { + case HbExtendedLocale::American: + dateFormat.append("MM"); + dateFormat.append(locale.dateSeparator(1)); + dateFormat.append("dd"); + dateFormat.append(locale.dateSeparator(1)); + dateFormat.append("yyyy"); + break; + + case HbExtendedLocale::European: + dateFormat.append("dd"); + dateFormat.append(locale.dateSeparator(1)); + dateFormat.append("MM"); + dateFormat.append(locale.dateSeparator(1)); + dateFormat.append("yyyy"); + break; + + case HbExtendedLocale::Japanese: + dateFormat.append("yyyy"); + dateFormat.append(locale.dateSeparator(1)); + dateFormat.append("MM"); + dateFormat.append(locale.dateSeparator(1)); + dateFormat.append("dd"); + break; + } + + return dateFormat; + } + // End of File diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/controller/inc/calendeleteui.h --- a/calendarui/controller/inc/calendeleteui.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/controller/inc/calendeleteui.h Mon Sep 20 12:44:39 2010 +0530 @@ -21,6 +21,7 @@ // System Includes #include +#include #include #include #include @@ -237,7 +238,7 @@ bool iIsDeleting; // True, if asynchronous delete is running QDateTime iStartTime; QDateTime iEndTime; - HbDateTimePicker *mDatePicker; + QPointer mDatePicker; HbAction *mDeleteAction; HbAction *mCancelAction; // Confirmation note id is stored here. Note is shown when asynchronous diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/controller/src/calendeleteui.cpp --- a/calendarui/controller/src/calendeleteui.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/controller/src/calendeleteui.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -107,6 +107,7 @@ RArray notifications; notifications.Append(ECalenNotifyCancelDelete); notifications.Append(ECalenNotifyCloseDialogs); + notifications.Append(ECalenNotifySystemLocaleChanged); iController.RegisterForNotificationsL( this, notifications ); @@ -115,6 +116,7 @@ iMoreEntriesToDelete = EFalse; iDisplayQuery = EFalse; iEntriesToDelete = KEntriesToDelete; + mDatePicker = 0; OstTraceFunctionExit0( CALENDELETEUI_CONSTRUCTL_EXIT ); } @@ -128,24 +130,33 @@ void CalenDeleteUi::HandleNotification(const TCalenNotification aNotification ) { OstTraceFunctionEntry0( CALENDELETEUI_HANDLENOTIFICATION_ENTRY ); - - if( aNotification == ECalenNotifyCancelDelete) - { - if(iMutlipleContextIdsCount) - { - // get the context - MCalenContext& context = iController.context(); - // reset the multiple contexts - context.resetMultipleContextIds(); - - } + switch(aNotification) { + case ECalenNotifyCancelDelete: { + if(iMutlipleContextIdsCount) + { + // get the context + MCalenContext& context = iController.context(); + // reset the multiple contexts + context.resetMultipleContextIds(); + } + break; } - else if (aNotification == ECalenNotifyCloseDialogs ) - { - // Emit the signal to close all the dialogs which are already opened - emit closeDialogs(); + case ECalenNotifyCloseDialogs: { + // Emit the signal to close all the dialogs which are already opened + emit closeDialogs(); + break; } - + case ECalenNotifySystemLocaleChanged: { + //Refresh the date picker of Date query when deleting entries before date + if(!(mDatePicker.isNull())) { + mDatePicker->setDisplayFormat(CalenDateUtils::dateFormatString()); + mDatePicker->setDate(QDate::currentDate()); + } + break; + } + default: + break; + } OstTraceFunctionExit0( CALENDELETEUI_HANDLENOTIFICATION_EXIT ); } @@ -411,6 +422,7 @@ mDatePicker = new HbDateTimePicker(popUp); mDatePicker->setMinimumDate(CalenDateUtils::minTime().date()); mDatePicker->setMaximumDate(currentDate); + mDatePicker->setDisplayFormat(CalenDateUtils::dateFormatString()); mDatePicker->setDate(currentDate); popUp->setContentWidget(mDatePicker); diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/controller/src/calenviewmanager.cpp --- a/calendarui/controller/src/calenviewmanager.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/controller/src/calenviewmanager.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -221,6 +221,13 @@ mController.MainWindow().addView(mCalenAgendaView); mController.MainWindow().setCurrentView(mCalenAgendaView); mController.MainWindow().addView(mCalenAgendaViewAlt); + } else if (view == ECalenDayView) { + mFirstView = ECalenDayView; + loadDayView(); + ActivateDefaultViewL(ECalenDayView); + // Add day view to mainwindow. + mController.MainWindow().addView(mCalenDayView); + mController.MainWindow().setCurrentView(mCalenDayView); } OstTraceFunctionExit0( CALENVIEWMANAGER_CONSTRUCTANDACTIVATEVIEW_EXIT ); } @@ -390,30 +397,32 @@ // Load all other views except mFirstView - // NOTE: Right now, since Calendar has only two views, month view + // NOTE: Right now, since Calendar has three views, month view, day view // and agenda view, when client launches agenda view, then there is no need // to construct the month view as per UI REQ., but tomorrow if new views // come after agenda view, then we need to construct those views if they are - // native views. Right now, there is a event viewer but its not a native - // view. Hence, if agenda view is launched, dont construct month view - if (mFirstView != ECalenAgendaView) // check if agenda view is not already loaded - { + // native views. Right now, day view will be constructed as we need to + // provide an option in options menu to switch between day view and agenda view + // There is a event viewer but its not a native view, so no need to constrcut it + // It will be constrcuted on demand. + // Hence, if agenda view is launched, constrcut the day vuew but dont construct month view. + // Vice-versa for when day view is maunched as first view + if (mFirstView == ECalenMonthView) { // Load all other views loadAgendaView(); if (!mCalenDayView) { loadDayView(); } - } - else //agenda view was launched as first view - { - // No implementation yet. UI specs not clear - // to be commented in with some more code once UI specs is frozen - // for agenda view launching as first view after it was saved as activity - // when it was launched from month view - // loadMonthView(); - // mCalenMonthView->doLazyLoading(); - } + } else if (mFirstView == ECalenAgendaView) { //agenda view was launched as first view + // Load day view + if (!mCalenDayView) { + loadDayView(); + } + } else if (mFirstView == ECalenDayView) { // Day view was launched as first view + // Load agenda view + loadAgendaView(); + } // Setup the settings view mSettingsView = new CalenSettingsView(mController.Services()); @@ -558,7 +567,10 @@ mCalenMonthView->doPopulation(); } else if (ECalenAgendaView == defaultView) { mCalenAgendaView->doPopulation(); - } + } else if (ECalenDayView == defaultView) { + mCalenDayView->doPopulation(); + } + OstTraceFunctionExit0( CALENVIEWMANAGER_ACTIVATEDEFAULTVIEWL_EXIT ); } diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/inc/calendateutils.h --- a/calendarui/inc/calendateutils.h Mon Sep 06 15:58:44 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ -/* -* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: ?Description - * -*/ - -#ifndef __CALENDATEUTILS_H__ -#define __CALENDATEUTILS_H__ - -#include -#include // Q_DECL_EXPORT macro - -#ifdef CALENDATEUTILS_DLL -#define CALENDATEUTIL_EXPORT Q_DECL_EXPORT -#else -#define CALENDATEUTIL_EXPORT Q_DECL_IMPORT -#endif - -// forward declarations -class QDateTime; - -/** - * CalenDateUtils contains static utility functions useful - * when comparing and calculating with dates and times. - * - * @lib Calendar.app - * @since 2.1 - */ - -class CALENDATEUTIL_EXPORT CalenDateUtils - { -public: - static bool onSameDay( const QDateTime& x, const QDateTime& y ); - static bool onSameMonth( const QDateTime& x, const QDateTime& y ); - static QDateTime beginningOfDay( const QDateTime& startTime ); - static QDateTime displayTimeOnDay( const QDateTime& startTime, - const QDateTime& day ); - - static bool timeRangesIntersect( const QDateTime& xStart, - const QDateTime& xEnd, - const QDateTime& yStart, - const QDateTime& yEnd ); - - /** - * Is aTime between KCalenMaxYear/KCalenMaxMonth/KCalenMaxDay - * and KCalenMinYear/KCalenMinMonth/KCalenMinDay. - * Min/Max day is defined agenda server. - * @param aTime aTime to be checked - * @return EFalse : Out of range - */ - static bool isValidDay( const QDateTime& time ); - - /** - * Return Min or Max time if aTime goes out of bounds. - * Valid range is [CalenDateUtils::MinTime(), CalenDateUtils::MaxTime] - * @param aTime time to be checked - * @return aTime, if aTime in [CalenDateUtils::MinTime(), CalenDateUtils::MaxTime] - * CalenDateUtils::MinTime(), if aTime < CalenDateUtils::MinTime() - * CalenDateUtils::MaxTime(), if aTime > CalenDateUtils::MaxTime() - */ - static QDateTime limitToValidTime( const QDateTime& time ); - - /** - * Return maximum allowed time. (31. - */ - static QDateTime maxTime(); - - /** - * Return minimum allowed time. - */ - static QDateTime minTime(); - - /** - * Return time of day as a minutes from midnight. Useful to get hours::minutes component of datetime, - * regardless of date - */ - static int timeOfDay( const QDateTime& dateTime ); - - /** - * Round QDateTime to previous full hour, e.g. RoundToPreviousHour( 23.11.2006 9:31 ) = 23.11.2006 9:00 - */ - static QDateTime roundToPreviousHour( const QDateTime& dateTime ); - - /** - * Round QDateTimeIntervalMinutes to previous full hour, e.g. RoundToPreviousHour( 130 min ) = 120 min - */ - static int roundToPreviousHour( const int& minutes ); - - - /** - * @return current time. - */ - static QDateTime now(); - - /** - * @return today with time component set to 00:00. - */ - static QDateTime today(); - - /** - * @return ETrue if given aTime is on today, EFalse otherwise - */ - static bool isOnToday( const QDateTime& time ); - - /* - * Given aDate = DD::MM::YY @ hh:mm:ss, it returns a QDateTime obj DD::MM::YY @ 08:00 am - * @param: aDate, which has the DD::MM::YY - */ - static QDateTime defaultTime( const QDateTime& date ); - - static QDateTime futureOf(const QDateTime& dateTime, int numOfDays); - - -private: - // Hiding constructor, because this is static utility class. - //lint -e{1526} - CalenDateUtils(); - - // Hiding assignment, because this is static utility class. - //lint -e{1526} - CalenDateUtils& operator=( const CalenDateUtils& ); - - }; - -#endif // __CALENDATEUTILS_H__ - - -// End of File diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/regionalplugins/calenregionalutil/src/calenextrarowformatter.cpp --- a/calendarui/regionalplugins/calenregionalutil/src/calenextrarowformatter.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/regionalplugins/calenregionalutil/src/calenextrarowformatter.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -20,6 +20,7 @@ #include #include +#include #include "calendarui_debug.h" #include "CalenExtraRowFormatter.h" @@ -222,15 +223,14 @@ // Format all fields to single row QString textDataString; - textDataString = hbTrId( - "txt_calendar_preview_title_123242526").arg( + textDataString = HbParameterLengthLimiter( + hbTrId("txt_calendar_preview_title_123242526")).arg( textDataStringList.at(0)).arg( - separator).arg( - textDataStringList.at(1)).arg( - textDataStringList.at(2)).arg( - textDataStringList.at(3)).arg( - textDataStringList.at(4)); - + separator).arg(textDataStringList.at(1)).arg( + separator).arg(textDataStringList.at(2)).arg( + separator).arg(textDataStringList.at(3)).arg( + separator).arg(textDataStringList.at(4)); + iText = static_cast ( textDataString.utf16()), textDataString.length(); diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/regionalplugins/calenregionalutil/src/calenlunarlocalizer.cpp --- a/calendarui/regionalplugins/calenregionalutil/src/calenlunarlocalizer.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/regionalplugins/calenregionalutil/src/calenlunarlocalizer.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -184,36 +185,52 @@ if ( aInfo.HasFestival() ) { QString festival = iFestivalNames.at(aInfo.iFestival); - localized->iFestival.Set( static_cast(festival.utf16()),festival.length()); + localized->iFestival.Set( + static_cast(festival.utf16()),festival.length()); } if ( aInfo.HasSolarTerm() ) { QString solarTerm = iSolarTermNames.at(aInfo.iSolarTerm); - localized->iSolarTerm.Set( static_cast(solarTerm.utf16()),solarTerm.length()); + localized->iSolarTerm.Set( + static_cast(solarTerm.utf16()),solarTerm.length()); } // Animal year QString animalYear = iAnimalYearNames.at(aInfo.AnimalYear()); - localized->iAnimalYear.Set( static_cast(animalYear.utf16()),animalYear.length()); + localized->iAnimalYear.Set( + static_cast(animalYear.utf16()),animalYear.length()); // Lunar year QString heavenlyStemNames = iHeavenlyStemNames.at(aInfo.iHeavenlyStem); - QString terrestialBranchNames = iTerrestialBranchNames.at(aInfo.iTerrestialBranch); - QString lunarYear = hbTrId("txt_calendar_info_lunar_year").arg(heavenlyStemNames).arg(terrestialBranchNames); - localized->iLunarYear = static_cast (lunarYear.utf16()), lunarYear.length(); + QString terrestialBranchNames = + iTerrestialBranchNames.at(aInfo.iTerrestialBranch); + QString lunarYear = HbParameterLengthLimiter( + hbTrId("txt_calendar_info_lunar_year")).arg( + heavenlyStemNames).arg(terrestialBranchNames); + localized->iLunarYear = + static_cast (lunarYear.utf16()), lunarYear.length(); LocalizeMonthAndDayL(localized, aInfo); - QString monthAndDay = QString::fromUtf16(localized->LunarMonthAndDay().Ptr(),localized->LunarMonthAndDay().Length()); - QString yearString = QString::fromUtf16(localized->LunarYear().Ptr(),localized->LunarYear().Length()); - QString fullLunarDate = hbTrId("txt_calendar_info_lunar_full_date").arg(monthAndDay).arg(yearString); + QString monthAndDay = + QString::fromUtf16(localized->LunarMonthAndDay().Ptr(), + localized->LunarMonthAndDay().Length()); + QString yearString = + QString::fromUtf16(localized->LunarYear().Ptr(), + localized->LunarYear().Length()); + QString fullLunarDate = HbParameterLengthLimiter( + hbTrId("txt_calendar_info_lunar_full_date")).arg( + monthAndDay).arg(yearString); - localized->iFullLunarDate = static_cast (fullLunarDate.utf16()), fullLunarDate.length(); + localized->iFullLunarDate = + static_cast (fullLunarDate.utf16()), + fullLunarDate.length(); QString format(r_qtn_date_usual_with_zero); TBuf<100> gregFormatBuf; - gregFormatBuf = static_cast (format.utf16()), format.length(); + gregFormatBuf = + static_cast (format.utf16()), format.length(); aInfo.iGregorianDate.FormatL( localized->iGregorianDate, gregFormatBuf ); @@ -262,13 +279,13 @@ QString formattedString; if(aInfo.iLunarDate.iLeapMonth) { - formattedString = hbTrId( - "txt_calendar_info_lunar_leap_date").arg( + formattedString = HbParameterLengthLimiter(hbTrId( + "txt_calendar_info_lunar_leap_date")).arg( QString((QChar*)month.Ptr(),month.Length())).arg( QString((QChar*)day.Ptr(),day.Length())); }else { - formattedString = hbTrId( - "txt_calendar_info_lunar_date").arg( + formattedString = HbParameterLengthLimiter(hbTrId( + "txt_calendar_info_lunar_date")).arg( QString((QChar*)month.Ptr(),month.Length())).arg( QString((QChar*)day.Ptr(),day.Length())); } diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/settings/src/calensettings.cpp --- a/calendarui/settings/src/calensettings.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/settings/src/calensettings.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -57,6 +57,9 @@ mShowRegionalInfoKey = new XQSettingsKey( XQSettingsKey::TargetCentralRepository, KCRUidCalendar, KCalendarShowRegionalInfo); + + // Enable the pixmap cache for better scrolling performance + mSettingsForm->setItemPixmapCacheEnabled(true); } /*! @@ -310,9 +313,10 @@ mShowWeekNumberItem->setData(HbDataFormModelItem::LabelRole, QString(hbTrId("txt_calendar_setlabel_show_week_numbers"))); mShowWeekNumberItem->setContentWidgetData("objectName", "showWeekNumber"); - mSettingsModel->appendDataFormItem(mShowWeekNumberItem); mSettingsForm->addConnection(mShowWeekNumberItem, SIGNAL(clicked()), this, SLOT(handleWeekNumberChange())); + mSettingsModel->appendDataFormItem(mShowWeekNumberItem); + } /*! diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/bwins/calenviewsu.def --- a/calendarui/views/bwins/calenviewsu.def Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/bwins/calenviewsu.def Mon Sep 20 12:44:39 2010 +0530 @@ -207,4 +207,6 @@ ?getActiveDay@CalenMonthView@@QAE?AVQDateTime@@XZ @ 206 NONAME ; class QDateTime CalenMonthView::getActiveDay(void) ?addRemoveActionsInMenu@CalenMonthView@@AAEXXZ @ 207 NONAME ; void CalenMonthView::addRemoveActionsInMenu(void) ??1CalenDayContentScrollArea@@UAE@XZ @ 208 NONAME ; CalenDayContentScrollArea::~CalenDayContentScrollArea(void) + ?polish@CalenThickLinesDrawer@@MAEXAAVHbStyleParameters@@@Z @ 209 NONAME ; void CalenThickLinesDrawer::polish(class HbStyleParameters &) + ?checkIfWeCanScroll@CalenMonthGrid@@AAE_NW4scrollDirection@@@Z @ 210 NONAME ; bool CalenMonthGrid::checkIfWeCanScroll(enum scrollDirection) diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/inc/calendaycontentwidget.h --- a/calendarui/views/dayview/inc/calendaycontentwidget.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/inc/calendaycontentwidget.h Mon Sep 20 12:44:39 2010 +0530 @@ -26,8 +26,6 @@ // Forward declarations class QGraphicsLinearLayout; -class CalenDayModelManager; - class CalenDayContentWidget : public HbWidget { @@ -45,12 +43,11 @@ }; public: - CalenDayContentWidget(CalenDayModelManager &modelManager, - QGraphicsItem *parent = 0); + CalenDayContentWidget(QGraphicsItem *parent = 0); ~CalenDayContentWidget(); - void add(HbWidget* item, CalenWidgetPosition where = ECalenLastWidget); - HbWidget* take(CalenWidgetPosition which); + void add(HbWidget *item, CalenWidgetPosition where = ECalenLastWidget); + HbWidget *take(CalenWidgetPosition which); void remove(CalenWidgetPosition which); signals: @@ -60,16 +57,11 @@ public slots: void relayoutWidgets(CalenScrollDirection scrollTo); void widgetScrolled(const QPointF &newPos); - -protected: - void initializeViews(); private: - QGraphicsLinearLayout* mLayout; //!< Linear layout for day views + QGraphicsLinearLayout *mLayout; //!< Linear layout for day views - QList mWidgets; //!< List of widget instances - - CalenDayModelManager &mModelManager; //!< Reference to model manager + QList mWidgets; //!< List of widget instances }; #endif /* CALENDAYCONTENTWIDGET_H_ */ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/inc/calendayitemview.h --- a/calendarui/views/dayview/inc/calendayitemview.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/inc/calendayitemview.h Mon Sep 20 12:44:39 2010 +0530 @@ -55,6 +55,9 @@ void scrollTo( const QModelIndex &index, HbAbstractItemView::ScrollHint hint = EnsureVisible); + + HbMenu *contextMenu() const; + void setContextMenu(HbMenu *contextMenu); public slots: diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/inc/calendayview.h --- a/calendarui/views/dayview/inc/calendayview.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/inc/calendayview.h Mon Sep 20 12:44:39 2010 +0530 @@ -162,6 +162,8 @@ */ void setupSlots(); + void initializeViews(); + private: // members related to view management and gesture handling CalenDayModelManager* mModelManager; diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/src/calendaycontentwidget.cpp --- a/calendarui/views/dayview/src/calendaycontentwidget.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/src/calendaycontentwidget.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -17,13 +17,10 @@ // System includes #include -#include // User includes -#include "calendaymodelmanager.h" #include "calendaycontentwidget.h" #include "calendayitemview.h" -#include "calendaycontentscrollarea.h" /*! \class CalenDayContentWidget @@ -33,16 +30,12 @@ /*! \brief Constructor - \param modelManager Day View model manager \param parent The parent of central widget */ -CalenDayContentWidget::CalenDayContentWidget( - CalenDayModelManager &modelManager, - QGraphicsItem *parent) : - HbWidget(parent), mLayout(NULL), mModelManager(modelManager) +CalenDayContentWidget::CalenDayContentWidget(QGraphicsItem *parent) : + HbWidget(parent), mLayout(NULL) { mWidgets.clear(); - initializeViews(); } /*! @@ -62,32 +55,34 @@ \param item Widget to be added \param where Place where widget should be added (as first/last item) */ -void CalenDayContentWidget::add(HbWidget* item, CalenWidgetPosition where) +void CalenDayContentWidget::add(HbWidget *item, CalenWidgetPosition where) { - // Create linear, horizontal layout if not exist - if (!mLayout) { - mLayout = new QGraphicsLinearLayout(Qt::Horizontal, NULL); - mLayout->setContentsMargins(0.0, 0.0, 0.0, 0.0); - mLayout->setSpacing(0.0); - } + if (item) { + // Create linear, horizontal layout if not exist + if (!mLayout) { + mLayout = new QGraphicsLinearLayout(Qt::Horizontal, NULL); + mLayout->setContentsMargins(0.0, 0.0, 0.0, 0.0); + mLayout->setSpacing(0.0); + } - switch (where) { - case ECalenFirstWidget: { - mLayout->insertItem(0, item); - mWidgets.insert(0, item); - break; + switch (where) { + case ECalenFirstWidget: { + mLayout->insertItem(0, item); + mWidgets.insert(0, item); + break; + } + case ECalenLastWidget: + default: { + mLayout->addItem(item); + mWidgets.append(item); + } } - case ECalenLastWidget: - default: { - mLayout->addItem(item); - mWidgets.append(item); + + // If layout has no parent - apply it to central widget + if (mLayout && !mLayout->parentLayoutItem()) { + setLayout(mLayout); } } - - // If layout has no parent - apply it to central widget - if (mLayout && !mLayout->parentLayoutItem()) { - setLayout(mLayout); - } } /*! @@ -100,24 +95,27 @@ */ HbWidget* CalenDayContentWidget::take(CalenWidgetPosition which) { - Q_ASSERT(mLayout); - - HbWidget* itemToTake = NULL; - switch (which) { - case ECalenFirstWidget: { - itemToTake = mWidgets.takeFirst(); - break; + HbWidget *itemToTake = NULL; + if (mWidgets.count() > 0) { + switch (which) { + case ECalenFirstWidget: { + itemToTake = mWidgets.takeFirst(); + break; + } + case ECalenLastWidget: { + itemToTake = mWidgets.takeLast(); + break; + } + default: { + // do nothing + } } - case ECalenLastWidget: - default: { - itemToTake = mWidgets.takeLast(); + + if (mLayout && itemToTake) { + mLayout->removeItem(itemToTake); } } - if (itemToTake) { - mLayout->removeItem(itemToTake); - } - return itemToTake; } @@ -130,22 +128,8 @@ */ void CalenDayContentWidget::remove(CalenWidgetPosition which) { - Q_ASSERT(mLayout); - - HbWidget* itemToRemove = NULL; - switch (which) { - case ECalenFirstWidget: { - itemToRemove = mWidgets.takeFirst(); - break; - } - case ECalenLastWidget: - default: { - itemToRemove = mWidgets.takeLast(); - } - } - + HbWidget *itemToRemove = take(which); if (itemToRemove) { - mLayout->removeItem(itemToRemove); delete itemToRemove; } } @@ -163,18 +147,21 @@ */ void CalenDayContentWidget::relayoutWidgets(CalenScrollDirection scrollTo) { - HbWidget* widget = NULL; + HbWidget *widget = NULL; switch (scrollTo) { case ECalenScrollToNext: { widget = take(ECalenFirstWidget); add(widget, ECalenLastWidget); break; } - case ECalenScrollToPrev: - default: { + case ECalenScrollToPrev: { widget = take(ECalenLastWidget); add(widget, ECalenFirstWidget); } + case ECalenScrollNoDayChange: + default: { + // do nothing + } } emit widgetsRelayoutFinished(scrollTo); } @@ -194,53 +181,4 @@ emit scrollPositionChanged(newPos); } -/*! - \brief Initializes content widgets and adds them to layout. - - \param parent Parent object - */ -void CalenDayContentWidget::initializeViews() -{ - // Create item views - HbModelIterator *iterator(0); - - iterator = new HbModelIterator(&mModelManager.getModel( - CalenDayModelManager::PreviousDay)); - CalenDayItemView *prevItemView = new CalenDayItemView( - mModelManager.getServices(), iterator, 0); - - iterator = new HbModelIterator(&mModelManager.getModel( - CalenDayModelManager::CurrentDay)); - CalenDayItemView *currItemView = new CalenDayItemView( - mModelManager.getServices(), iterator, 0); - - iterator = new HbModelIterator(&mModelManager.getModel( - CalenDayModelManager::NextDay)); - CalenDayItemView *nextItemView = new CalenDayItemView( - mModelManager.getServices(), iterator, 0); - - // Connecting views with widgetScrolled SLOT - // to support simultanous vertical scrolling - connect(prevItemView, SIGNAL(scrollPositionChanged(const QPointF&)), this, - SLOT(widgetScrolled(const QPointF&))); - connect(currItemView, SIGNAL(scrollPositionChanged(const QPointF&)), this, - SLOT(widgetScrolled(const QPointF&))); - connect(nextItemView, SIGNAL(scrollPositionChanged(const QPointF&)), this, - SLOT(widgetScrolled(const QPointF&))); - - if (parentItem()) { - // Install event filters to receive events necessary for gesture handling - CalenDayContentScrollArea* scrollArea = - static_cast (parentItem()); - prevItemView->installEventFilter(scrollArea); - currItemView->installEventFilter(scrollArea); - nextItemView->installEventFilter(scrollArea); - } - - // Add views to layout - add(prevItemView); - add(currItemView); - add(nextItemView); -} - // End of File diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/src/calendayitemview.cpp --- a/calendarui/views/dayview/src/calendayitemview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/src/calendayitemview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -26,6 +26,7 @@ #include "calendayitemview.h" #include "calendayutils.h" #include "calendaycontainer.h" +#include "calendayitemview.h" #include "calendayinfo.h" #include "calendaymodel.h" #include "calenservices.h" @@ -88,6 +89,26 @@ } /*! + \brief Gets context menu of ItemView + + \return Context menu + */ +HbMenu *CalenDayItemView::contextMenu() const +{ + return mContextMenu; +} + +/*! + \brief Sets context menu of ItemView + + \param contextMenu Context menu + */ +void CalenDayItemView::setContextMenu(HbMenu *contextMenu) +{ + mContextMenu = contextMenu; +} + +/*! \brief Currently empty implementation. */ void CalenDayItemView::reset() diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/src/calendayview.cpp --- a/calendarui/views/dayview/src/calendayview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/src/calendayview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -29,6 +29,7 @@ #include #include #include +#include #include // User includes @@ -41,6 +42,7 @@ #include "calendaycontentscrollarea.h" #include "calendaycontentwidget.h" #include "calendayhourscrollarea.h" +#include "calendayitemview.h" #include "calendaymodelmanager.h" #include "CalenUid.h" #include "CalendarPrivateCRKeys.h" @@ -70,8 +72,9 @@ mSettingsManager = new XQSettingsManager(this); mSettingsManager->startMonitoring(mRegionalInfoKey); - //setup Back functionality - if (ECalenDayView != mServices.getFirstView()) { + //setup Back functionality, launch the month view only when it is + // the first view + if (ECalenMonthView == mServices.getFirstView()) { HbAction* action = new HbAction(Hb::BackNaviAction, this); setNavigationAction(action); // Connect to the signal triggered by clicking on back button. @@ -208,9 +211,10 @@ = static_cast (mDocLoader->findWidget( CALEN_DAYVIEW_CONTENTSCROLLAREA)); // Pass parent object to mContentWidget to install event filters on parent - mContentWidget = new CalenDayContentWidget(*mModelManager, mContentScrollArea); + mContentWidget = new CalenDayContentWidget(mContentScrollArea); mContentScrollArea->setContentWidget(mContentWidget); - + + initializeViews(); setupSlots(); // Set up regional info if variant is correct @@ -356,6 +360,57 @@ } /*! + \brief Initializes internal views. + + CalenDayView uses 3 child views which represent previous, current and next days. + This assures that swiping to prev/next day works smoothly, because population + of data is done earlier. +*/ +void CalenDayView::initializeViews() +{ + // Create item views + HbModelIterator *iterator(0); + + iterator = new HbModelIterator(&mModelManager->getModel( + CalenDayModelManager::PreviousDay)); + CalenDayItemView *prevItemView = new CalenDayItemView( + mModelManager->getServices(), iterator, 0); + + iterator = new HbModelIterator(&mModelManager->getModel( + CalenDayModelManager::CurrentDay)); + CalenDayItemView *currItemView = new CalenDayItemView( + mModelManager->getServices(), iterator, 0); + + iterator = new HbModelIterator(&mModelManager->getModel( + CalenDayModelManager::NextDay)); + CalenDayItemView *nextItemView = new CalenDayItemView( + mModelManager->getServices(), iterator, 0); + + // Connect views with widgetScrolled SLOT to support simultanous vertical scrolling + connect(prevItemView, SIGNAL(scrollPositionChanged(const QPointF&)), mContentWidget, + SLOT(widgetScrolled(const QPointF&))); + connect(currItemView, SIGNAL(scrollPositionChanged(const QPointF&)), mContentWidget, + SLOT(widgetScrolled(const QPointF&))); + connect(nextItemView, SIGNAL(scrollPositionChanged(const QPointF&)), mContentWidget, + SLOT(widgetScrolled(const QPointF&))); + + // Close menu once closeDialogs() is received + connect(this, SIGNAL(closeDialogs()), prevItemView->contextMenu(), SLOT(close())); + connect(this, SIGNAL(closeDialogs()), currItemView->contextMenu(), SLOT(close())); + connect(this, SIGNAL(closeDialogs()), nextItemView->contextMenu(), SLOT(close())); + + // Install event filters to receive events necessary for gesture handling + prevItemView->installEventFilter(mContentScrollArea); + currItemView->installEventFilter(mContentScrollArea); + nextItemView->installEventFilter(mContentScrollArea); + + // Add views to layout + mContentWidget->add(prevItemView); + mContentWidget->add(currItemView); + mContentWidget->add(nextItemView); +} + +/*! \brief This slot triggers new meeting creation view */ void CalenDayView::runNewMeeting() diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/calendaycontentwidgetheaders.h --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/calendaycontentwidgetheaders.h Mon Sep 06 15:58:44 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Mocked classes for testing CalenDayContentWidget class -* -*/ - -#ifndef CALENSERVICES_H -#define CALENSERVICES_H - -/*! - Mocked class MCalenServices - */ -class MCalenServices -{ -public: - MCalenServices() { - - } - - ~MCalenServices() { - - } -}; - -#endif // CALENSERVICES_H - - -#ifndef CALENDAYITEMVIEW_H -#define CALENDAYITEMVIEW_H - -#include -#include -#include -#include - -/*! - Mocked class CalenDayItemView - */ -class CalenDayItemView : public HbWidget -{ - Q_OBJECT - -public: - CalenDayItemView(MCalenServices &services, HbModelIterator *iterator, - QGraphicsItem *parent) : HbWidget(parent) { - Q_UNUSED(services) - Q_UNUSED(iterator) - } - - void scrollVertically(const QPointF &newPosition) { - Q_UNUSED(newPosition) - } - -signals: - void scrollPositionChanged(const QPointF&); -}; - -#endif // CALENDAYITEMVIEW_H - diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/calendayitemview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/calendayitemview.h Mon Sep 20 12:44:39 2010 +0530 @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked classes for testing CalenDayContentWidget class +* +*/ + +#ifndef CALENSERVICES_H +#define CALENSERVICES_H + +/*! + Mocked class MCalenServices + */ +class MCalenServices +{ +public: + MCalenServices() { + + } + + ~MCalenServices() { + + } +}; + +#endif // CALENSERVICES_H + + +#ifndef CALENDAYITEMVIEW_H +#define CALENDAYITEMVIEW_H + +#include +#include +#include +#include + +/*! + Mocked class CalenDayItemView + */ +class CalenDayItemView : public HbWidget +{ + Q_OBJECT + +public: + CalenDayItemView(MCalenServices &services, HbModelIterator *iterator, + QGraphicsItem *parent = NULL) : HbWidget(parent) { + Q_UNUSED(services) + Q_UNUSED(iterator) + + mCurrentPos = QPointF(0,0); + } + ~CalenDayItemView() { + + } + + void scrollVertically(const QPointF &newPosition) { + mCurrentPos = newPosition; + } + +signals: + void scrollPositionChanged(const QPointF&); + +public: + QPointF mCurrentPos; +}; + +#endif // CALENDAYITEMVIEW_H + diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/calendaymodelmanager.h --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/calendaymodelmanager.h Mon Sep 06 15:58:44 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Mocked classes for testing CalenDayContentWidget class -* -*/ - - -#include "calendaycontentwidgetheaders.h" - - -#ifndef CALENDAYMODELMANAGER_H -#define CALENDAYMODELMANAGER_H - -#include - -/*! - Test class TestAbstractListModel - */ -class TestAbstractListModel : public QAbstractListModel -{ - Q_OBJECT - -public: - TestAbstractListModel() : QAbstractListModel() { - } - - ~TestAbstractListModel() { - } - - int rowCount(const QModelIndex &parent) const { - Q_UNUSED(parent); - return 0; - } - - QVariant data(const QModelIndex &index, int role) const { - Q_UNUSED(index); - Q_UNUSED(role); - return QVariant(0); - } -}; - -/*! - Test class CalenDayModelManager - */ -class CalenDayModelManager : public QObject -{ -public: - enum ModelDay { - PreviousDay = 0, - CurrentDay = 1, - NextDay = 2, - NumberOfDays - }; - - CalenDayModelManager() : QObject() { - mModel = new TestAbstractListModel(); - mServices = new MCalenServices(); - } - - ~CalenDayModelManager() { - if (mModel) { - delete mModel; - mModel = NULL; - } - - if (mServices) { - delete mServices; - mServices = NULL; - } - } - - QAbstractItemModel &getModel(CalenDayModelManager::ModelDay day) { - Q_UNUSED(day) - return *mModel; - } - - MCalenServices &getServices() { - return *mServices; - } - -public: - TestAbstractListModel *mModel; - MCalenServices *mServices; -}; - -#endif//CALENDAYMODELMANAGER_H diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/unittest_calendaycontentwidget.cpp --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/unittest_calendaycontentwidget.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/unittest_calendaycontentwidget.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -17,8 +17,9 @@ #include #include +#define private public -#include "calendaymodelmanager.h" +#include "calendayitemview.h" #include "calendaycontentwidget.h" class TestCalenContentWidget : public QObject @@ -36,9 +37,13 @@ void cleanup(); void testConstructors(); + void testAdd(); + void testTake(); + void testRemove(); + void testRelayoutWidgets(); + void testWidgetScrolled(); private: - CalenDayModelManager *mModelMgr; CalenDayContentWidget *mContentWidget; }; @@ -46,7 +51,7 @@ Constructor */ TestCalenContentWidget::TestCalenContentWidget() : - mModelMgr(NULL), mContentWidget(NULL) + mContentWidget(NULL) { } @@ -64,7 +69,6 @@ */ void TestCalenContentWidget::initTestCase() { - mModelMgr = new CalenDayModelManager(); } /*! @@ -72,9 +76,6 @@ */ void TestCalenContentWidget::cleanupTestCase() { - if (mModelMgr) { - delete mModelMgr; - } } /*! @@ -82,7 +83,7 @@ */ void TestCalenContentWidget::init() { - + mContentWidget = new CalenDayContentWidget(); } /*! @@ -102,9 +103,217 @@ */ void TestCalenContentWidget::testConstructors() { - QVERIFY(!mContentWidget); - mContentWidget = new CalenDayContentWidget(*mModelMgr); - QVERIFY(mContentWidget); + CalenDayContentWidget *contentWidget = NULL; + + QVERIFY(!contentWidget); + contentWidget = new CalenDayContentWidget(); + QVERIFY(contentWidget); + + delete contentWidget; +} + +/*! + Test add() function + 1. Test no error when trying to add NULL pointer + 2. Test if widget is added correctly and layout is created + 3. Test if widget is added correctly at end of list + 4. Test if widget is added correctly as first item + 5. Test if widget is added correctly when no position is specified + */ +void TestCalenContentWidget::testAdd() +{ + QCOMPARE(mContentWidget->mWidgets.count(), 0); + QVERIFY(!mContentWidget->mLayout); + + //1) + mContentWidget->add(NULL); + QCOMPARE(mContentWidget->mWidgets.count(), 0); + QVERIFY(!mContentWidget->mLayout); + + //2) + HbWidget *second = new HbWidget(); + mContentWidget->add(second); + QVERIFY(mContentWidget->mLayout); + QCOMPARE(mContentWidget->mWidgets.count(), 1); + + //3) + HbWidget *last = new HbWidget(); + mContentWidget->add(last, CalenDayContentWidget::ECalenLastWidget); + QCOMPARE(mContentWidget->mWidgets.count(), 2); + QCOMPARE(mContentWidget->mWidgets.at(1), last); + + //4) + HbWidget *first = new HbWidget(); + mContentWidget->add(first, CalenDayContentWidget::ECalenFirstWidget); + QCOMPARE(mContentWidget->mWidgets.count(), 3); + QCOMPARE(mContentWidget->mWidgets.at(0), first); + + //5) + HbWidget *other = new HbWidget(); + mContentWidget->add(other, CalenDayContentWidget::CalenWidgetPosition(-1)); + QCOMPARE(mContentWidget->mWidgets.count(), 4); + QCOMPARE(mContentWidget->mWidgets.last(), other); +} + +/*! + Test take() function + 1. Test NULL pointer if there are no widgets to be taken + 2. Test if first widget is taken correctly + 3. Test if last widget is taken correctly + 4. Test default behavior if wrong position is specified + */ +void TestCalenContentWidget::testTake() +{ + QCOMPARE(mContentWidget->mWidgets.count(), 0); + + //1) + QVERIFY(!mContentWidget->take(CalenDayContentWidget::ECalenFirstWidget)); + + // Prepare data + HbWidget *first = new HbWidget(); + HbWidget *second = new HbWidget(); + HbWidget *last = new HbWidget(); + mContentWidget->add(first); + mContentWidget->add(second); + mContentWidget->add(last); + QCOMPARE(mContentWidget->mWidgets.count(), 3); + + //2) + HbWidget *widget = mContentWidget->take(CalenDayContentWidget::ECalenFirstWidget); + QCOMPARE(mContentWidget->mWidgets.count(), 2); + QCOMPARE(widget, first); + + delete widget; + widget = NULL; + + //3) + widget = mContentWidget->take(CalenDayContentWidget::ECalenLastWidget); + QCOMPARE(mContentWidget->mWidgets.count(), 1); + QCOMPARE(widget, last); + + delete widget; + widget = NULL; + + //4) + widget = mContentWidget->take(CalenDayContentWidget::CalenWidgetPosition(-1)); + QCOMPARE(mContentWidget->mWidgets.count(), 1); + QVERIFY(!widget); +} + +/*! + Test remove() function + 1. Test if there is no error if remove is called on empty content + 2. Test if first widget is removed correctly + 3. Test if last widget is removed correctly + */ +void TestCalenContentWidget::testRemove() +{ + QCOMPARE(mContentWidget->mWidgets.count(), 0); + + //1) + mContentWidget->remove(CalenDayContentWidget::ECalenFirstWidget); + QCOMPARE(mContentWidget->mWidgets.count(), 0); + + // Prepare data + HbWidget *first = new HbWidget(); + HbWidget *second = new HbWidget(); + HbWidget *last = new HbWidget(); + mContentWidget->add(first); + mContentWidget->add(second); + mContentWidget->add(last); + QCOMPARE(mContentWidget->mWidgets.count(), 3); + + //2) + mContentWidget->remove(CalenDayContentWidget::ECalenFirstWidget); + QCOMPARE(mContentWidget->mWidgets.count(), 2); + QCOMPARE(mContentWidget->mWidgets.first(), second); + + //3) + mContentWidget->remove(CalenDayContentWidget::ECalenLastWidget); + QCOMPARE(mContentWidget->mWidgets.count(), 1); + QCOMPARE(mContentWidget->mWidgets.last(), second); +} + +/*! + Test relayoutWidgets() slot + 1. Test if relayout widgets on empty content + 2. Test ECalenScrollToNext case + 3. Test ECalenScrollToPrev case + 4. Test ECalenScrollNoDayChange case + 5. Test wrong case + */ +void TestCalenContentWidget::testRelayoutWidgets() +{ + QCOMPARE(mContentWidget->mWidgets.count(), 0); + + //1) + mContentWidget->relayoutWidgets(ECalenScrollNoDayChange); + QCOMPARE(mContentWidget->mWidgets.count(), 0); + + // Prepare data + HbWidget *first = new HbWidget(); + HbWidget *second = new HbWidget(); + HbWidget *last = new HbWidget(); + mContentWidget->add(first); + mContentWidget->add(second); + mContentWidget->add(last); + QCOMPARE(mContentWidget->mWidgets.count(), 3); + + //2) + mContentWidget->relayoutWidgets(ECalenScrollToNext); + QCOMPARE(mContentWidget->mWidgets.first(), second); + + //3) + mContentWidget->relayoutWidgets(ECalenScrollToPrev); + QCOMPARE(mContentWidget->mWidgets.first(), first); + + //4) + mContentWidget->relayoutWidgets(ECalenScrollNoDayChange); + QCOMPARE(mContentWidget->mWidgets.first(), first); + + //5) + mContentWidget->relayoutWidgets(CalenScrollDirection(-1)); + QCOMPARE(mContentWidget->mWidgets.first(), first); +} + +/*! + Test testWidgetScrolled() slot + 1. Test widgetScrolled with empty content + 2. Test widgetScrolled with 3 views + */ +void TestCalenContentWidget::testWidgetScrolled() +{ + QCOMPARE(mContentWidget->mWidgets.count(), 0); + QPointF newPos(10, 20); + + //1) + mContentWidget->widgetScrolled(newPos); + QCOMPARE(mContentWidget->mWidgets.count(), 0); + +#ifndef __WINSCW__ + // Prepare data + MCalenServices services; + HbModelIterator iterator(0); + CalenDayItemView *first = new CalenDayItemView(services, &iterator); + CalenDayItemView *second = new CalenDayItemView(services, &iterator); + CalenDayItemView *last = new CalenDayItemView(services, &iterator); + mContentWidget->add(first); + mContentWidget->add(second); + mContentWidget->add(last); + QCOMPARE(mContentWidget->mWidgets.count(), 3); + QCOMPARE(first->mCurrentPos, QPointF(0,0)); + QCOMPARE(second->mCurrentPos, QPointF(0,0)); + QCOMPARE(last->mCurrentPos, QPointF(0,0)); + + //2 + mContentWidget->widgetScrolled(newPos); + CalenDayItemView *view = static_cast (mContentWidget->mWidgets.at(0)); + QCOMPARE(view->mCurrentPos, newPos); + view = static_cast (mContentWidget->mWidgets.at(1)); + QCOMPARE(view->mCurrentPos, newPos); + view = static_cast (mContentWidget->mWidgets.at(2)); + QCOMPARE(view->mCurrentPos, newPos); +#endif // __WINSCW__ } QTEST_MAIN(TestCalenContentWidget); diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/unittest_calendaycontentwidget.pro --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/unittest_calendaycontentwidget.pro Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendaycontentwidget/unittest_calendaycontentwidget.pro Mon Sep 20 12:44:39 2010 +0530 @@ -22,7 +22,7 @@ CONFIG += qtestlib CONFIG += symbian_test CONFIG += hb - + INCLUDEPATH += . \ ../../../inc/ \ @@ -31,8 +31,7 @@ ../../../src/ # Input -HEADERS += calendaymodelmanager.h \ - calendaycontentwidgetheaders.h \ +HEADERS += calendayitemview.h \ calendaycontentwidget.h diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayutils/HbDeviceProfile --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendayutils/HbDeviceProfile Mon Sep 20 12:44:39 2010 +0530 @@ -0,0 +1,1 @@ +#include "hbdeviceprofile.h" \ No newline at end of file diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calencontext.h --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calencontext.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calencontext.h Mon Sep 20 12:44:39 2010 +0530 @@ -52,6 +52,13 @@ { return QDateTime(QDate(2000, 10, 10)); } + + void setFocusDateAndTimeAndInstance( const QDateTime& focusDateTime, + const TCalenInstanceId& aInstanceId ) + { + Q_UNUSED(focusDateTime); + Q_UNUSED(aInstanceId); + } }; diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendateutils.h --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendateutils.h Mon Sep 06 15:58:44 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,188 +0,0 @@ -/* - * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: ?Description - * - */ - -#ifndef __CALENDATEUTILS_H__ -#define __CALENDATEUTILS_H__ - -#include -#include // Q_DECL_EXPORT macro -#ifdef CALENDATEUTILS_DLL -#define CALENDATEUTIL_EXPORT Q_DECL_EXPORT -#else -#define CALENDATEUTIL_EXPORT Q_DECL_IMPORT -#endif - -// forward declarations -class QDateTime; - -/** - * CalenDateUtils contains static utility functions useful - * when comparing and calculating with dates and times. - * - * @lib Calendar.app - * @since 2.1 - */ - -class CalenDateUtils - { -public: - static bool onSameDay(const QDateTime& x, const QDateTime& y) - { - Q_UNUSED(x);Q_UNUSED(y); - return false; - } - static bool onSameMonth(const QDateTime& x, const QDateTime& y) - { - Q_UNUSED(x);Q_UNUSED(y); - return false; - } - static QDateTime beginningOfDay(const QDateTime& startTime) - { - Q_UNUSED(startTime); - return QDateTime(); - } - static QDateTime displayTimeOnDay(const QDateTime& startTime, - const QDateTime& day) - { - Q_UNUSED(startTime);Q_UNUSED(day); - return QDateTime(); - } - - static bool timeRangesIntersect(const QDateTime& xStart, - const QDateTime& xEnd, const QDateTime& yStart, - const QDateTime& yEnd) - { - Q_UNUSED(xStart);Q_UNUSED(xEnd);Q_UNUSED(yStart);Q_UNUSED(yEnd); - return false; - } - - /** - * Is aTime between KCalenMaxYear/KCalenMaxMonth/KCalenMaxDay - * and KCalenMinYear/KCalenMinMonth/KCalenMinDay. - * Min/Max day is defined agenda server. - * @param aTime aTime to be checked - * @return EFalse : Out of range - */ - static bool isValidDay(const QDateTime& time) - { - Q_UNUSED(time); - return false; - } - - /** - * Return Min or Max time if aTime goes out of bounds. - * Valid range is [CalenDateUtils::MinTime(), CalenDateUtils::MaxTime] - * @param aTime time to be checked - * @return aTime, if aTime in [CalenDateUtils::MinTime(), CalenDateUtils::MaxTime] - * CalenDateUtils::MinTime(), if aTime < CalenDateUtils::MinTime() - * CalenDateUtils::MaxTime(), if aTime > CalenDateUtils::MaxTime() - */ - static QDateTime limitToValidTime(const QDateTime& time) - { - Q_UNUSED(time); - return QDateTime(); - } - - /** - * Return maximum allowed time. (31. - */ - static QDateTime maxTime() - { - return QDateTime(); - } - - /** - * Return minimum allowed time. - */ - static QDateTime minTime() - { - return QDateTime(); - } - - /** - * Return time of day as a minutes from midnight. Useful to get hours::minutes component of datetime, - * regardless of date - */ - static int timeOfDay(const QDateTime& dateTime) - { - Q_UNUSED(dateTime); - return 0; - } - - /** - * Round QDateTime to previous full hour, e.g. RoundToPreviousHour( 23.11.2006 9:31 ) = 23.11.2006 9:00 - */ - static QDateTime roundToPreviousHour(const QDateTime& dateTime) - { - Q_UNUSED(dateTime); - return QDateTime(); - } - - /** - * Round QDateTimeIntervalMinutes to previous full hour, e.g. RoundToPreviousHour( 130 min ) = 120 min - */ - static int roundToPreviousHour(const int& minutes) - { - Q_UNUSED(minutes); - return 0; - } - - /** - * @return current time. - */ - static QDateTime now() - { - return QDateTime(); - } - - /** - * @return today with time component set to 00:00. - */ - static QDateTime today() - { - return QDateTime(); - } - - /** - * @return ETrue if given aTime is on today, EFalse otherwise - */ - static bool isOnToday(const QDateTime& time) - { - Q_UNUSED(time); - return false; - } - - /* - * Given aDate = DD::MM::YY @ hh:mm:ss, it returns a QDateTime obj DD::MM::YY @ 08:00 am - * @param: aDate, which has the DD::MM::YY - */ - static QDateTime defaultTime(const QDateTime& date) - { - Q_UNUSED(date); - return QDateTime(); - } - - static QDateTime futureOf(const QDateTime& dateTime, int numOfDays) - { - Q_UNUSED(dateTime);Q_UNUSED(numOfDays); - return QDateTime(); - } - }; - -#endif // __CALENDATEUTILS_H__ - -// End of File diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendaycontentwidget.h --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendaycontentwidget.h Mon Sep 06 15:58:44 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: CalenDayContentWidget class definition. - * - */ - -#ifndef CALENDAYCONTENTWIDGET_H_ -#define CALENDAYCONTENTWIDGET_H_ - -// System includes -#include - -// User includes -#include "calendaycommonheaders.h" - -// Forward declarations -class QGraphicsLinearLayout; -class CalenDayModelManager; - -class CalenDayContentWidget : public HbWidget - { -Q_OBJECT - -public: - /*! - \enum CalenWidgetPosition - \brief Enumeration identifies widget position if queue. - */ - enum CalenWidgetPosition - { - ECalenLastWidget = 0, ECalenFirstWidget - }; - -public: - CalenDayContentWidget(CalenDayModelManager &modelManager, - QGraphicsItem *parent = 0) - { - Q_UNUSED(parent); - Q_UNUSED(modelManager); - } - ~CalenDayContentWidget() - { - } - - void add(HbWidget* item, CalenWidgetPosition where = ECalenLastWidget) - { - Q_UNUSED(item); - Q_UNUSED(where); - } - HbWidget* take(CalenWidgetPosition which) - { - Q_UNUSED(which); - return 0; - } - void remove(CalenWidgetPosition which) - { - Q_UNUSED(which); - } - - signals: - void widgetsRelayoutFinished(CalenScrollDirection scrollTo); - void scrollPositionChanged(const QPointF &newPos); - -public slots: - void relayoutWidgets(CalenScrollDirection scrollTo) - { - Q_UNUSED(scrollTo); - } - void widgetScrolled(const QPointF &newPos) - { - Q_UNUSED(newPos); - } - }; - -#endif /* CALENDAYCONTENTWIDGET_H_ */ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendayinfo.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendayinfo.h Mon Sep 20 12:44:39 2010 +0530 @@ -0,0 +1,141 @@ +/* +* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Mocked classes for testing CalenDayInfo class +* +*/ + +#ifndef CALENDAYINFO_H +#define CALENDAYINFO_H + +#include +#include "caleninstanceid.h" + +const int KFSCalMaxDescriptionLength = 100; + +/*! + Mocked struct SCalenApptInfo + */ +struct SCalenApptInfo +{ + QModelIndex iIndex; + QDateTime iStartTime; + QDateTime iEndTime; + bool iAllDay; + TCalenInstanceId iId; + AgendaEntry::Status iStatus; + TBufC iSummary; + TUint32 iColor; +}; + +/*! + Mocked class CalenTimeColumn + */ +class CalenTimeColumn +{ +public: + CalenTimeColumn() { + + } + + ~CalenTimeColumn() { + + } +}; + +/*! + Mocked class CalenTimeRegion + */ +class CalenTimeRegion +{ +public: + CalenTimeRegion() { + + } + + ~CalenTimeRegion() { + + } + + QList iColumns; + + int iStartSlot; + int iEndSlot; +}; + +/*! + Mocked class CalenDayInfo + */ +class CalenDayInfo +{ +public: + enum TSlotsInHour + { + EOne = 1, ETwo, EThree, EFour + }; + +public: + + CalenDayInfo(TSlotsInHour aSlotsInHour) + { + Q_UNUSED(aSlotsInHour) + } + virtual ~CalenDayInfo() + { + + } + + void GetLocation( const SCalenApptInfo& aItemInfo, int& aStartSlot, + int& aEndSlot, int& aColumnIndex, int& aColumns ) + { + Q_UNUSED(aItemInfo) + Q_UNUSED(aStartSlot) + Q_UNUSED(aEndSlot) + Q_UNUSED(aColumnIndex) + Q_UNUSED(aColumns) + } + + int AlldayCount() + { + return 0; + } + + const QList& RegionList() const + { + return mList; + } + + void InsertAlldayEvent( const SCalenApptInfo& aItemInfo ) + { + Q_UNUSED(aItemInfo) + + CalenTimeRegion region; + + region.iStartSlot = 10; + region.iEndSlot = 13; + region.iColumns << CalenTimeColumn(); + + mList << region; + } + + void Reset() {} + + void InsertTimedEvent( const SCalenApptInfo& aItemInfo ) {Q_UNUSED(aItemInfo);} + +public: + QList mList; +}; + +#endif // CALENDAYINFO_H + +// End of File diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendaymodel.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendaymodel.h Mon Sep 20 12:44:39 2010 +0530 @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Single day item view model +* +*/ + +#ifndef CALENDAYMODEL_H +#define CALENDAYMODEL_H + +//System includes +#include +#include +#include + +#include + +//User includes + +//Forward declarations +class MCalenServices; + +//Constantss +const int CalenDayEntry = Qt::UserRole + 1; + +Q_DECLARE_METATYPE(AgendaEntry) +class CalenDayModel : public QAbstractListModel +{ + Q_OBJECT +public: + CalenDayModel(const QDateTime &date, MCalenServices &services, + QObject *parent = 0) + { + Q_UNUSED(date) + Q_UNUSED(parent) + Q_UNUSED(date) + }; + + // from QAbstractListModel + int rowCount(const QModelIndex &parent = QModelIndex()) const + { + return 0; + } + QVariant data(const QModelIndex &index, int role) const + { + Q_UNUSED(index) + Q_UNUSED(role) + return QVariant(); + } + + void refreshModel(const QDateTime &date) + { + Q_UNUSED(date) + }; + + QDateTime modelDate() const + {return QDateTime();} + +}; + +#endif //CALENDAYMODEL_H + diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendayutils.h --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calendayutils.h Mon Sep 06 15:58:44 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). - * All rights reserved. - * This component and the accompanying materials are made available - * under the terms of "Eclipse Public License v1.0" - * which accompanies this distribution, and is available - * at the URL "http://www.eclipse.org/legal/epl-v10.html". - * - * Initial Contributors: - * Nokia Corporation - initial contribution. - * - * Contributors: - * - * Description: CalenDayUtils utility class header. - * - */ - -#ifndef CALENDAYUTILS_H_ -#define CALENDAYUTILS_H_ - -class CalenDayUtils - { -public: - static CalenDayUtils *instance() - { - } - ~CalenDayUtils() - { - } - - qreal screenWidth() - { - return 0; - } - qreal hourElementWidth() - { - return 0; - } - qreal hourElementHeight() - { - return 0; - } - qreal contentWidth() - { - return 0; - } - - Qt::Orientation orientation() - { - return Qt::Horizontal; - } - - HbMainWindow* mainWindow() - { - return 0; - } - - bool isHorizontalSwipe(qreal angle) - { - Q_UNUSED(angle); - return false; - } - -protected: - CalenDayUtils() - { - } - }; - -#endif /* CALENDAYUTILS_H_ */ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calennativeview.h --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calennativeview.h Mon Sep 06 15:58:44 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This class is the base class of all Calendar views. - * -*/ - - -#ifndef CALENNATIVEVIEW_H -#define CALENNATIVEVIEW_H - -#ifdef CALENVIEWS_DLL -#define CALENNATIVEVIEW_EXPORT Q_DECL_EXPORT -#else -#define CALENNATIVEVIEW_EXPORT Q_DECL_IMPORT -#endif - -// System includes -#include -#include -#include - -// User includes -#include "calennotificationhandler.h" // MCalenNotificationHandler -#include "calenview.h" - -const int WORKAROUND_TO_LIMIT_MAX_SPEED=8000; - -class MCalenServices; -class HbDateTimePicker; - -class CalenNativeView : public CalenView, - public MCalenNotificationHandler - { - Q_OBJECT - - public: // Constructors and destructor - /** - * Destructor. - */ - virtual ~CalenNativeView(){} - virtual void populationComplete(){} - TBool pluginEnabled(){return EFalse;} - virtual void refreshViewOnGoToDate(){} - QString *pluginText() {QString* str = new QString("string"); return str;} - /** - * captureScreenshot captures the current screenshot - */ - CALENNATIVEVIEW_EXPORT void captureScreenshot(bool captureScreenShot = false) {Q_UNUSED(captureScreenShot);} - - protected: // New functions - CalenNativeView( MCalenServices& services ) : mServices(services){} - - void HandleNotification( const TCalenNotification notification ){Q_UNUSED(notification);} - virtual void onLocaleChanged(int reason) {Q_UNUSED(reason);} - virtual void onContextChanged() {} - - protected slots: - - void goToDate(){} - void goToSelectedDate(){} - void deleteBeforeDate(){} - void deleteAllEntries(){} - void launchSettingsView(){} - virtual void changeOrientation(Qt::Orientation orientation){Q_UNUSED(orientation);} - /** - * saveActivity saves the current view as an activity - * - */ - void saveActivity(){} - - protected: - - MCalenServices &mServices; // not owned. - int mActivityId; // Recent Activity ID, currently it holdes wither of ECalenMonthView or ECalenAgendaView - QVariantHash mScreenShotMetadata; // Screenshot - - }; - -#endif // CALENNATIVEVIEW_H - -// End of file diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calennotificationhandler.h --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calennotificationhandler.h Mon Sep 06 15:58:44 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Notification interface for S60 Calendar customizations -* -*/ - -#ifndef CALENNOTIFICATIONHANDLER_H -#define CALENNOTIFICATIONHANDLER_H - -enum TCalenNotification - { - ECalenNotifyAll = 0, // Receive all notifications - ECalenNotifyEntryInstanceViewCreated, - ECalenNotifyEntryInstanceViewCreationFailed, - ECalenNotifyContextChanged, - ECalenNotifyExternalDatabaseChanged, - ECalenNotifyEntrySaved, - ECalenNotifyEntryDeleted, - ECalenNotifyMultipleEntriesDeleted, - ECalenNotifyInstanceSaved, - ECalenNotifyInstanceDeleted, - ECalenNotifySystemTimeChanged, - ECalenNotifySystemLocaleChanged, - ECalenNotifySystemLanguageChanged, - ECalenNotifyLostAlarms, - ECalenNotifyCmdLineLaunch, - ECalenNotifyAvkonViewSwitchLaunch, - ECalenNotifySettingsChanged, - ECalenNotifyViewCreationStarted, - ECalenNotifyDialogClosed, - ECalenNotifyCommandFailed, - ECalenNotifyDeleteFailed, - ECalenNotifyEntryClosed, - ECalenNotifySettingsClosed, - ECalenNotifySettingsCRepKeyChanged, - ECalenNotifyPluginEnabledDisabled, - ECalenNotifyEComRegistryChanged, - ECalenNotifyResourceChanged, - ECalenNotifyViewPopulationComplete, - ECalenNotifyAppForegrounded, - ECalenNotifyAppBackgrounded, - ECalenNotifyMarkedEntryDeleted, - ECalenNotifyCheckPluginUnloading, - ECalenNotifyEntrySent, - ECalenNotifyCancelDelete, - ECalenNotifyDayViewClosed, - ECalenNotifyMapClosed, - ECalenNotifyCancelMapLaunch, - ECalenNotifyMissedAlarmViewClosed, - ECalenNotifyMissedEventViewClosed, - ECalenNotifyEditorClosedFromViewer, - /*ECalenNotifyUserDefined1, - ECalenNotifyUserDefined2,*/ - ECalenNotifyThaiPluginEnabled, - ECalenNotifyThaiPluginDisabled, - ECalenNotifyUserDefined3, - ECalenNotifyUserDefined4, - ECalenNotifyLast - }; - -/** - * Class for handling calendar notifications. - */ -class MCalenNotificationHandler - { - public: // New functions - virtual void HandleNotification( const TCalenNotification aNotification ) = 0; - }; - -#endif // CALENNOTIFICATIONHANDLER_H - -// End of file diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calenservices.h --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calenservices.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/calenservices.h Mon Sep 20 12:44:39 2010 +0530 @@ -9,6 +9,8 @@ #define CALENSERVICES_H_ #include "calencontext.h" +#include "calennotificationhandler.h" +#include "hb_calencommands.hrh" /*! Mocked class MCalenServices @@ -27,13 +29,27 @@ } int getFirstView(){ return 0;} - TBool IssueCommandL( TInt aCommand ){ Q_UNUSED(aCommand); return EFalse;} + bool IssueCommandL( quint32 aCommand ){ mLastCommand = aCommand; return true;} AgendaUtil* agendaInterface() {return 0;} + void RegisterForNotificationsL( MCalenNotificationHandler* aHandler, + TCalenNotification aNotification ) {} + + virtual void RegisterForNotificationsL( MCalenNotificationHandler* aHandler, + RArray& aNotifications ) + {} + + void IssueNotificationL( quint32 aNotification ) { mLastCommand = aNotification; } + + QString* InfobarTextL() {return 0;} + + quint32 lastCommand() {return mLastCommand;} + + quint32 mLastCommand; + MCalenContext mContext; + ~MCalenServices() { } - - MCalenContext mContext; }; #endif /* CALENSERVICES_H_ */ diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/hb_calencommands.hrh --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/hb_calencommands.hrh Mon Sep 06 15:58:44 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,102 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Calendar controller commands -* -*/ - - -#ifndef HB_CALENCOMMANDS_HRH -#define HB_CALENCOMMANDS_HRH - - -// 1000 commands for each action ui. -// We start from 10000 because otherwise we might overlap other command ranges, -// e.g. Avkon == 3000. - -enum TCalenCommandBase - { - ECalenViewCommandBase = 20000, - ECalenEditCommandBase = 20100, - ECalenDeleteCommandBase = 20200, - ECalenSettingsCommandBase = 20300, - ECalenMapCommandBase = 20400, - ECalenMissedAlarmCommandBase = 20500 - }; - -enum TCalenCommandId - { - ECalenMonthView = ECalenViewCommandBase, - ECalenWeekView, - ECalenAgendaView, - ECalenDayView, - ECalenTodoEditor, - ECalenTodoEditorDone, - ECalenForwardsToDayView, - ECalenNextView, - ECalenPrevView, - ECalenSwitchView, - ECalenShowToolbar, - ECalenHideToolbar, - ECalenUpdateToolbar, - ECalenHidePreview, - ECalenShowPreview, - ECalenStartActiveStep, - ECalenGotoToday, - ECalenGotoDate, - ECalenEventView, - ECalenCmdPromptThenEdit, - ECalenFasterAppExit, - ECalenShowNextDay, - ECalenShowPrevDay, - ECalenNewMeeting = ECalenEditCommandBase, - ECalenNewAnniv, - ECalenNewDayNote, - ECalenNewReminder, - ECalenNewMeetingRequest, - ECalenNewEntry, - ECalenEditCurrentEntry, - ECalenEditSeries, - ECalenEditOccurrence, - ECalenEditEntryFromViewer, - ECalenViewCurrentEntry, - ECalenNotifyFocusChange, - ECalenCompleteTodo, - ECalenRestoreTodo, - ECalenSend, - ECalenDeleteCurrentEntry = ECalenDeleteCommandBase, - ECalenDeleteEntryWithoutQuery, - ECalenDeleteSeries, - ECalenDeleteCurrentOccurrence, - ECalenDeleteAllEntries, - ECalenDeleteEntriesBeforeDate, - ECalenCancelDelete, - ECalenDeleteEntryFromViewer, - ECalenShowSettings = ECalenSettingsCommandBase, - ECalenGetLocation = ECalenMapCommandBase, - ECalenShowLocation, - ECalenGetLocationAndSave, - ECalenMissedAlarmsView = ECalenMissedAlarmCommandBase, - ECalenMissedEventView, - ECalenCmdClear, - ECalenCmdClearAll, - ECalenCmdGotoCalendar, - ECalenMissedAlarmsViewFromIdle, - ECalenMissedEventViewFromIdle, - ECalenLastCommand, - ECalenRegionalPluginTapEvent - }; - -#endif // HB_CALENCOMMANDS_HRH - -// End of file diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/unittest_calendayview.cpp --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/unittest_calendayview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/unittest_calendayview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -19,6 +19,9 @@ #include "calenservices.h" #include "calendateutils.h" #include "calendaymodelmanager.h" + +#define private public + #include "calendayview.h" class TestCalenDayView : public QObject @@ -36,9 +39,20 @@ void cleanup(); void testConstructors(); - + void testPopulationComplete(); + void testDoPopulation(); + void testOnBack(); + void testDayChangeStarted(); + void testRunChangeToAgendaView(); + void testRunLunarData(); + void testRunNewMeeting(); + void testRunGoToToday(); + void testChangeView(); + + private: CalenDayView *mView; + MCalenServices mServices; }; /*! @@ -78,7 +92,8 @@ */ void TestCalenDayView::init() { - + mServices.IssueCommandL(0); + mView = new CalenDayView(mServices); } /*! @@ -89,6 +104,11 @@ } +/*! + Test function for constructors + 1. Test if content widget is not initialized + 2. Test if content widget is correcty created + */ void TestCalenDayView::testConstructors() { MCalenServices services; @@ -103,6 +123,149 @@ delete testView; } +/*! + Test if population was done. + 1)Check if there is no command before + 2)Check if command population complete is send + */ +void TestCalenDayView::testPopulationComplete() +{ + //1) + QVERIFY(mServices.lastCommand() == 0); + + //2) + mView->doPopulation(); + + QVERIFY(mServices.lastCommand() == ECalenNotifyViewPopulationComplete); +} + +/*! + Test if population was done. + 1)Check if there is no command before + 2)Check if command population complete is send + */ +void TestCalenDayView::testDoPopulation() +{ + QVERIFY(mServices.lastCommand() == 0); + + mView->populationComplete(); + + QVERIFY(mServices.lastCommand() == ECalenNotifyViewPopulationComplete); +} + +/*! + Test if population was done. + 1)Check if there is no command before + 2)Check if command month view is send + */ +void TestCalenDayView::testOnBack() +{ +#ifndef __WINSCW__ + QVERIFY(mServices.lastCommand() == 0); + + mView->onBack(); + + QVERIFY(mServices.lastCommand() == ECalenMonthView); +#endif /*__WINSCW__*/ +} + +/*! + Test if population was done. + 1)Check if next date is set + 2)Check if priovor date is set + */ +void TestCalenDayView::testDayChangeStarted() +{ +#ifndef __WINSCW__ + mView->mDate = QDateTime(QDate(2010,9,8),QTime(10,10,10)); + mView->dayChangeStarted(ECalenScrollToNext); + + QVERIFY(mView->mDate == QDateTime(QDate(2010,9,9),QTime(10,10,10))); + + mView->dayChangeStarted(ECalenScrollToPrev); + + QVERIFY(mView->mDate == QDateTime(QDate(2010,9,8),QTime(10,10,10))); +#endif /*__WINSCW__*/ +} + +/*! + Test if population was done. + 1)Check if there is no command before + 2)Check if command go to agenda view is send + */ +void TestCalenDayView::testRunChangeToAgendaView() +{ +#ifndef __WINSCW__ + QVERIFY(mServices.lastCommand() == 0); + + mView->runChangeToAgendaView(); + + QVERIFY(mServices.lastCommand() == ECalenAgendaView); +#endif /*__WINSCW__*/ +} + +/*! + Test if population was done. + 1)Check if there is no command before + 2)Check if command regional info taped is send + */ +void TestCalenDayView::testRunLunarData() +{ +#ifndef __WINSCW__ + QVERIFY(mServices.lastCommand() == 0); + + mView->runLunarData(); + + QVERIFY(mServices.lastCommand() == ECalenRegionalPluginTapEvent); +#endif /*__WINSCW__*/ +} + +/*! + Test if population was done. + 1)Check if there is no command before + 2)Check if command new meeting is send + */ +void TestCalenDayView::testRunNewMeeting() +{ +#ifndef __WINSCW__ + QVERIFY(mServices.lastCommand() == 0); + + mView->runNewMeeting(); + + QVERIFY(mServices.lastCommand() == ECalenNewMeeting); +#endif /*__WINSCW__*/ +} + +/*! + Test if population was done. + 1)Check if there is no command before + 2)Check if command go to today is send + */ +void TestCalenDayView::testRunGoToToday() +{ +#ifndef __WINSCW__ + QVERIFY(mServices.lastCommand() == 0); + + mView->runGoToToday(); + + QVERIFY(mServices.lastCommand() == ECalenGotoToday); +#endif /*__WINSCW__*/ +} + +/*! + Test if population was done. + 1)Check if there is no command before + 2)Check if command givenn command is send + */ +void TestCalenDayView::testChangeView() +{ + QVERIFY(mServices.lastCommand() == 0); + + mView->changeView(ECalenAgendaView); + + QVERIFY(mServices.lastCommand() == ECalenAgendaView); +} + QTEST_MAIN(TestCalenDayView); #include "unittest_calendayview.moc" diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/dayview/tsrc/unittests/unittest_calendayview/unittest_calendayview.pro --- a/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/unittest_calendayview.pro Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/dayview/tsrc/unittests/unittest_calendayview/unittest_calendayview.pro Mon Sep 20 12:44:39 2010 +0530 @@ -25,12 +25,17 @@ INCLUDEPATH += . \ ../../../inc/ \ - ../../../../../inc/ + ../../../../inc/ \ + ../../../../traces/ \ + ../../../../../inc/ \ + DEPENDPATH += . \ ../../../inc/ \ ../../../src/ \ - ../../../../../inc/ + ../../../../inc/ \ + ../../../../src/ \ + ../../../../../inc/ # Input HEADERS += hbeffect.h \ @@ -50,12 +55,24 @@ calendaycontentscrollarea.h \ calendayhourscrollarea.h \ calendayutils.h \ - calendateutils.h \ calendayview.h \ - calencommon.h + calencommon.h \ + calendayitemview.h \ + calendaycontainer.h \ + calendayeventspane.h \ + calendayitem.h \ + calendaystatusstrip.h SOURCES += unittest_calendayview.cpp \ - calendayview.cpp + calendayview.cpp \ + calennativeview.cpp \ + calendaycontentwidget.cpp \ + calendayitemview.cpp \ + calendayutils.cpp \ + calendaycontainer.cpp \ + calendayeventspane.cpp \ + calendayitem.cpp \ + calendaystatusstrip.cpp symbian : { TARGET.CAPABILITY = CAP_APPLICATION @@ -64,7 +81,8 @@ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE LIBS += -lagendainterface \ - -lxqsettingsmanager + -lxqsettingsmanager \ + -lcalencommonutils } # End of file --Don't remove this. diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/eabi/calenviewsu.def --- a/calendarui/views/eabi/calenviewsu.def Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/eabi/calenviewsu.def Mon Sep 20 12:44:39 2010 +0530 @@ -267,4 +267,6 @@ _ZThn8_N22CalenDayHourScrollAreaD1Ev @ 266 NONAME _ZThn8_N25CalenDayContentScrollAreaD0Ev @ 267 NONAME _ZThn8_N25CalenDayContentScrollAreaD1Ev @ 268 NONAME + _ZN14CalenMonthGrid18checkIfWeCanScrollE15scrollDirection @ 269 NONAME + _ZN21CalenThickLinesDrawer6polishER17HbStyleParameters @ 270 NONAME diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/inc/calenmonthgrid.h --- a/calendarui/views/inc/calenmonthgrid.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/inc/calenmonthgrid.h Mon Sep 20 12:44:39 2010 +0530 @@ -80,6 +80,7 @@ void setActiveDates(QDate activeDate); void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); + bool checkIfWeCanScroll(scrollDirection direction); public slots: void scrollingFinished(); @@ -107,6 +108,7 @@ QColor mGridLineColor; bool mActiveDatesSet; bool mIsGridAdjusting; + bool mEventIndicatorNotSet; }; #endif // CALENMONTHGRID_H diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/inc/calennativeview.h --- a/calendarui/views/inc/calennativeview.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/inc/calennativeview.h Mon Sep 20 12:44:39 2010 +0530 @@ -26,6 +26,8 @@ #endif // System includes +#include +#include #include #include #include @@ -64,10 +66,11 @@ void HandleNotification( const TCalenNotification notification ); virtual void onLocaleChanged(int reason)=0; virtual void onContextChanged() {}; - + virtual bool checkIfWeCanSwipe(QDateTime& date, bool rightGesture); + signals: - void closeDialogs(); - + void closeDialogs(); + protected slots: void goToDate(); @@ -81,7 +84,9 @@ * */ void saveActivity(); - + private: + void refreshDatePicker(); + protected: MCalenServices &mServices; // not owned. @@ -89,7 +94,7 @@ QVariantHash mScreenShotMetadata; // Screenshot bool mEntriesInDataBase; private: - HbDateTimePicker *mDatePicker; + QPointer mDatePicker; bool mIsCapturedScreenShotValid; // to check if the captured screenshot is valid }; diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/inc/calenthicklinesdrawer.h --- a/calendarui/views/inc/calenthicklinesdrawer.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/inc/calenthicklinesdrawer.h Mon Sep 20 12:44:39 2010 +0530 @@ -44,7 +44,10 @@ private: void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget); - + +protected: + void polish(HbStyleParameters ¶ms); + private: QColor mGridBorderColor; CalendarNamespace::WidgetType typeOfWidget; diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/resources/caleneventlistviewitem.css --- a/calendarui/views/resources/caleneventlistviewitem.css Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/resources/caleneventlistviewitem.css Mon Sep 20 12:44:39 2010 +0530 @@ -1,7 +1,7 @@ -CalenEventListViewItem{ +CalenEventListViewItem[layoutName="custom"]{ layout: custom; } -CalenEventListViewItem[customstretch="true"]{ +CalenEventListViewItem[layoutName="custom"][customstretch="true"]{ layout: custom-stretch; } diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/src/calenagendaview.cpp --- a/calendarui/views/src/calenagendaview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/src/calenagendaview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -154,21 +154,15 @@ // Set self as the current view // mServices.MainWindow().setCurrentView(this); - // Dont override the soft key behavior if day view is the first view - if (ECalenAgendaView != mServices.getFirstView()) { + // Dont override the soft key behavior if day view or agenda view is the first view + if (ECalenMonthView == mServices.getFirstView()) { mSoftKeyAction = new HbAction(Hb::BackNaviAction); setNavigationAction(mSoftKeyAction); // Connect to the signal triggered by clicking on back button. connect(mSoftKeyAction, SIGNAL(triggered()), this, SLOT(launchMonthView())); - if (mSwitchToDayViewAction) { - mSwitchToDayViewAction->setVisible(true); - } - } else { - if (mSwitchToDayViewAction) { - mSwitchToDayViewAction->setVisible(false); - } } + // Initialize the content widget mAgendaViewWidget->showWidget(); @@ -240,10 +234,16 @@ if(HbSwipeGesture *gesture = qobject_cast(event->gesture(Qt::SwipeGesture))) { if (gesture->state() == Qt::GestureStarted) { if(QSwipeGesture::Left == gesture->sceneHorizontalDirection()) { - mServices.IssueCommandL(ECalenShowNextDay); + // Check if we can swipe + if (checkIfWeCanSwipe(mDate, false)) { + mServices.IssueCommandL(ECalenShowNextDay); + } event->accept(Qt::SwipeGesture); } else if(QSwipeGesture::Right == gesture->sceneHorizontalDirection()) { - mServices.IssueCommandL(ECalenShowPrevDay); + // Check if we can swipe + if (checkIfWeCanSwipe(mDate, true)) { + mServices.IssueCommandL(ECalenShowPrevDay); + } event->accept(Qt::SwipeGesture); } } diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/src/calenagendaviewwidget.cpp --- a/calendarui/views/src/calenagendaviewwidget.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/src/calenagendaviewwidget.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -319,7 +319,10 @@ // TODO : remove this line after gestures are available mEventsList->installEventFilter(mView); - + + // Enable the pixmap cache for better scrolling performance + mEventsList->setItemPixmapCacheEnabled(true); + // Connect to the long press and activation signals connect(mEventsList, SIGNAL(longPressed(HbAbstractViewItem*, const QPointF&)), this, SLOT(itemLongPressed(HbAbstractViewItem*, const QPointF&))); diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/src/calenmonthgrid.cpp --- a/calendarui/views/src/calenmonthgrid.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/src/calenmonthgrid.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -67,14 +67,14 @@ mIgnoreItemActivated(false), mGridLineColor(HbColorScheme::color("qtc_cal_grid_line")), mActiveDatesSet(false), - mIsGridAdjusting(false) + mIsGridAdjusting(false), + mEventIndicatorNotSet(false) { OstTraceFunctionEntry0( CALENMONTHGRID_CALENMONTHGRID_ENTRY ); setScrollDirections(Qt::Vertical); setRowCount(KNumOfVisibleRows); setColumnCount(KCalenDaysInWeek); - setLongPressEnabled(false); setItemRecycling(false); setSelectionMode(HbGridView::NoSelection); setUniformItemSizes(true); @@ -84,6 +84,9 @@ setFrictionEnabled(false); setFlag(QGraphicsItem::ItemHasNoContents, false); + // Enable the pixmap cache for better scrolling performance + setItemPixmapCacheEnabled(true); + // Disable the rows and columns swapping on orientation change setSwapDimensionsOnOrientationChange(false); @@ -234,15 +237,16 @@ connect( HbTheme::instance(), SIGNAL(changed()), gridItemPrototype, SLOT(handleThemeChange())); - - // Set the mode and the prototype - setModel(mModel,gridItemPrototype); // Register the widgetml and css files HbStyleLoader::registerFilePath(":/"); // Set the layout name setLayoutName("calendarCustomGridItem"); + + // Set the mode and the prototypec --> set it after setting layout name and + // other things as it will avoid unnecessary polish calls + setModel(mModel,gridItemPrototype); } else { // Since, we have finished setData, Now unblock the signals mModel->blockSignals(false); @@ -309,6 +313,11 @@ connect(this, SIGNAL(activated(const QModelIndex &)), this, SLOT(itemActivated(const QModelIndex &))); + // Check if we need to set the event indicators + if(mEventIndicatorNotSet) { + mEventIndicatorNotSet = false; + updateMonthGridWithEventIndicators(monthDataArray); + } OstTraceFunctionExit0( CALENMONTHGRID_UPDATEMONTHGRIDWITHINACTIVEMONTHS_EXIT ); } @@ -321,15 +330,22 @@ OstTraceFunctionEntry0( CALENMONTHGRID_UPDATEMONTHGRIDWITHEVENTINDICATORS_ENTRY ); int count(monthDataArray.count()); - for(int i = 0; i < count; i++) { - // Check if the day has events - if (monthDataArray[i].HasEvents()) { - QModelIndex itemIndex = mModel->index(i,0); - QVariant itemData = itemIndex.data(Qt::UserRole + 1); - QVariantList list = itemData.toList(); - list.replace(CalendarNamespace::CalendarMonthEventRole, true); - mModel->itemFromIndex(itemIndex)->setData(list); - } + + // Check if model is updated with all the dates + // If not, return false for later updation + if(count == mModel->rowCount()) { + for(int i = 0; i < count; i++) { + // Check if the day has events + if (monthDataArray[i].HasEvents()) { + QModelIndex itemIndex = mModel->index(i,0); + QVariant itemData = itemIndex.data(Qt::UserRole + 1); + QVariantList list = itemData.toList(); + list.replace(CalendarNamespace::CalendarMonthEventRole, true); + mModel->itemFromIndex(itemIndex)->setData(list); + } + } + } else { + mEventIndicatorNotSet = true; } OstTraceFunctionExit0( CALENMONTHGRID_UPDATEMONTHGRIDWITHEVENTINDICATORS_EXIT ); @@ -446,7 +462,7 @@ { OstTraceFunctionEntry0( CALENMONTHGRID_GESTUREEVENT_ENTRY ); - // Dont listem for any gesture when grid is getting adjusted as listening to those was causing + // Dont listen for any gesture when grid is getting adjusted as listening to those was causing // grid to stop abruptly i between if (mIsGridAdjusting) { // consume the event and return @@ -468,18 +484,9 @@ // Use our defined threshold temporarily till scrollarea // frm orbit side is made clever enough not to scroll in other direction // apart frm the registered scroll direction - QPointF delta = gesture->delta(); - // Check the current orientation of the device and - // swap the vertical and horizontal distances in landscape - qreal horizontalDiff = 0.0; - qreal verticalDiff = 0.0; - if (hbInstance->allMainWindows().at(0)->orientation() == Qt::Vertical) { - horizontalDiff = delta.x(); - verticalDiff = delta.y(); - } else { - horizontalDiff = delta.y(); - verticalDiff = delta.x(); - } + QPointF delta = gesture->sceneOffset(); + qreal horizontalDiff = delta.x(); + qreal verticalDiff = delta.y(); if (abs(horizontalDiff) > MAX_PAN_DIRECTION_THRESHOLD) { // Now see if y coord diff has crossed threshold if (verticalDiff > MAX_PAN_DIRECTION_THRESHOLD) { @@ -538,6 +545,15 @@ } } + // Check if we can scroll + if (!checkIfWeCanScroll(mDirection)) { + // We cannot scroll, return back + mIsPanGesture = false; + mIgnoreItemActivated = false; + mDirection = invalid; + event->accept(Qt::PanGesture); + } + if (mDirection!= invalid) { // Call the parent class to perform the pan gesture // When scrolling finished, month grid will adjust to show the proper month @@ -922,11 +938,15 @@ { OstTraceFunctionEntry0( CALENMONTHGRID_ITEMACTIVATED_ENTRY ); - if (mIgnoreItemActivated) { + QList& monthDataList = mView->monthDataList(); + // Chekc if we need to ignore the event or the newly tapped date is + // not valid date + if (mIgnoreItemActivated || !(CalenDateUtils::isValidDay(monthDataList[index.row()].Day()))) { mIgnoreItemActivated = false; OstTraceFunctionExit0( CALENMONTHGRID_ITEMACTIVATED_EXIT ); return; } + mIsNonActiveDayFocused = false; // Check if the same item has been tapped twice if (mCurrentRow == index.row()) { @@ -956,7 +976,6 @@ // Check if inactive date is tapped QDateTime activeMonth = mView->getActiveDay(); int month = activeMonth.date().month(); - QList& monthDataList = mView->monthDataList(); if(month != monthDataList[mCurrentRow].Day().date().month()){ // Set the flag mIsNonActiveDayFocused = true; @@ -1150,7 +1169,6 @@ { OstTraceFunctionEntry0( CALENMONTHGRID_ORIENTATIONCHANGED_ENTRY ); - Q_UNUSED(newOrientation) // We are overriding this function to avoid the default behavior of // hbgridview on orientation change as it swaps the row and column counts // Calculate the proper index to be scrolled to @@ -1271,6 +1289,34 @@ } /*! + Function to check if scrolling is allowed. This function will make an effect + only when you are going to month that is not supported by us. + */ +bool CalenMonthGrid::checkIfWeCanScroll(scrollDirection direction) +{ + OstTraceFunctionEntry0( CALENMONTHGRID_CHECKIFWECANSCROLL_ENTRY ); + + bool value = true; + + // Get the current active Date + QDateTime activeDate = mView->getActiveDay(); + // if direction is up, then check if the next month is + // not January, 2101 + if (direction == up) { + QDateTime nextMonth = activeDate.addMonths(1); + value = CalenDateUtils::isValidDay(nextMonth); + } else if (direction == down) { // if direction is up, then check if the next month is + // not December, 1899 + QDateTime prevMonth = activeDate.addMonths(-1); + value = CalenDateUtils::isValidDay(prevMonth); + } + + OstTraceFunctionExit0( CALENMONTHGRID_CHECKIFWECANSCROLL_EXIT ); + + return value; +} + +/*! Slot to handle the change in theme */ void CalenMonthGrid::handleThemeChange() diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/src/calenmonthview.cpp --- a/calendarui/views/src/calenmonthview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/src/calenmonthview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -1569,72 +1569,76 @@ { OstTraceFunctionEntry0( CALENMONTHVIEW_HANDLEPREVIEWPANEGESTURE_ENTRY ); - QGraphicsLinearLayout* viewLayout = static_cast - (widget()->layout()); - - // Set the effect in progress flags for next and previous panes - // For current pane, we would have set it in gestureEvent() function - mPrevPreviewPane->effectStarted(); - mNextPreviewPane->effectStarted(); - - if(rightGesture) { - // Need to bring up the previous day preview pane - // Create the effect on mCurrPreviewPane to slide to right side - mPrevPaneParent->setVisible(true); - if (mOrientation == Qt::Vertical) { - HbEffect::add(mCurrPaneLayoutWidget, - ":/fxml/portrait_preview_pane_hide_on_right_gesture", - "hide"); - HbEffect::add(mPrevPaneLayoutWidget, - ":/fxml/portrait_preview_pane_show_on_right_gesture", - "show"); - } else { - HbEffect::add(mCurrPaneLayoutWidget, - ":/fxml/landscape_preview_pane_hide_on_right_gesture", - "hide"); - HbEffect::add(mPrevPaneLayoutWidget, - ":/fxml/landscape_preview_pane_show_on_right_gesture", - "show"); - } - // Start the effects - HbEffect::start(mCurrPaneLayoutWidget, "hide"); - HbEffect::start(mPrevPaneLayoutWidget, "show", - this, "handleRightEffectCompleted"); - - //Remove the mCurrPreviewPane from the layout and add mPrevPreviewPane - // to the layout - viewLayout->removeAt(1); - viewLayout->addItem(mPrevPaneParent); - } else { - // Need to bring up the previous day preview pane - // Create the effect on mCurrPreviewPane to slide to left side - mNextPaneParent->setVisible(true); - if (mOrientation == Qt::Vertical) { - HbEffect::add(mCurrPaneLayoutWidget, - ":/fxml/portrait_preview_pane_hide_on_left_gesture", - "hide"); - HbEffect::add(mNextPaneLayoutWidget, - ":/fxml/portrait_preview_pane_show_on_left_gesture", - "show"); - } else { - HbEffect::add(mCurrPaneLayoutWidget, - ":/fxml/landscape_preview_pane_hide_on_left_gesture", - "hide"); - HbEffect::add(mNextPaneLayoutWidget, - ":/fxml/landscape_preview_pane_show_on_left_gesture", - "show"); - } - - // Start the effects - HbEffect::start(mCurrPaneLayoutWidget, "hide"); - HbEffect::start(mNextPaneLayoutWidget, "show", - this, "handleLeftEffectCompleted"); - - //Remove the mCurrPreviewPane from the layout and add mNextPreviewPane - // to the layout - viewLayout->removeAt(1); - viewLayout->addItem(mNextPaneParent); - } + // Check if we can swipe, if yes, then proceed, else, do nothing + if (checkIfWeCanSwipe(mDate, rightGesture)) { + + QGraphicsLinearLayout* viewLayout = static_cast + (widget()->layout()); + + // Set the effect in progress flags for next and previous panes + // For current pane, we would have set it in gestureEvent() function + mPrevPreviewPane->effectStarted(); + mNextPreviewPane->effectStarted(); + + if(rightGesture) { + // Need to bring up the previous day preview pane + // Create the effect on mCurrPreviewPane to slide to right side + mPrevPaneParent->setVisible(true); + if (mOrientation == Qt::Vertical) { + HbEffect::add(mCurrPaneLayoutWidget, + ":/fxml/portrait_preview_pane_hide_on_right_gesture", + "hide"); + HbEffect::add(mPrevPaneLayoutWidget, + ":/fxml/portrait_preview_pane_show_on_right_gesture", + "show"); + } else { + HbEffect::add(mCurrPaneLayoutWidget, + ":/fxml/landscape_preview_pane_hide_on_right_gesture", + "hide"); + HbEffect::add(mPrevPaneLayoutWidget, + ":/fxml/landscape_preview_pane_show_on_right_gesture", + "show"); + } + // Start the effects + HbEffect::start(mCurrPaneLayoutWidget, "hide"); + HbEffect::start(mPrevPaneLayoutWidget, "show", + this, "handleRightEffectCompleted"); + + //Remove the mCurrPreviewPane from the layout and add mPrevPreviewPane + // to the layout + viewLayout->removeAt(1); + viewLayout->addItem(mPrevPaneParent); + } else { + // Need to bring up the previous day preview pane + // Create the effect on mCurrPreviewPane to slide to left side + mNextPaneParent->setVisible(true); + if (mOrientation == Qt::Vertical) { + HbEffect::add(mCurrPaneLayoutWidget, + ":/fxml/portrait_preview_pane_hide_on_left_gesture", + "hide"); + HbEffect::add(mNextPaneLayoutWidget, + ":/fxml/portrait_preview_pane_show_on_left_gesture", + "show"); + } else { + HbEffect::add(mCurrPaneLayoutWidget, + ":/fxml/landscape_preview_pane_hide_on_left_gesture", + "hide"); + HbEffect::add(mNextPaneLayoutWidget, + ":/fxml/landscape_preview_pane_show_on_left_gesture", + "show"); + } + + // Start the effects + HbEffect::start(mCurrPaneLayoutWidget, "hide"); + HbEffect::start(mNextPaneLayoutWidget, "show", + this, "handleLeftEffectCompleted"); + + //Remove the mCurrPreviewPane from the layout and add mNextPreviewPane + // to the layout + viewLayout->removeAt(1); + viewLayout->addItem(mNextPaneParent); + } + } OstTraceFunctionExit0( CALENMONTHVIEW_HANDLEPREVIEWPANEGESTURE_EXIT ); } @@ -1795,4 +1799,5 @@ OstTraceFunctionExit0( CALENMONTHVIEW_UPDATEDAYLABEL_EXIT ); } + // End of file --Don't remove this. diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/src/calennativeview.cpp --- a/calendarui/views/src/calennativeview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/src/calennativeview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -52,7 +52,8 @@ CalenNativeView::CalenNativeView(MCalenServices &services) : mServices(services), mEntriesInDataBase(false), - mIsCapturedScreenShotValid(false) + mIsCapturedScreenShotValid(false), + mDatePicker(0) { OstTraceFunctionEntry0( CALENNATIVEVIEW_CALENNATIVEVIEW_ENTRY ); @@ -123,6 +124,18 @@ } /*! + Refreshes the already open date picker with proper + date format as per current locale settings. + */ + void CalenNativeView::refreshDatePicker() +{ + if(!(mDatePicker.isNull())) { + mDatePicker->setDisplayFormat(CalenDateUtils::dateFormatString()); + mDatePicker->setDate(QDate::currentDate()); + } +} + +/*! Slot to handle gotodate */ void CalenNativeView::goToDate() @@ -144,6 +157,7 @@ // Set the date range. mDatePicker->setMinimumDate(CalenDateUtils::minTime().date()); mDatePicker->setMaximumDate(CalenDateUtils::maxTime().date()); + mDatePicker->setDisplayFormat(CalenDateUtils::dateFormatString()); mDatePicker->setDate(QDate::currentDate()); popUp->setContentWidget(mDatePicker); @@ -231,6 +245,7 @@ switch (notification) { case ECalenNotifySystemLocaleChanged: { + refreshDatePicker(); onLocaleChanged(EChangesLocale); } break; @@ -332,4 +347,26 @@ } OstTraceFunctionExit0( CALENNATIVEVIEW_SAVEACTIVITY_EXIT ); } + +/*! + Function to tell if we can perform swipe effect on the preview pane. + This will affect when the next preview pane that is not going to + come has valid date or not + */ +bool CalenNativeView::checkIfWeCanSwipe(QDateTime& date, bool rightGesture) +{ + OstTraceFunctionEntry0( CALENNATIVEVIEW_CHECKIFWECANSWIPE_ENTRY ); + + bool value; + // For right gesture, see if previous day is valid or not + if (rightGesture) { + value = CalenDateUtils::isValidDay(date.addDays(-1)); + } else { // For left gesture, see if next day is valid or not + value = CalenDateUtils::isValidDay(date.addDays(1)); + } + + OstTraceFunctionExit0( CALENNATIVEVIEW_CHECKIFWECANSWIPE_EXIT ); + + return value; +} //End Of File diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/src/calenpreviewpane.cpp --- a/calendarui/views/src/calenpreviewpane.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/src/calenpreviewpane.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -395,27 +395,17 @@ // to know the direciton of the pan, until then we need // calculate the direction explicitly // Get to know the direction of the gesture - QPointF delta = gesture->delta(); - // Check the current orientation of the device and - // swap the vertical and horizontal distances in landscape - qreal horizontalDiff = 0.0; - qreal verticalDiff = 0.0; - if (hbInstance->allMainWindows().at(0)->orientation() == Qt::Vertical) { - horizontalDiff = delta.x(); - verticalDiff = delta.y(); - } else { - horizontalDiff = delta.y(); - verticalDiff = delta.x(); - } + QPointF delta = gesture->sceneOffset(); + // Check the horizontal and vertical offsets + qreal horizontalDiff = delta.x(); + qreal verticalDiff = delta.y(); if (abs(verticalDiff) > MAX_PAN_DIRECTION_THRESHOLD) { // Now see if x coord diff has crossed threshold if (horizontalDiff > MAX_PAN_DIRECTION_THRESHOLD) { - mIsGestureHandled = true; // right gesture mView->handlePreviewPaneGesture(true); event->accept(Qt::PanGesture); } else if (horizontalDiff < -MAX_PAN_DIRECTION_THRESHOLD){ - mIsGestureHandled = true; // left gesture mView->handlePreviewPaneGesture(false); event->accept(Qt::PanGesture); @@ -429,12 +419,10 @@ } } else if (abs(verticalDiff) < MAX_PAN_DIRECTION_THRESHOLD) { if (horizontalDiff > MIN_PAN_DIRECTION_THRESHOLD) { - mIsGestureHandled = true; // right gesture mView->handlePreviewPaneGesture(true); event->accept(Qt::PanGesture); } else if (horizontalDiff < -MIN_PAN_DIRECTION_THRESHOLD){ - mIsGestureHandled = true; // left gesture mView->handlePreviewPaneGesture(false); event->accept(Qt::PanGesture); diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/src/calenthicklinesdrawer.cpp --- a/calendarui/views/src/calenthicklinesdrawer.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/src/calenthicklinesdrawer.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -127,6 +127,14 @@ } /*! + Overriding the base class function to avoid searching for widgetml/css files + */ +void CalenThickLinesDrawer::polish(HbStyleParameters ¶ms) +{ + Q_UNUSED(params); +} + +/*! Slot to handle the change in theme */ void CalenThickLinesDrawer::handleThemeChange() diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/traces/calenmonthgridTraces.h --- a/calendarui/views/traces/calenmonthgridTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/traces/calenmonthgridTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -62,6 +62,8 @@ #define CALENMONTHGRID_PAINT_EXIT 0x8a00c1 #define CALENMONTHGRID_HANDLETHEMECHANGE_ENTRY 0x8a0185 #define CALENMONTHGRID_HANDLETHEMECHANGE_EXIT 0x8a0186 +#define CALENMONTHGRID_CHECKIFWECANSCROLL_ENTRY 0x8a018f +#define CALENMONTHGRID_CHECKIFWECANSCROLL_EXIT 0x8a0190 #endif diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/traces/calennativeviewTraces.h --- a/calendarui/views/traces/calennativeviewTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/traces/calennativeviewTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -37,6 +37,8 @@ #define CALENNATIVEVIEW_CAPTURESCREENSHOT_EXIT 0x8a0141 #define CALENNATIVEVIEW_SAVEACTIVITY_ENTRY 0x8a0142 #define CALENNATIVEVIEW_SAVEACTIVITY_EXIT 0x8a0143 +#define CALENNATIVEVIEW_CHECKIFWECANSWIPE_ENTRY 0x8a0191 +#define CALENNATIVEVIEW_CHECKIFWECANSWIPE_EXIT 0x8a0192 #endif diff -r 27feeedec790 -r 7ac58b2aae6f calendarui/views/traces/fixed_id.definitions --- a/calendarui/views/traces/fixed_id.definitions Mon Sep 06 15:58:44 2010 +0530 +++ b/calendarui/views/traces/fixed_id.definitions Mon Sep 20 12:44:39 2010 +0530 @@ -120,6 +120,8 @@ [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_APPENDROWS_EXIT=0xae [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_CALENMONTHGRID_ENTRY=0x8c [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_CALENMONTHGRID_EXIT=0x8d +[TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_CHECKIFWECANSCROLL_ENTRY=0x18f +[TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_CHECKIFWECANSCROLL_EXIT=0x190 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_DOWNGESTURE_ENTRY=0x98 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_DOWNGESTURE_EXIT=0x99 [TRACE]TRACE_FLOW[0x8A]_CALENMONTHGRID_GESTUREEVENT_ENTRY=0xa0 @@ -270,6 +272,8 @@ [TRACE]TRACE_FLOW[0x8A]_CALENNATIVEVIEW_CAPTURESCREENSHOT_EXIT=0x141 [TRACE]TRACE_FLOW[0x8A]_CALENNATIVEVIEW_CHANGEORIENTATION_ENTRY=0x137 [TRACE]TRACE_FLOW[0x8A]_CALENNATIVEVIEW_CHANGEORIENTATION_EXIT=0x138 +[TRACE]TRACE_FLOW[0x8A]_CALENNATIVEVIEW_CHECKIFWECANSWIPE_ENTRY=0x191 +[TRACE]TRACE_FLOW[0x8A]_CALENNATIVEVIEW_CHECKIFWECANSWIPE_EXIT=0x192 [TRACE]TRACE_FLOW[0x8A]_CALENNATIVEVIEW_DELETEALLENTRIES_ENTRY=0x12d [TRACE]TRACE_FLOW[0x8A]_CALENNATIVEVIEW_DELETEALLENTRIES_EXIT=0x12e [TRACE]TRACE_FLOW[0x8A]_CALENNATIVEVIEW_DELETEBEFOREDATE_ENTRY=0x12b diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockmw/clocksettingsutility/clocksettingsutility.pro --- a/clock/clockmw/clocksettingsutility/clocksettingsutility.pro Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockmw/clocksettingsutility/clocksettingsutility.pro Mon Sep 20 12:44:39 2010 +0530 @@ -32,9 +32,11 @@ TARGET.EPOCALLOWDLLDATA = 1 TARGET.CAPABILITY = CAP_GENERAL_DLL TARGET.UID3 = 0x2002E6B3 - + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE + LIBS += -leuser \ -ltimezoneclient \ + -lxqsettingsmanager } SOURCES += settingsutility.cpp diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockmw/clocksettingsutility/inc/settingsutility.h --- a/clock/clockmw/clocksettingsutility/inc/settingsutility.h Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockmw/clocksettingsutility/inc/settingsutility.h Mon Sep 20 12:44:39 2010 +0530 @@ -32,6 +32,8 @@ #endif class TimezoneClient; +class XQSettingsKey; +class XQSettingsManager; class SETTINGSUTILITY_EXPORT SettingsUtility : public QObject { @@ -87,10 +89,14 @@ QStringList mTimeSeparatorList; QStringList mClockTypeList; QStringList mTimeFormatList; + QStringList mDisplayDateFormatList; QStringList mDateFormatList; QStringList mDateSeparatorList; QStringList mAutoUpdateValueList; QStringList mSnoozeValueList; + + XQSettingsManager *mSettingsManager; + XQSettingsKey *mClockTypeSettingsKey; }; #endif // SETTINGSUTILITY_H diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockmw/clocksettingsutility/src/settingsutility.cpp --- a/clock/clockmw/clocksettingsutility/src/settingsutility.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockmw/clocksettingsutility/src/settingsutility.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -20,7 +20,10 @@ #include #include #include +#include +#include #include +#include // User includes #include "settingsutility.h" @@ -44,12 +47,20 @@ { OstTraceFunctionEntry0( SETTINGSUTILITY_SETTINGSUTILITY_ENTRY ); mTimeSeparatorList << tr(".") << tr(":"); - mClockTypeList << hbTrId("txt_clock_button_digital") << hbTrId("txt_clock_button_analog"); + mClockTypeList << hbTrId("txt_clock_button_analog") << hbTrId("txt_clock_button_digital"); mTimeFormatList << hbTrId("txt_clk_setlabel_val_24_hour") << hbTrId("txt_clk_setlabel_val_12_hour"); - mDateFormatList << hbTrId("txt_clk_setlabel_val_dd_mm_yyyy") << hbTrId("txt_clk_setlabel_val_mm_dd_yyyy") << hbTrId("txt_clk_setlabel_val_yyyy_mm_dd"); + mDisplayDateFormatList << hbTrId("txt_clk_setlabel_val_dd_mm_yyyy") << hbTrId("txt_clk_setlabel_val_mm_dd_yyyy") << hbTrId("txt_clk_setlabel_val_yyyy_mm_dd"); + mDateFormatList << tr("dd mm yyyy") << tr("mm dd yyyy") << tr("yyyy mm dd"); mDateSeparatorList << tr(".") << tr(":") << tr("/") << tr("-"); mAutoUpdateValueList << tr("ON") << tr("OFF"); mSnoozeValueList << tr("5 minutes") << tr("15 minutes") << tr(" 30 minutes") << tr("1 hour"); + + mSettingsManager = new XQSettingsManager(this); + mClockTypeSettingsKey = new XQSettingsKey( + XQSettingsKey::TargetCentralRepository, + KCRUidClockApp, + KClockType); + OstTraceFunctionExit0( SETTINGSUTILITY_SETTINGSUTILITY_EXIT ); } @@ -59,7 +70,11 @@ SettingsUtility::~SettingsUtility() { OstTraceFunctionEntry0( DUP1_SETTINGSUTILITY_SETTINGSUTILITY_ENTRY ); - // Nothing. + if(mSettingsManager) { + delete mSettingsManager; + } + // Delete the cenrep key + delete mClockTypeSettingsKey; OstTraceFunctionExit0( DUP1_SETTINGSUTILITY_SETTINGSUTILITY_EXIT ); } @@ -118,16 +133,16 @@ void SettingsUtility::setClockType(const QString &type) { OstTraceFunctionEntry0( SETTINGSUTILITY_SETCLOCKTYPE_ENTRY ); - TLocale locale; - + // Check the type and set the cenrep value if (type == mClockTypeList.at(0)) { - locale.SetClockFormat(EClockDigital); - } else if (type == mClockTypeList.at(1)) { - locale.SetClockFormat(EClockAnalog); - } else { + // The value set for Analogue type is 0 + mSettingsManager->writeItemValue(*mClockTypeSettingsKey, 0); + } else if (type == mClockTypeList.at(1)) { + // The value set for Digital type is 1 + mSettingsManager->writeItemValue(*mClockTypeSettingsKey, 1); + } else { // Nothing to do. } - locale.Set(); OstTraceFunctionExit0( SETTINGSUTILITY_SETCLOCKTYPE_EXIT ); } @@ -137,21 +152,17 @@ int SettingsUtility::clockType(QStringList &list) { OstTraceFunctionEntry0( SETTINGSUTILITY_CLOCKTYPE_ENTRY ); - TLocale locale; - int value = -1; - if (EClockAnalog == locale.ClockFormat()) { - value = 1; - } else if (EClockDigital == locale.ClockFormat()){ - value = 0; - } else { - // Nothing to do. - } - + int clockType = -1; + // Read the clocktype value from the cenrep + // 0 is for Analogue type and 1 for Digital + QVariant value = mSettingsManager->readItemValue(*mClockTypeSettingsKey); + clockType = value.toInt(); + list = mClockTypeList; - OstTraceFunctionExit0( SETTINGSUTILITY_CLOCKTYPE_EXIT ); - return value; + + return clockType; } /*! @@ -212,8 +223,8 @@ TLocale locale; int index; - for (index = 0; index < mDateFormatList.count(); ++index) { - if (format == mDateFormatList.at(index)) { + for (index = 0; index < mDisplayDateFormatList.count(); ++index) { + if (format == mDisplayDateFormatList.at(index)) { break; } } @@ -261,7 +272,7 @@ break; } - format = mDateFormatList; + format = mDisplayDateFormatList; OstTraceFunctionExit0( SETTINGSUTILITY_DATEFORMAT_EXIT ); return index; diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp --- a/clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockalarmeditor/src/clockalarmeditor.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -38,6 +38,7 @@ #include #include #include +#include // User includes #include "clockprivatecrkeys.h" @@ -833,9 +834,8 @@ OstTraceFunctionEntry0( CLOCKALARMEDITOR_DISPLAYDSTROLLOVERNOTE_ENTRY ); QString alarmTime = alarmInfo.nextDueTime.toString(mTimeFormat); - QString dstRollOverText = - hbTrId("txt_clock_dpopinfo_alarm_will_occur_at_1_after_au"); - QString displayText = dstRollOverText.arg(alarmTime); + QString displayText = HbParameterLengthLimiter(hbTrId("txt_clock_dpopinfo_alarm_will_occur_at_1_after_au")) + .arg(alarmTime); // show the note launchDialog(displayText); OstTraceFunctionExit0( CLOCKALARMEDITOR_DISPLAYDSTROLLOVERNOTE_EXIT ); @@ -874,29 +874,25 @@ switch ( alarmInfo.repeatType ) { case Once:{ if( oneDayDifference ){ - displayFormattedText = - hbTrId("txt_clock_note_alarm_occurs_once_only_on_next_1_a"); - displayText = displayFormattedText.arg(dayText,alarmTimeText); + displayText = HbParameterLengthLimiter(hbTrId("txt_clock_note_alarm_occurs_once_only_on_next_1_a")) + .arg(dayText).arg(alarmTimeText); showDisplayText = true; } } break; case Daily: { - displayFormattedText = - hbTrId("txt_clock_dpopinfo_alarm_occurs_every_day_at_1"); - displayText = displayFormattedText.arg(alarmTimeText); + displayText = HbParameterLengthLimiter(hbTrId("txt_clock_dpopinfo_alarm_occurs_every_day_at_1")) + .arg(alarmTimeText); } break; case Weekly:{ - displayFormattedText = - hbTrId("txt_clock_note_alarm_occurs_every_week_on_1_at_2"); - displayText = displayFormattedText.arg(dayText,alarmTimeText); + displayText = HbParameterLengthLimiter(hbTrId("txt_clock_note_alarm_occurs_every_week_on_1_at_2")) + .arg(dayText).arg(alarmTimeText); } break; case Workday:{ - displayFormattedText = - hbTrId("txt_clock_note_alarm_occurs_workdays_at_1"); - displayText = displayFormattedText.arg(alarmTimeText); + displayText = HbParameterLengthLimiter(hbTrId("txt_clock_note_alarm_occurs_workdays_at_1")) + .arg(alarmTimeText); } break; default: @@ -906,7 +902,6 @@ showDisplayText = true; } - QString remainingTimeText; // Dislpay the second note. if (!oneDayDifference) { QDateTime alarmDateTime(alarmInfo.alarmDateTime,alarmInfo.nextDueTime); @@ -931,41 +926,33 @@ QString hourText; QString minutesText; - QString formattedText; + QString remainingTimeText; // Alarm is with in 1 day. Choose the appropriate strings // to be displayed switch( remainingHours ) { case KOneHour:{ if ( KOneMinute == remainingMinutes ) { - formattedText = - hbTrId("txt_clock_dpopinfo_time_to_alarm_1_hr_and_2_min"); - remainingTimeText = formattedText.arg( - hourText.setNum(remainingHours), - minutesText.setNum(remainingMinutes)); + remainingTimeText = + HbParameterLengthLimiter(hbTrId("txt_clock_dpopinfo_time_to_alarm_1_hr_and_2_min")) + .arg(hourText.setNum(remainingHours)).arg(minutesText.setNum(remainingMinutes)); } else { - formattedText = - hbTrId("txt_clock_dpopinfo_time_to_alarm_1_hr_and_2_mins"); - remainingTimeText = formattedText.arg( - hourText.setNum(remainingHours), - minutesText.setNum(remainingMinutes)); + remainingTimeText = + HbParameterLengthLimiter(hbTrId("txt_clock_dpopinfo_time_to_alarm_1_hr_and_2_mins")) + .arg(hourText.setNum(remainingHours)).arg(minutesText.setNum(remainingMinutes)); } } break; default:{ if ( KOneMinute == remainingMinutes ) { - formattedText = - hbTrId("txt_clock_dpopinfo_time_to_alarm_1_hrs_and_2_min"); - remainingTimeText = formattedText.arg( - hourText.setNum(remainingHours), - minutesText.setNum(remainingMinutes)); + remainingTimeText = + HbParameterLengthLimiter(hbTrId("txt_clock_dpopinfo_time_to_alarm_1_hrs_and_2_min")) + .arg(hourText.setNum(remainingHours)).arg(minutesText.setNum(remainingMinutes)); } else { - formattedText = - hbTrId("txt_clock_dpopinfo_time_to_alarm_1_hrs_and_2_mins"); - remainingTimeText = formattedText.arg( - hourText.setNum(remainingHours), - minutesText.setNum(remainingMinutes)); + remainingTimeText = + HbParameterLengthLimiter(hbTrId("txt_clock_dpopinfo_time_to_alarm_1_hrs_and_2_mins")) + .arg(hourText.setNum(remainingHours)).arg(minutesText.setNum(remainingMinutes)); } } break; diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clocksettingsview/inc/clocksettingsview.h --- a/clock/clockui/clocksettingsview/inc/clocksettingsview.h Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clocksettingsview/inc/clocksettingsview.h Mon Sep 20 12:44:39 2010 +0530 @@ -93,6 +93,7 @@ TimezoneClient *mTimezoneClient; XQSettingsManager *mSettingsManager; XQSettingsKey *mAlarmSnoozeTimeKey; + XQSettingsKey *mClockTypeKey; QHash mAlarmSnoozeTimeHash; HbTranslator *mTranslator; bool mLaunchedByClock; diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clocksettingsview/src/clocksettingsview.cpp --- a/clock/clockui/clocksettingsview/src/clocksettingsview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clocksettingsview/src/clocksettingsview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -105,10 +105,14 @@ XQSettingsKey::TargetCentralRepository, KCRUidClockApp, KClockAppSnoozeTime); - - // Start the monitoring for the alarm snooze time key. + // Create the key for clock type. + mClockTypeKey = new XQSettingsKey( + XQSettingsKey::TargetCentralRepository, + KCRUidClockApp, + KClockType); + // Start the monitoring for the alarm snooze time key and clock type. mSettingsManager->startMonitoring(*mAlarmSnoozeTimeKey); - + mSettingsManager->startMonitoring(*mClockTypeKey); // Listen to the key value changes. connect( mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)), @@ -125,7 +129,6 @@ if (mDocLoader) { delete mDocLoader; } - // Remove the translator if (mTranslator) { delete mTranslator; @@ -134,12 +137,16 @@ if(mSettingsUtility){ delete mSettingsUtility; } + if(mSettingsManager) { + delete mSettingsManager; + } + // Delete cenrep keys + delete mAlarmSnoozeTimeKey; + delete mClockTypeKey; if(mSettingsModel){ delete mSettingsModel; } - - OstTraceFunctionExit0( DUP1_CLOCKSETTINGSVIEW_CLOCKSETTINGSVIEW_EXIT ); } @@ -454,8 +461,8 @@ } mClockTypeItem->setContentWidgetData("objectName", "clockType"); mSettingsForm->addConnection( - mClockTypeItem, SIGNAL(clicked()), - this, SLOT(handleClockTypeChanged())); + mClockTypeItem, SIGNAL(clicked()), + this, SLOT(handleClockTypeChanged())); // Add the alarm snooze time item. mAlarmSnoozeItem = mSettingsModel->appendDataFormItem( @@ -558,8 +565,7 @@ void ClockSettingsView::handleClockTypeChanged() { OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_HANDLECLOCKTYPECHANGED_ENTRY ); - mSettingsUtility->setClockType( - mClockTypeItem->contentWidgetData("text").toString()); + mSettingsUtility->setClockType(mClockTypeItem->contentWidgetData("text").toString()); OstTraceFunctionExit0( CLOCKSETTINGSVIEW_HANDLECLOCKTYPECHANGED_EXIT ); } @@ -573,17 +579,23 @@ const XQSettingsKey& key, const QVariant& value) { OstTraceFunctionEntry0( CLOCKSETTINGSVIEW_EVENTMONITOR_ENTRY ); - if (key.uid() == KCRUidClockApp && key.key() == KClockAppSnoozeTime) { - if (mSettingsManager->error() == XQSettingsManager::NoError) { + if (key.uid() == KCRUidClockApp) { + // Update the snooze time + if(key.key() == KClockAppSnoozeTime) { + if (mSettingsManager->error() == XQSettingsManager::NoError) { + + bool success; + int alarmSnoozeTime = value.toInt(&success); - bool success; - int alarmSnoozeTime = value.toInt(&success); - - if (success) { - mAlarmSnoozeItem->setContentWidgetData( - "currentIndex", mAlarmSnoozeTimeHash.key( - alarmSnoozeTime)); + if (success) { + mAlarmSnoozeItem->setContentWidgetData( + "currentIndex", mAlarmSnoozeTimeHash.key( + alarmSnoozeTime)); + } } + }else if(key.key() == KClockType) { + // Update the clock type when its changed + updateClockType(); } } OstTraceFunctionExit0( CLOCKSETTINGSVIEW_EVENTMONITOR_EXIT ); diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/clockviews.pro --- a/clock/clockui/clockviews/clockviews.pro Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/clockviews.pro Mon Sep 20 12:44:39 2010 +0530 @@ -44,6 +44,7 @@ TARGET.CAPABILITY += ALL -TCB TARGET.EPOCALLOWDLLDATA = 1 TARGET.UID3 = 0x2002BCE6 + INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE LIBS += \ -lclockalarmclient \ @@ -53,7 +54,8 @@ -lclocksettingsview \ -lclockcityselectionlist \ -lclockwidget \ - -lclockwidgetplugin + -lclockwidgetplugin \ + -lxqsettingsmanager } SOURCES += \ diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/data/style/clockalarmlistitemprototype.css --- a/clock/clockui/clockviews/data/style/clockalarmlistitemprototype.css Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/data/style/clockalarmlistitemprototype.css Mon Sep 20 12:44:39 2010 +0530 @@ -3,7 +3,6 @@ } ClockAlarmListItemPrototype::icon-1{ - top: -var(hb-param-margin-gene-middle-vertical); fixed-width: var(hb-param-graphic-size-secondary); fixed-height: var(hb-param-graphic-size-secondary); left: -6.5un; diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/data/style/clockalarmlistitemprototype.widgetml --- a/clock/clockui/clockviews/data/style/clockalarmlistitemprototype.widgetml Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/data/style/clockalarmlistitemprototype.widgetml Mon Sep 20 12:44:39 2010 +0530 @@ -6,7 +6,7 @@ - + diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/inc/clockmainview.h --- a/clock/clockui/clockviews/inc/clockmainview.h Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/inc/clockmainview.h Mon Sep 20 12:44:39 2010 +0530 @@ -40,6 +40,8 @@ class SettingsUtility; class ClockAlarmListModel; class ClockWidget; +class XQSettingsManager; +class XQSettingsKey; class ClockMainView : public HbView { @@ -71,6 +73,7 @@ void selectedMenuAction(HbAction *action); void handleMenuClosed(); void saveActivity(); + void eventMonitor(const XQSettingsKey& key, const QVariant& value); private: void setmodel(); @@ -104,6 +107,9 @@ ClockDocLoader *mDocLoader; ClockAppControllerIf *mAppControllerIf; ClockAlarmListModel *mAlarmListModel; + + XQSettingsManager *mSettingsManager; + XQSettingsKey *mClockTypeSettingsKey; int mSelectedItem; bool mHideAlarmList; diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/src/clockalarmlistmodel.cpp --- a/clock/clockui/clockviews/src/clockalarmlistmodel.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/src/clockalarmlistmodel.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -22,6 +22,7 @@ #include #include #include +#include // User includes #include "clockalarmlistmodel.h" @@ -191,10 +192,12 @@ case 1: { if (1 == minleft) { formatTimeNote = - hbTrId("txt_clock_main_view_setlabel_in_1hr_2min"); + HbParameterLengthLimiter(hbTrId("txt_clock_main_view_setlabel_in_1hr_2min")) + .arg(QString::number(hourleft)).arg(QString::number(minleft)); } else { formatTimeNote = - hbTrId("txt_clock_main_view_setlabel_in_1hr_2mins"); + HbParameterLengthLimiter(hbTrId("txt_clock_main_view_setlabel_in_1hr_2mins")) + .arg(QString::number(hourleft)).arg(QString::number(minleft)); } } break; @@ -202,21 +205,21 @@ default: { if (1 == minleft) { formatTimeNote = - hbTrId("txt_clock_main_view_setlabel_in_1hrs_2min"); + HbParameterLengthLimiter(hbTrId("txt_clock_main_view_setlabel_in_1hrs_2min")) + .arg(QString::number(hourleft)).arg(QString::number(minleft)); } else { formatTimeNote = - hbTrId("txt_clock_main_view_setlabel_in_1hrs_2mins"); + HbParameterLengthLimiter(hbTrId("txt_clock_main_view_setlabel_in_1hrs_2mins")) + .arg(QString::number(hourleft)).arg(QString::number(minleft)); } } } - timeNote = formatTimeNote.arg( - QString::number(hourleft), QString::number(minleft)); } else { - formatTimeNote = hbTrId("txt_clock_main_view_setlabel_in_1days"); - timeNote = formatTimeNote.arg(QString::number(dayleft)); + formatTimeNote = HbParameterLengthLimiter(hbTrId("txt_clock_main_view_setlabel_in_1days")) + .arg(QString::number(dayleft)); } OstTraceFunctionExit0( CLOCKALARMLISTMODEL_CALCULATEREMAININGTIME_EXIT ); - return timeNote; + return formatTimeNote; } /*! @@ -439,9 +442,8 @@ repeatTypeString.append( hbTrId("txt_clock_main_view_dblist_daily_val_workdays")); } else if (Weekly == alarmInfo.repeatType) { - repeatTypeString.append(hbTrId("txt_clock_main_view_setlabel_every_1")); - repeatTypeString = - repeatTypeString.arg(alarmInfo.alarmDateTime.toString("dddd")); + repeatTypeString.append( HbParameterLengthLimiter(hbTrId("txt_clock_main_view_setlabel_every_1")) + .arg(alarmInfo.alarmDateTime.toString("dddd"))); } else { if (QDate::currentDate() == alarmInfo.alarmDateTime) { repeatTypeString.append( diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/src/clockmainview.cpp --- a/clock/clockui/clockviews/src/clockmainview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/src/clockmainview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -29,6 +29,9 @@ #include #include // hbapplication #include // activity manager +#include +#include +#include // User includes #include "clockmainview.h" @@ -86,6 +89,12 @@ delete mAlarmListModel; mAlarmListModel = 0; } + if (mSettingsManager) { + delete mSettingsManager; + } + // Delete cenrep key + delete mClockTypeSettingsKey; + HbStyleLoader::unregisterFilePath( ":/style/clockalarmlistitemprototype.css"); HbStyleLoader::unregisterFilePath( @@ -280,6 +289,16 @@ mTimezoneClient, SIGNAL(cityUpdated()), this, SLOT(updatePlaceLabel())); + // Connect for the clock type changes to refresh the view + mSettingsManager = new XQSettingsManager(this); + mClockTypeSettingsKey = new XQSettingsKey( + XQSettingsKey::TargetCentralRepository, + KCRUidClockApp, + KClockType); + mSettingsManager->startMonitoring(*mClockTypeSettingsKey); + connect(mSettingsManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)), + this, SLOT(eventMonitor(XQSettingsKey, QVariant))); + OstTraceFunctionExit0( CLOCKMAINVIEW_SETUPAFTERVIEWREADY_EXIT ); } @@ -496,6 +515,24 @@ OstTraceFunctionExit0( CLOCKMAINVIEW_REMOVESNOOZEDALARM_EXIT ); } +/*! + Slot which is called when the value changes in cenrep. + + \param key The key which got changed in cenrep. + \param value The new value of that key. + */ +void ClockMainView::eventMonitor( + const XQSettingsKey& key, const QVariant& value) +{ + OstTraceFunctionEntry0( CLOCKMAINVIEW_EVENTMONITOR_ENTRY ); + if (key.uid() == KCRUidClockApp && key.key() == KClockType) { + // Update view + updateView(); + } + OstTraceFunctionExit0( CLOCKMAINVIEW_EVENTMONITOR_EXIT ); +} + + void ClockMainView::updateView() { OstTraceFunctionEntry0( CLOCKMAINVIEW_UPDATEVIEW_ENTRY ); @@ -761,9 +798,9 @@ int index = mSettingsUtility->clockType(clockType); int zeroIndex(0); if(zeroIndex == index){ - mClockWidget->setClockType(ClockWidget::ClockTypeDigital); + mClockWidget->setClockType(ClockWidget::ClockTypeAnalog); } else { - mClockWidget->setClockType(ClockWidget::ClockTypeAnalog); + mClockWidget->setClockType(ClockWidget::ClockTypeDigital); } QStringList timeFormat; diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/src/clockworldview.cpp --- a/clock/clockui/clockviews/src/clockworldview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/src/clockworldview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -26,6 +26,7 @@ #include #include #include +#include // User includes #include "clockworldview.h" @@ -648,15 +649,15 @@ if ( hours && minutes ) { if (hours == 1) { displayFormat = - hbTrId("txt_clock_dblist_daily_val_1_hr_2_mins"); - offsetString = displayFormat.arg(hours).arg(minutes); - offsetDifference += offsetString; + HbParameterLengthLimiter(hbTrId("txt_clock_dblist_daily_val_1_hr_2_mins")) + .arg(QString::number(hours)).arg(QString::number(minutes)); + offsetDifference += displayFormat; } else { displayFormat = - hbTrId("txt_clock_dblist_daily_val_1_hrs_2_mins"); - offsetString = displayFormat.arg(hours).arg(minutes); - offsetDifference += offsetString; + HbParameterLengthLimiter(hbTrId("txt_clock_dblist_daily_val_1_hrs_2_mins")) + .arg(QString::number(hours)).arg(QString::number(minutes)); + offsetDifference += displayFormat; } } else if ( hours ){ diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/traces/OstTraceDefinitions.h --- a/clock/clockui/clockviews/traces/OstTraceDefinitions.h Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/traces/OstTraceDefinitions.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,3 +1,20 @@ +/* +* This is Default Licence added by TraceCompiler +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ #ifndef __OSTTRACEDEFINITIONS_H__ #define __OSTTRACEDEFINITIONS_H__ // OST_TRACE_COMPILER_IN_USE flag has been added by Trace Compiler diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/traces/clockalarmlistitemprototypeTraces.h --- a/clock/clockui/clockviews/traces/clockalarmlistitemprototypeTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/traces/clockalarmlistitemprototypeTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,21 @@ -// Created by TraceCompiler 2.2.3 +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition file for class ClockAlarmListItemPrototype. +* +*/ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CLOCKALARMLISTITEMPROTOTYPETRACES_H__ diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/traces/clockalarmlistmodelTraces.h --- a/clock/clockui/clockviews/traces/clockalarmlistmodelTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/traces/clockalarmlistmodelTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,21 @@ -// Created by TraceCompiler 2.2.3 +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition file for class ClockAlarmListModel. +* +*/ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CLOCKALARMLISTMODELTRACES_H__ diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/traces/clockhomecityitemTraces.h --- a/clock/clockui/clockviews/traces/clockhomecityitemTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/traces/clockhomecityitemTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,21 @@ -// Created by TraceCompiler 2.2.3 +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition file for class ClockHomeCityItem. +* +*/ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CLOCKHOMECITYITEMTRACES_H__ diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/traces/clockmainviewTraces.h --- a/clock/clockui/clockviews/traces/clockmainviewTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/traces/clockmainviewTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,21 @@ -// Created by TraceCompiler 2.2.3 +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition file for class ClockMainView. +* +*/ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CLOCKMAINVIEWTRACES_H__ @@ -56,6 +73,8 @@ #define CLOCKMAINVIEW_CAPTURESCREENSHOT_EXIT 0x8a0059 #define CLOCKMAINVIEW_SAVEACTIVITY_ENTRY 0x8a005a #define CLOCKMAINVIEW_SAVEACTIVITY_EXIT 0x8a005b +#define CLOCKMAINVIEW_EVENTMONITOR_ENTRY 0x8a0085 +#define CLOCKMAINVIEW_EVENTMONITOR_EXIT 0x8a0086 #endif diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/traces/clockworldviewTraces.h --- a/clock/clockui/clockviews/traces/clockworldviewTraces.h Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/traces/clockworldviewTraces.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,4 +1,21 @@ -// Created by TraceCompiler 2.2.3 +/* +* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Definition file for class ClockWorldView. +* +*/ +// Created by TraceCompiler 2.2.4 // DO NOT EDIT, CHANGES WILL BE LOST #ifndef __CLOCKWORLDVIEWTRACES_H__ diff -r 27feeedec790 -r 7ac58b2aae6f clock/clockui/clockviews/traces/fixed_id.definitions --- a/clock/clockui/clockviews/traces/fixed_id.definitions Mon Sep 06 15:58:44 2010 +0530 +++ b/clock/clockui/clockviews/traces/fixed_id.definitions Mon Sep 20 12:44:39 2010 +0530 @@ -1,3 +1,20 @@ +## +# This is Default Licence added by TraceCompiler +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +## #Fixed group and trace id definitions. If this file is removed, the identifiers are rebuilt. [GROUP]TRACE_FLOW=0x8a [TRACE]TRACE_FLOW[0x8A]_CLOCKALARMLISTITEMPROTOTYPE_CLOCKALARMLISTITEMPROTOTYPE_ENTRY=0x1 @@ -47,6 +64,8 @@ [TRACE]TRACE_FLOW[0x8A]_CLOCKMAINVIEW_DELETEALARM_EXIT=0x41 [TRACE]TRACE_FLOW[0x8A]_CLOCKMAINVIEW_DISPLAYWORLDCLOCKVIEW_ENTRY=0x36 [TRACE]TRACE_FLOW[0x8A]_CLOCKMAINVIEW_DISPLAYWORLDCLOCKVIEW_EXIT=0x37 +[TRACE]TRACE_FLOW[0x8A]_CLOCKMAINVIEW_EVENTMONITOR_ENTRY=0x85 +[TRACE]TRACE_FLOW[0x8A]_CLOCKMAINVIEW_EVENTMONITOR_EXIT=0x86 [TRACE]TRACE_FLOW[0x8A]_CLOCKMAINVIEW_HANDLEACTIVATED_ENTRY=0x3c [TRACE]TRACE_FLOW[0x8A]_CLOCKMAINVIEW_HANDLEACTIVATED_EXIT=0x3d [TRACE]TRACE_FLOW[0x8A]_CLOCKMAINVIEW_HANDLEALARMLISTDISPLAY_ENTRY=0x48 diff -r 27feeedec790 -r 7ac58b2aae6f clock/conf/clockapp.confml Binary file clock/conf/clockapp.confml has changed diff -r 27feeedec790 -r 7ac58b2aae6f clock/conf/clockapp_101F874D.crml Binary file clock/conf/clockapp_101F874D.crml has changed diff -r 27feeedec790 -r 7ac58b2aae6f layers.sysdef.xml --- a/layers.sysdef.xml Mon Sep 06 15:58:44 2010 +0530 +++ b/layers.sysdef.xml Mon Sep 20 12:44:39 2010 +0530 @@ -8,6 +8,16 @@ + + + + + + + + + + diff -r 27feeedec790 -r 7ac58b2aae6f notes/notesui/notesmodel/src/notesmodel.cpp --- a/notes/notesui/notesmodel/src/notesmodel.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/notes/notesui/notesmodel/src/notesmodel.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -210,7 +210,7 @@ NotesNamespace::StatusRole).value(); if (entry.status() == entryStatus) { - if (AgendaEntry::TodoNeedsAction == entryStatus) { + if (AgendaEntry::TodoCompleted != entryStatus) { // Make sure that the old model index is removed. mSourceModel->removeRow(foundIndex.row()); mInCompTodoCount--; @@ -218,7 +218,7 @@ // Now insert the to-do. insertInCompTodoToModel(foundIndex, id); - } else if (AgendaEntry::TodoCompleted == entryStatus) { + } else { // Make sure that the old model index is removed. mSourceModel->removeRow(foundIndex.row()); mCompTodoCount--; @@ -228,7 +228,7 @@ } } else { - if (AgendaEntry::TodoNeedsAction == entryStatus) { + if (AgendaEntry::TodoCompleted != entryStatus) { // Here the to-do was marked completed. Hence we need to remove // the incompleted to-do and insert a completed to-do. mSourceModel->removeRow(foundIndex.row()); @@ -237,7 +237,7 @@ // Now insert the completed to-do. insertCompTodoToModel(foundIndex, id); - } else if (AgendaEntry::TodoCompleted == entryStatus) { + } else { // Here the to-do was marked incompleted. Hence we need to // remove the completed to-do and insert an incompleted to-do. mSourceModel->removeRow(foundIndex.row()); @@ -292,11 +292,11 @@ notify = insertNoteToModel(indexToNotify, id); } else if (AgendaEntry::TypeTodo == entry.type()) { - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { // Try to insert the to-do at its appropriate position. notify = insertInCompTodoToModel(indexToNotify, id); - } else if (AgendaEntry::TodoCompleted == entry.status()) { + } else { // Try to insert the to-do at its appropriate position. insertCompTodoToModel(indexToNotify, id); } @@ -340,7 +340,7 @@ } else if (entryType == AgendaEntry::TypeTodo) { if (entryStatus == AgendaEntry::TodoCompleted) { mCompTodoCount--; - } else if (entryStatus == AgendaEntry::TodoNeedsAction) { + } else { mInCompTodoCount--; } } @@ -436,7 +436,7 @@ } else { stringList << entry.summary(); } - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { // Read due date from agenda entry QString displayText; QString timeText(hbTrId("txt_notes_dblist_val_due_on_1")); @@ -595,10 +595,18 @@ AgendaEntry entry = agendaEntryList[idIter]; if (AgendaEntry::TypeTodo != entry.type()) { + // delete the inserted row in the model + mSourceModel->removeRow(modelIter); + // decrement the iterator + modelIter--; continue; } - if (AgendaEntry::TodoNeedsAction != entry.status()) { + if (AgendaEntry::TodoCompleted == entry.status()) { + // delete the inserted row in the model + mSourceModel->removeRow(modelIter); + // decrement the iterator + modelIter--; continue; } @@ -624,7 +632,7 @@ stringList << entry.summary(); } - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { // Read due date from agenda entry QString displayText; QString timeText(hbTrId("txt_notes_dblist_val_due_on_1")); @@ -897,7 +905,7 @@ } else { stringList << entry.summary(); } - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { // Read due date from agenda entry QString displayText; QString timeText(hbTrId("txt_notes_dblist_val_due_on_1")); diff -r 27feeedec790 -r 7ac58b2aae6f notes/notesui/notesviews/src/notesmainview.cpp --- a/notes/notesui/notesviews/src/notesmainview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/notes/notesui/notesviews/src/notesmainview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -367,10 +367,10 @@ hbTrId("txt_notes_menu_make_it_as_todo_note")); } else if (AgendaEntry::TypeTodo == entry.type()) { - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { mTodoStatusAction = contextMenu->addAction( hbTrId("txt_notes_menu_mark_as_done")); - } else if (AgendaEntry::TodoCompleted == entry.status()) { + } else { mTodoStatusAction = contextMenu->addAction( hbTrId("txt_notes_menu_mark_as_not_done")); } @@ -426,9 +426,9 @@ QDateTime currentDateTime = QDateTime::currentDateTime(); - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { mAgendaUtil->setCompleted(entry, true, currentDateTime); - } else if (AgendaEntry::TodoCompleted == entry.status()) { + } else { mAgendaUtil->setCompleted(entry, false, currentDateTime); } diff -r 27feeedec790 -r 7ac58b2aae6f notes/notesui/notesviews/src/notestodoview.cpp --- a/notes/notesui/notesviews/src/notestodoview.cpp Mon Sep 06 15:58:44 2010 +0530 +++ b/notes/notesui/notesviews/src/notestodoview.cpp Mon Sep 20 12:44:39 2010 +0530 @@ -282,10 +282,10 @@ hbTrId("txt_common_menu_delete")); if (AgendaEntry::TypeTodo == entry.type()) { - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { mTodoStatusAction = contextMenu->addAction( hbTrId("txt_notes_menu_mark_as_done")); - } else if (AgendaEntry::TodoCompleted == entry.status()) { + } else { mTodoStatusAction = contextMenu->addAction( hbTrId("txt_notes_menu_mark_as_not_done")); @@ -337,9 +337,9 @@ QDateTime currentDateTime = QDateTime::currentDateTime(); - if (AgendaEntry::TodoNeedsAction == entry.status()) { + if (AgendaEntry::TodoCompleted != entry.status()) { mAgendaUtil->setCompleted(entry, true, currentDateTime); - } else if (AgendaEntry::TodoCompleted == entry.status()) { + } else { mAgendaUtil->setCompleted(entry, false, currentDateTime); } OstTraceFunctionExit0( NOTESTODOVIEW_MARKTODOSTATUS_EXIT ); diff -r 27feeedec790 -r 7ac58b2aae6f organizer_plat/calendar_launcher_api/inc/calenlauncher.h --- a/organizer_plat/calendar_launcher_api/inc/calenlauncher.h Mon Sep 06 15:58:44 2010 +0530 +++ b/organizer_plat/calendar_launcher_api/inc/calenlauncher.h Mon Sep 20 12:44:39 2010 +0530 @@ -29,7 +29,8 @@ public: enum CalenView{ MonthView = 0, - AgendaView + AgendaView, + DayView }; CalenLauncher(QObject* parent = 0); ~CalenLauncher(); diff -r 27feeedec790 -r 7ac58b2aae6f organizer_plat/clock_settings_keys_api/inc/clockdomaincrkeys.h --- a/organizer_plat/clock_settings_keys_api/inc/clockdomaincrkeys.h Mon Sep 06 15:58:44 2010 +0530 +++ b/organizer_plat/clock_settings_keys_api/inc/clockdomaincrkeys.h Mon Sep 20 12:44:39 2010 +0530 @@ -1,1 +1,1 @@ -/* * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. * * Contributors: * * Description: The file contains the uid of domain keys. * */ #ifndef CLOCKDOMAINCRKEYS_H #define CLOCKDOMAINCRKEYS_H /**Clock Settings keys*/ /**Provides access to the ClockSettings keys*/ const long int KCRUidClockApp = { 0x101F874D }; /**Default clock alarm sound file*/ const long int KClockAppDefaultSoundFile = 0x00000000; /** Alarm snooze time key */ const long int KClockAppSnoozeTime = 0x00000001; #endif // CLOCKDOMAINCRKEYS_H // End of file --Don't remove this. \ No newline at end of file +/* * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" * which accompanies this distribution, and is available * at the URL "http://www.eclipse.org/legal/epl-v10.html". * * Initial Contributors: * Nokia Corporation - initial contribution. * * Contributors: * * Description: The file contains the uid of domain keys. * */ #ifndef CLOCKDOMAINCRKEYS_H #define CLOCKDOMAINCRKEYS_H /**Clock Settings keys*/ /**Provides access to the ClockSettings keys*/ const long int KCRUidClockApp = { 0x101F874D }; /**Default clock alarm sound file*/ const long int KClockAppDefaultSoundFile = 0x00000000; /** Alarm snooze time key */ const long int KClockAppSnoozeTime = 0x00000001; /** Clock type key for Analog/Digital ie Analog-0 and digital-1*/ const long int KClockType = 0x00000002; #endif // CLOCKDOMAINCRKEYS_H // End of file --Don't remove this. \ No newline at end of file diff -r 27feeedec790 -r 7ac58b2aae6f package_definition.xml --- a/package_definition.xml Mon Sep 06 15:58:44 2010 +0530 +++ b/package_definition.xml Mon Sep 20 12:44:39 2010 +0530 @@ -138,10 +138,10 @@ - + - + @@ -149,13 +149,13 @@ - + - + - +