--- a/alarmui/group/AknAlarmService.mmp Wed Sep 15 12:11:35 2010 +0300
+++ b/alarmui/group/AknAlarmService.mmp Wed Oct 13 14:30:35 2010 +0300
@@ -95,7 +95,6 @@
// For cover display support:
LIBRARY eikdlg.lib
LIBRARY estor.lib
-LIBRARY featmgr.lib
LIBRARY missedalarmstore.lib
LIBRARY starterclient.lib
--- a/alarmui/inc/alarmutils.h Wed Sep 15 12:11:35 2010 +0300
+++ b/alarmui/inc/alarmutils.h Wed Oct 13 14:30:35 2010 +0300
@@ -481,6 +481,19 @@
*/
TBool IsCalendarAlarmViewer();
+
+ /**
+ * Stores details of current calendar alarm. i.e LUID, file name and original expiry time
+ */
+ void StoreCurrentCalendarAlarmData();
+
+ /**
+ * Comapres details of current calendar alarm with previous calendar alarm.(LUID, file name and original expiry time)
+ * @return ETrue if alarm is duplicate of previous alarm ,EFalse otherwise.
+ */
+
+ TBool CheckForDuplicateAlarm();
+
private:
/**
@@ -788,6 +801,22 @@
* Calendar Alarm Viewer flag
*/
TBool iCalendarAlarmViewer;
+
+ /**
+ * Stores local UID of expired calendar event
+ */
+ TCalLocalUid iPrevLocalUid;
+
+ /**
+ * Stores filename of expired calendar event
+ */
+ TBuf<256> iPrevCalFileName;
+
+ /**
+ * Stores org expiry time of expired calendar alarm
+ */
+ TTime iPrevAlarmOriginalExpiryTime;
+
};
#endif // ALARMUTILS_H
--- a/alarmui/src/AlmAlarmControl.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/alarmui/src/AlmAlarmControl.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -49,6 +49,9 @@
const TUint KAlarmAutoShutdown( 60000000 ); // 60 s
const TUint KShutdownTime( 1500000 ); // 1.5 s
+const TInt KErrDuplicateAlarm( -1001 ); // error code
+
+
// ==========================================================
// ================= MEMBER FUNCTIONS =======================
@@ -505,6 +508,11 @@
HBufC* text = NULL;
+ if(!err && iAlarmUtils->CheckForDuplicateAlarm())
+ {
+ err = KErrDuplicateAlarm;
+ }
+
if( !err )
{
TRAP( err, iAlarmUtils->GetAlarmLabelL( text ); )
@@ -528,8 +536,12 @@
// disable silence and snooze key if alarm can't be snoozed anymore
cba |= iAlarmUtils->CanSnooze() ? 0 : EHideSnooze | ENoSilence;
// show "Open" MSK for calendar alarms if the security lock is not active
- cba |= iAlarmUtils->IsCalendarAlarm() && !iAlarmUtils->IsSecurityLockActive() ? EMskOpen : 0;
-
+ cba |= iAlarmUtils->IsCalendarAlarm() && !iAlarmUtils->IsSecurityLockActive() ? EMskOpen : 0;
+
+ if(iAlarmUtils->IsCalendarAlarm())
+ {
+ iAlarmUtils->StoreCurrentCalendarAlarmData();
+ }
// request alarm dialog
TBuf<1> time;
TRAP( err, iGlobalNoteId = iAlarmUtils->NotifierDialogController()->DisplayAlarmL( cba, *text, time/*not used*/ ) );
--- a/alarmui/src/alarmutils.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/alarmui/src/alarmutils.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -50,6 +50,8 @@
#include <calalarm.h> // KUidAgendaModelAlarmCategory - the alarm category id for calendar alarms
#include <AknUtils.h>
#include <hwrmpowerstatesdkpskeys.h>
+#include <startupdomainpskeys.h>
+
#ifndef SYMBIAN_CALENDAR_V2
#include <agmalarm.h> // deprecated, use CalAlarm.h when SYMBIAN_CALENDAR_V2 flag is enabled
@@ -967,14 +969,14 @@
TInt chargingState;
RProperty::Get( KPSUidHWRMPowerState, KHWRMChargingStatus , chargingState );
- if( IsDeviceInAlarmState() && ( chargingState != EChargingStatusCharging ) )
+ if( IsDeviceInAlarmState() && ( chargingState == EChargingStatusNotConnected ) )
{
- iShutdownTimer->Cancel();
- if( StarterConnect() )
- {
- iStarter.Shutdown();
- iStarter.Close();
- }
+ iShutdownTimer->Cancel();
+ if( StarterConnect() )
+ {
+ iStarter.Shutdown();
+ iStarter.Close();
+ }
}
TRACE_EXIT_POINT;
}
@@ -1640,10 +1642,13 @@
{
TRACE_ENTRY_POINT;
TInt keyVal( 0 );
+ TInt currentBootupQueriesStatus(0);
TBool retVal( EFalse );
PIM_ASSERT( RProperty::Get( KPSUidCoreApplicationUIs, KCoreAppUIsAutolockStatus, keyVal ); )
- if( keyVal > EAutolockOff )
+ PIM_ASSERT(RProperty::Get(KPSUidStartup,KPSStartupUiPhase,currentBootupQueriesStatus ); )
+
+ if( (keyVal > EAutolockOff) || (currentBootupQueriesStatus != EStartupUiPhaseAllDone ) )
{
retVal = ETrue;
}
@@ -1716,4 +1721,47 @@
TRACE_EXIT_POINT;
}
+// ---------------------------------------------------------
+// Check if the alarm is duplicate calendar alarm
+// Rest of the details in header file
+// ---------------------------------------------------------
+//
+TBool CAlarmUtils::CheckForDuplicateAlarm()
+ {
+ TRACE_ENTRY_POINT;
+ TBool ret = EFalse;
+ if(IsCalendarAlarm())
+ {
+ TTime currAlarmOrigExpTime = iAlarmData.iAlarm.OriginalExpiryTime();
+
+ if(currAlarmOrigExpTime == iPrevAlarmOriginalExpiryTime && iPrevLocalUid == iAlarmData.iLocalUid
+ && !iPrevCalFileName.CompareF(iAlarmData.iCalFileName) )
+ {
+ TInt& count = iAlarmData.iAlarm.ClientData1();
+ if( (count >= KAlmAlertMinSnooze &&
+ count <= KAlmAlertMaxSnooze ))
+ {
+ ret = ETrue;
+ }
+ }
+ }
+ TRACE_EXIT_POINT;
+ return ret;
+ }
+
+
+// ---------------------------------------------------------
+// Store details of current alarm for future comparison when next calendar alarm comes.
+// Rest of the details in header file
+// ---------------------------------------------------------
+//
+void CAlarmUtils::StoreCurrentCalendarAlarmData()
+ {
+ TRACE_ENTRY_POINT;
+ iPrevLocalUid = iAlarmData.iLocalUid;
+ iPrevCalFileName = iAlarmData.iCalFileName;
+ iPrevAlarmOriginalExpiryTime = iAlarmData.iAlarm.OriginalExpiryTime();
+ TRACE_EXIT_POINT;
+ }
+
// End of File
--- a/calendarengines/caldav/bwins/CalDavClientu.def Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-EXPORTS
- ?SetPastDays@RCalDavServer@@QAEHABVTDesC16@@VTTimeIntervalDays@@@Z @ 1 NONAME ; int RCalDavServer::SetPastDays(class TDesC16 const &, class TTimeIntervalDays)
- ??1CCalDavSession@@UAE@XZ @ 2 NONAME ; CCalDavSession::~CCalDavSession(void)
- ?EnabledSync@RCalDavServer@@QAEHABVTDesC16@@AAH@Z @ 3 NONAME ; int RCalDavServer::EnabledSync(class TDesC16 const &, int &)
- ?SyncInterval@RCalDavServer@@QAEHABVTDesC16@@AAVTTimeIntervalMinutes@@@Z @ 4 NONAME ; int RCalDavServer::SyncInterval(class TDesC16 const &, class TTimeIntervalMinutes &)
- ?Disable@RCalDavServer@@QAEHABVTDesC16@@@Z @ 5 NONAME ; int RCalDavServer::Disable(class TDesC16 const &)
- ?SyncAllL@CCalDavSession@@QAEHXZ @ 6 NONAME ; int CCalDavSession::SyncAllL(void)
- ?SetUsername@CCalDavSession@@QAEHABVTDesC16@@ABVTDesC8@@@Z @ 7 NONAME ; int CCalDavSession::SetUsername(class TDesC16 const &, class TDesC8 const &)
- ?PastDays@RCalDavServer@@QAEHABVTDesC16@@AAVTTimeIntervalDays@@@Z @ 8 NONAME ; int RCalDavServer::PastDays(class TDesC16 const &, class TTimeIntervalDays &)
- ?SetUrl@RCalDavServer@@QAEHABVTDesC16@@ABVTDesC8@@@Z @ 9 NONAME ; int RCalDavServer::SetUrl(class TDesC16 const &, class TDesC8 const &)
- ?Url@RCalDavServer@@QAEHABVTDesC16@@AAVTDes8@@@Z @ 10 NONAME ; int RCalDavServer::Url(class TDesC16 const &, class TDes8 &)
- ?Sync@RCalDavServer@@QAEHABVTDesC16@@@Z @ 11 NONAME ; int RCalDavServer::Sync(class TDesC16 const &)
- ?EnabledSync@CCalDavSession@@QAEHABVTDesC16@@AAH@Z @ 12 NONAME ; int CCalDavSession::EnabledSync(class TDesC16 const &, int &)
- ?ImmediateSync@RCalDavServer@@QAEHABVTDesC16@@AAH@Z @ 13 NONAME ; int RCalDavServer::ImmediateSync(class TDesC16 const &, int &)
- ?Connect@RCalDavServer@@QAEHXZ @ 14 NONAME ; int RCalDavServer::Connect(void)
- ?Password@RCalDavServer@@QAEHABVTDesC16@@AAVTDes8@@@Z @ 15 NONAME ; int RCalDavServer::Password(class TDesC16 const &, class TDes8 &)
- ?SyncAll@RCalDavServer@@QAEHXZ @ 16 NONAME ; int RCalDavServer::SyncAll(void)
- ?SetPastDays@CCalDavSession@@QAEHABVTDesC16@@VTTimeIntervalDays@@@Z @ 17 NONAME ; int CCalDavSession::SetPastDays(class TDesC16 const &, class TTimeIntervalDays)
- ?NewLC@CCalDavSession@@SAPAV1@XZ @ 18 NONAME ; class CCalDavSession * CCalDavSession::NewLC(void)
- ?SetUrl@CCalDavSession@@QAEHABVTDesC16@@ABVTDesC8@@@Z @ 19 NONAME ; int CCalDavSession::SetUrl(class TDesC16 const &, class TDesC8 const &)
- ?SetImmediateSync@CCalDavSession@@QAEHABVTDesC16@@H@Z @ 20 NONAME ; int CCalDavSession::SetImmediateSync(class TDesC16 const &, int)
- ?SetSyncInterval@CCalDavSession@@QAEHABVTDesC16@@VTTimeIntervalMinutes@@@Z @ 21 NONAME ; int CCalDavSession::SetSyncInterval(class TDesC16 const &, class TTimeIntervalMinutes)
- ?Disable@CCalDavSession@@QAEHABVTDesC16@@@Z @ 22 NONAME ; int CCalDavSession::Disable(class TDesC16 const &)
- ??0RCalDavServer@@QAE@XZ @ 23 NONAME ; RCalDavServer::RCalDavServer(void)
- ?SyncL@CCalDavSession@@QAEHABVTDesC16@@@Z @ 24 NONAME ; int CCalDavSession::SyncL(class TDesC16 const &)
- ?Username@RCalDavServer@@QAEHABVTDesC16@@AAVTDes8@@@Z @ 25 NONAME ; int RCalDavServer::Username(class TDesC16 const &, class TDes8 &)
- ?Enable@CCalDavSession@@QAEHABVTDesC16@@@Z @ 26 NONAME ; int CCalDavSession::Enable(class TDesC16 const &)
- ?SetUsername@RCalDavServer@@QAEHABVTDesC16@@ABVTDesC8@@@Z @ 27 NONAME ; int RCalDavServer::SetUsername(class TDesC16 const &, class TDesC8 const &)
- ?KeepServerEntry@RCalDavServer@@QAEHABVTDesC16@@AAH@Z @ 28 NONAME ; int RCalDavServer::KeepServerEntry(class TDesC16 const &, int &)
- ?SetPassword@RCalDavServer@@QAEHABVTDesC16@@ABVTDesC8@@@Z @ 29 NONAME ; int RCalDavServer::SetPassword(class TDesC16 const &, class TDesC8 const &)
- ?PastDays@CCalDavSession@@QAEHABVTDesC16@@AAVTTimeIntervalDays@@@Z @ 30 NONAME ; int CCalDavSession::PastDays(class TDesC16 const &, class TTimeIntervalDays &)
- ?SetKeepServerEntry@CCalDavSession@@QAEHABVTDesC16@@H@Z @ 31 NONAME ; int CCalDavSession::SetKeepServerEntry(class TDesC16 const &, int)
- ?SetKeepServerEntry@RCalDavServer@@QAEHABVTDesC16@@H@Z @ 32 NONAME ; int RCalDavServer::SetKeepServerEntry(class TDesC16 const &, int)
- ?NewL@CCalDavSession@@SAPAV1@XZ @ 33 NONAME ; class CCalDavSession * CCalDavSession::NewL(void)
- ?Url@CCalDavSession@@QAEHABVTDesC16@@AAVTDes8@@@Z @ 34 NONAME ; int CCalDavSession::Url(class TDesC16 const &, class TDes8 &)
- ?SetSyncInterval@RCalDavServer@@QAEHABVTDesC16@@VTTimeIntervalMinutes@@@Z @ 35 NONAME ; int RCalDavServer::SetSyncInterval(class TDesC16 const &, class TTimeIntervalMinutes)
- ?Username@CCalDavSession@@QAEHABVTDesC16@@AAVTDes8@@@Z @ 36 NONAME ; int CCalDavSession::Username(class TDesC16 const &, class TDes8 &)
- ?Password@CCalDavSession@@QAEHABVTDesC16@@AAVTDes8@@@Z @ 37 NONAME ; int CCalDavSession::Password(class TDesC16 const &, class TDes8 &)
- ?Enable@RCalDavServer@@QAEHABVTDesC16@@@Z @ 38 NONAME ; int RCalDavServer::Enable(class TDesC16 const &)
- ?SyncInterval@CCalDavSession@@QAEHABVTDesC16@@AAVTTimeIntervalMinutes@@@Z @ 39 NONAME ; int CCalDavSession::SyncInterval(class TDesC16 const &, class TTimeIntervalMinutes &)
- ?KeepServerEntry@CCalDavSession@@QAEHABVTDesC16@@AAH@Z @ 40 NONAME ; int CCalDavSession::KeepServerEntry(class TDesC16 const &, int &)
- ?SetImmediateSync@RCalDavServer@@QAEHABVTDesC16@@H@Z @ 41 NONAME ; int RCalDavServer::SetImmediateSync(class TDesC16 const &, int)
- ?ImmediateSync@CCalDavSession@@QAEHABVTDesC16@@AAH@Z @ 42 NONAME ; int CCalDavSession::ImmediateSync(class TDesC16 const &, int &)
- ?SetPassword@CCalDavSession@@QAEHABVTDesC16@@ABVTDesC8@@@Z @ 43 NONAME ; int CCalDavSession::SetPassword(class TDesC16 const &, class TDesC8 const &)
-
--- a/calendarengines/caldav/eabi/CalDavClientu.def Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-EXPORTS
- _ZN13RCalDavServer11EnabledSyncERK7TDesC16Ri @ 1 NONAME
- _ZN13RCalDavServer11SetPasswordERK7TDesC16RK6TDesC8 @ 2 NONAME
- _ZN13RCalDavServer11SetPastDaysERK7TDesC1617TTimeIntervalDays @ 3 NONAME
- _ZN13RCalDavServer11SetUsernameERK7TDesC16RK6TDesC8 @ 4 NONAME
- _ZN13RCalDavServer12SyncIntervalERK7TDesC16R20TTimeIntervalMinutes @ 5 NONAME
- _ZN13RCalDavServer13ImmediateSyncERK7TDesC16Ri @ 6 NONAME
- _ZN13RCalDavServer15KeepServerEntryERK7TDesC16Ri @ 7 NONAME
- _ZN13RCalDavServer15SetSyncIntervalERK7TDesC1620TTimeIntervalMinutes @ 8 NONAME
- _ZN13RCalDavServer16SetImmediateSyncERK7TDesC16i @ 9 NONAME
- _ZN13RCalDavServer18SetKeepServerEntryERK7TDesC16i @ 10 NONAME
- _ZN13RCalDavServer3UrlERK7TDesC16R5TDes8 @ 11 NONAME
- _ZN13RCalDavServer4SyncERK7TDesC16 @ 12 NONAME
- _ZN13RCalDavServer6EnableERK7TDesC16 @ 13 NONAME
- _ZN13RCalDavServer6SetUrlERK7TDesC16RK6TDesC8 @ 14 NONAME
- _ZN13RCalDavServer7ConnectEv @ 15 NONAME
- _ZN13RCalDavServer7DisableERK7TDesC16 @ 16 NONAME
- _ZN13RCalDavServer7SyncAllEv @ 17 NONAME
- _ZN13RCalDavServer8PasswordERK7TDesC16R5TDes8 @ 18 NONAME
- _ZN13RCalDavServer8PastDaysERK7TDesC16R17TTimeIntervalDays @ 19 NONAME
- _ZN13RCalDavServer8UsernameERK7TDesC16R5TDes8 @ 20 NONAME
- _ZN13RCalDavServerC1Ev @ 21 NONAME
- _ZN13RCalDavServerC2Ev @ 22 NONAME
- _ZN14CCalDavSession11EnabledSyncERK7TDesC16Ri @ 23 NONAME
- _ZN14CCalDavSession11SetPasswordERK7TDesC16RK6TDesC8 @ 24 NONAME
- _ZN14CCalDavSession11SetPastDaysERK7TDesC1617TTimeIntervalDays @ 25 NONAME
- _ZN14CCalDavSession11SetUsernameERK7TDesC16RK6TDesC8 @ 26 NONAME
- _ZN14CCalDavSession12SyncIntervalERK7TDesC16R20TTimeIntervalMinutes @ 27 NONAME
- _ZN14CCalDavSession13ImmediateSyncERK7TDesC16Ri @ 28 NONAME
- _ZN14CCalDavSession15KeepServerEntryERK7TDesC16Ri @ 29 NONAME
- _ZN14CCalDavSession15SetSyncIntervalERK7TDesC1620TTimeIntervalMinutes @ 30 NONAME
- _ZN14CCalDavSession16SetImmediateSyncERK7TDesC16i @ 31 NONAME
- _ZN14CCalDavSession18SetKeepServerEntryERK7TDesC16i @ 32 NONAME
- _ZN14CCalDavSession3UrlERK7TDesC16R5TDes8 @ 33 NONAME
- _ZN14CCalDavSession4NewLEv @ 34 NONAME
- _ZN14CCalDavSession5NewLCEv @ 35 NONAME
- _ZN14CCalDavSession5SyncLERK7TDesC16 @ 36 NONAME
- _ZN14CCalDavSession6EnableERK7TDesC16 @ 37 NONAME
- _ZN14CCalDavSession6SetUrlERK7TDesC16RK6TDesC8 @ 38 NONAME
- _ZN14CCalDavSession7DisableERK7TDesC16 @ 39 NONAME
- _ZN14CCalDavSession8PasswordERK7TDesC16R5TDes8 @ 40 NONAME
- _ZN14CCalDavSession8PastDaysERK7TDesC16R17TTimeIntervalDays @ 41 NONAME
- _ZN14CCalDavSession8SyncAllLEv @ 42 NONAME
- _ZN14CCalDavSession8UsernameERK7TDesC16R5TDes8 @ 43 NONAME
- _ZN14CCalDavSessionD0Ev @ 44 NONAME
- _ZN14CCalDavSessionD1Ev @ 45 NONAME
- _ZN14CCalDavSessionD2Ev @ 46 NONAME
- _ZTI11CalDavUtils @ 47 NONAME
- _ZTI18CCalDavSessionImpl @ 48 NONAME
- _ZTV11CalDavUtils @ 49 NONAME
- _ZTV18CCalDavSessionImpl @ 50 NONAME
-
--- a/calendarengines/caldav/group/CalDavClient.mmp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,34 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: This is the project specification file for the
-* Caldav client library
-*/
-
-TARGET CalDavClient.dll
-TARGETTYPE dll
-UID 0 0x2002B71F
-
-SOURCEPATH ..\src
-SOURCE CalDavClient.cpp caldavsession.cpp caldavsessionimpl.cpp caldavutils.cpp
-
-USERINCLUDE ..\inc
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib
-LIBRARY bafl.lib
-LIBRARY http.lib
-
-//EXPORTUNFROZEN
-
-CAPABILITY CAP_APPLICATION NetworkControl
\ No newline at end of file
--- a/calendarengines/caldav/group/CalDavServer.mmp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,40 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: This is the project specification file for the
-* Caldav server
-*/
-
-TARGET !CalDavServer.exe
-TARGETTYPE exe
-UID 0 0x2002B71E
-
-SOURCEPATH ../src
-SOURCE CalDavServer.cpp caldavutils.cpp httpclient.cpp CalDavServerSession.cpp caldavengine.cpp caldavenginemgr.cpp
-
-USERINCLUDE ../inc
-USERINCLUDE ../../../calendarui/globaldata/inc
-
-APP_LAYER_SYSTEMINCLUDE
-
-LIBRARY euser.lib apparc.lib cone.lib eikcore.lib avkon.lib charconv.lib
-LIBRARY commonengine.lib efsrv.lib estor.lib eikcoctl.lib eikdlg.lib
-LIBRARY eikctl.lib bafl.lib fbscli.lib aknnotify.lib aknicon.lib
-LIBRARY etext.lib gdi.lib egul.lib insock.lib
-LIBRARY ecom.lib InetProtUtil.lib http.lib esock.lib xmlengineDOM.lib calinterimapi.lib calenimp.lib CalenInterimUtils2.lib commdb.lib calenglobaldata.lib
-LIBRARY extendedconnpref.lib netmeta.lib
-
-EPOCHEAPSIZE 0x5000 0x400000
-EPOCSTACKSIZE 0x5000
-
-CAPABILITY ReadDeviceData ReadUserData WriteDeviceData WriteUserData ProtServ NetworkServices
--- a/calendarengines/caldav/group/CalDavTest.mmp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: This is the project specification file for the
-* Caldav test application
-*/
-
-TARGET CalDavTest.exe
-TARGETTYPE exe
-UID 0 0x2002B81C
-
-USERINCLUDE ..\inc
-USERINCLUDE ..\..\..\calendarui\globaldata\inc
-
-APP_LAYER_SYSTEMINCLUDE
-
-SOURCEPATH ..\src
-SOURCE caldavengine.cpp httpclient.cpp caldavutils.cpp
-
-SOURCEPATH ..\tsrc
-SOURCE CalDavTest.cpp
-
-LIBRARY euser.lib apparc.lib cone.lib eikcore.lib avkon.lib charconv.lib
-LIBRARY commonengine.lib efsrv.lib estor.lib eikcoctl.lib eikdlg.lib
-LIBRARY eikctl.lib bafl.lib fbscli.lib aknnotify.lib aknicon.lib
-LIBRARY etext.lib gdi.lib egul.lib insock.lib
-LIBRARY ecom.lib InetProtUtil.lib http.lib esock.lib xmlengineDOM.lib calinterimapi.lib calenimp.lib CalenInterimUtils2.lib commdb.lib flogger.lib
-LIBRARY caldavclient.lib
-LIBRARY calenglobaldata.lib
-LIBRARY extendedconnpref.lib netmeta.lib
-
-EPOCHEAPSIZE 0x5000 0x400000
-EPOCSTACKSIZE 0x5000
-
-CAPABILITY NetworkServices ReadDeviceData ReadUserData WriteDeviceData WriteUserData
--- a/calendarengines/caldav/group/bld.inf Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: provides the information required for building
-* caldav engine
-*/
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_MMPFILES
-CalDavClient.mmp
-CalDavServer.mmp
-
-PRJ_TESTMMPFILES
-CalDavTest.mmp
-
-PRJ_EXPORTS
-../inc/caldavsession.h |../../../inc/caldavsession.h
--- a/calendarengines/caldav/inc/CalDavTest.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,103 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Caldav Test Suite
-*
-*/
-
-#ifndef __CALDAVTEST_H__
-#define __CALDAVTEST_H__
-
-// Include Files
-
-#include <e32base.h>
-#include <e32cons.h> // Console
-#include <flogger.h>
-
-class CCalDavEngine;
-class CCalDavSession;
-
-class CalDavTest
- {
-public:
- CalDavTest(CConsoleBase* console);
- ~CalDavTest();
-
- void TestGeneralEngineL();
- void TestEngineL(TInt aSucces, const TDesC8 &aUrl, const TDesC8 &aUser,
- const TDesC8 &aPassword, TBool aWebdavsync, TBool aCtag,
- TBool aEvent, TBool aTodo, TBool aFreeBusy, TBool aJournal);
- void TestClientServerL(TInt aSucces, const TDesC8 &aUrl,
- const TDesC8 &aUser, const TDesC8 &aPassword);
-private:
- // test client server
-
- TInt ConfigureSessionL(TInt aSucces, const TDesC8 &aUrl,
- const TDesC8 &aUser, const TDesC8 &aPassword);
- void OptionSession();
-
- void Enabled(TBool aEnabled);
-
- // test engine
- TInt EnableL(TInt aSucces, const TDesC8 &aUrl, const TDesC8 &aUser,
- const TDesC8 &aPassword);
- // use caldav engine
- void SendL(const unsigned long localuid);
- // use http call
- void SendL(TBool aVEvent);
-
- void DownloadLGetL(const unsigned long localuid);
- void DownloadLMultiGetL(const unsigned long localuid);
-
- // use http call
- void DeleteServerL();
- // use caldav engine
- void DeleteServerL(const unsigned long localuid);
- void DeleteClientL(const TDesC8 &aUid);
-
- void HeadL(TBool aExists, const TDesC8 &aUid);
- void OptionsL();
- void SyncL();
- void DoesExistL(TBool aExists, const unsigned long localuid);
- void DoesExistL(TBool aExists, const TDesC8 &aUID);
- void CTagL(TBool aEqual);
- void SynctokenL(TBool aEqual);
-
- void MkCalendarL(TBool aSuccess, const TDesC8 &aName);
- void DeleteCalendarL(const TDesC8 &aName);
-
- void CalendarInfoL();
- void GetUIDByUrl();
- void GetBaseUrl();
-
- void Write(const TDesC &aMessage);
- void Write(TBool aSuccess, const char* aMessage);
- void Write(TBool aSuccess, const TDesC &aMessage);
-
- TBool iWebdavSync;
- TBool iCtag;
-
- TBool iVEVENT;
- TBool iVTODO;
- TBool iVJOURNAL;
- TBool iVFREEBUSY;
-
- CCalDavEngine* iEngine;
- CCalDavSession* iSession;
- CConsoleBase* iConsole;
- RFileLogger iFileLogger;
- };
-
-GLDEF_C TInt E32Main();
-
-#endif // __CALDAVTEST_H__
--- a/calendarengines/caldav/inc/caldavclient.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: provides a client API for Caldav server
-*
-*/
-
-#ifndef _CALDAVCLIENT_H
-#define _CALDAVCLIENT_H
-
-#include <e32base.h>
-
-//**********************************
-//RCalDavServer
-//**********************************
-
-static TInt StartServer();
-
-class RCalDavServer : public RSessionBase
- {
-public:
- IMPORT_C RCalDavServer();
- IMPORT_C TInt Connect();
-
- IMPORT_C TInt Enable(const TDesC &aCalendar);
- IMPORT_C TInt Disable(const TDesC &aCalendar);
-
- IMPORT_C TInt EnabledSync(const TDesC &aCalendar, TBool &aEnabled);
-
- IMPORT_C TInt Sync(const TDesC &aCalendar);
- IMPORT_C TInt SyncAll();
-
- IMPORT_C TInt Url(const TDesC &aCalendar, TDes8 &aUrl);
- IMPORT_C TInt SetUrl(const TDesC &aCalendar, const TDesC8 &aUrl);
-
- IMPORT_C TInt Username(const TDesC &aCalendar, TDes8 &aUsername);
- IMPORT_C TInt SetUsername(const TDesC &aCalendar, const TDesC8 &aUsername);
-
- IMPORT_C TInt Password(const TDesC &aCalendar, TDes8 &aPassword);
- IMPORT_C TInt SetPassword(const TDesC &aCalendar, const TDesC8 &aPassword);
-
- IMPORT_C TInt SyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes& aSyncInterval);
- IMPORT_C TInt SetSyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes aSyncInterval);
-
- IMPORT_C TInt PastDays(const TDesC &aCalendar, TTimeIntervalDays &aDays);
- IMPORT_C TInt SetPastDays(const TDesC &aCalendar, TTimeIntervalDays aDays);
-
- IMPORT_C TInt ImmediateSync(const TDesC &aCalendar, TBool &aImmediateSyc);
- IMPORT_C TInt SetImmediateSync(const TDesC &aCalendar, TBool aImmediateSyc);
-
- IMPORT_C TInt KeepServerEntry(const TDesC &aCalendar, TBool &aKeepServerEntry);
- IMPORT_C TInt SetKeepServerEntry(const TDesC &aCalendar, TBool aKeepServerEntry);
-
- TVersion Version() const;
- TInt UnsupportedRequest();
- void BadRequest();
-
-private:
- };
-
-#endif
-
--- a/calendarengines/caldav/inc/caldavengine.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,239 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: main Caldav class, all magic happens here
-*
-*/
-
-#ifndef _CALSTORE_H
-#define _CALSTORE_H
-
-#include <e32base.h>
-#include <BADESCA.H>
-
-#include <calchangecallback.h>
-#include <calprogresscallback.h>
-#include <calfilechangenotification.h>
-
-#include <xmlengdomimplementation.h>
-#include <xmlengdomparser.h>
-
-#include "caldavutils.h"
-
-class CCalSession;
-class CCalEntry;
-class CCalIter;
-class CCalEntryView;
-class CCalenExporter;
-class CCalenImporter;
-class CCalenInterimUtils2;
-
-class RXmlEngDOMImplementation;
-class RXmlEngDOMParser;
-class RXmlEngDocument;
-
-class CHttpClient;
-class CalDavTest;
-
-// sync interval of 0 correspons to one minute
-// 0 actually means to enable push connectivity once supported
-#define DEFAULT_SYNC_MINUTES 0
-#define DEFAULT_PAST_DAYS 14
-#define DEFAULT_IMMEDIATE_SYNC ETrue
-#define DEFAULT_KEEP_SERVER_ENTRY EFalse
-
-
-enum TLocalLoopAction
- {
- ELoopActionUpload, ELoopActionFillArray, ELoopActionDeleteLocal
- };
-
-/**
- * CCalDavEngine
- *
- */
-class CCalDavEngine : public CBase, MCalProgressCallBack, MCalChangeCallBack2, MCalFileChangeObserver
- {
-public:
-
- friend class CalDavTest;
-
- ~CCalDavEngine();
-
- static CCalDavEngine* NewL(const TDesC& aCalendar);
- static CCalDavEngine* NewLC(const TDesC& aCalendar);
-
- TInt EnableL();
- void DisableL();
- TBool EnabledSync();
-
- TInt SyncL();
-
- TInt MkcalendarL(const TDesC8 &aName);
- TInt DeleteCalendarL(const TDesC8 &aName);
-
- TPtrC CalendarName() const;
- TPtrC8 Home() const;
-
- TPtrC8 Url() const;
- void SetUrlL(const TDesC8 &aUrl);
-
- TPtrC8 User() const;
- void SetUserL(const TDesC8 &aUser);
-
- TPtrC8 Password() const;
- void SetPasswordL(const TDesC8 &aPassword);
-
- TTimeIntervalMinutes SyncInterval() const;
- void SetSyncIntervalL(TTimeIntervalMinutes aSyncInterval);
-
- TTimeIntervalDays PastDays() const;
- void SetPastDaysL(TTimeIntervalDays aDays);
-
- TBool ImmediateSync() const;
- void SetImmediateSyncL(TBool aImmediateSyc);
-
- TBool KeepServerEntry() const;
- void SetKeepServerEntryL(TBool aKeepServerEntry);
-
- CPeriodic* Timer();
-
- TPtrC8 SyncToken();
- TPtrC8 CTag();
-
-private:
-
- CCalDavEngine();
- void ConstructL(const TDesC& aCalendar);
-
- void RegisterL();
- HBufC8* GetCTagL();
- HBufC8* GetSyncTokenL();
-
- TInt InitL();
-
- // Called during calendar entry view creation
- void Progress(TInt aPercentageCompleted);
- void Completed(TInt aError);
- TBool NotifyProgress();
- void CalChangeNotification(RArray<TCalChangeEntry> &aChangeItems);
- void CalendarInfoChangeNotificationL(RPointerArray<CCalFileChangeInfo>& aCalendarInfoChangeEntries);
-
- void CalendarInfoL();
- void SetCalendarInfoL(const TDesC8 &aKey, const TDesC8 &aValue);
-
- void HandleCalendarInfoChangeL();
- void HandleChangeL(MCalChangeCallBack2::TChangeType &aChangeType,
- MCalChangeCallBack2::TChangeEntryType &aEntryType,
- TCalLocalUid &aUid);
-
- TBool ManualSyncL();
- TBool WebDavSyncL();
- TInt WebDavSyncReportL(TBool aSynctoken);
- TBool UploadModifiedSinceDateL();
- TBool ClientChangesL();
- TBool ServerChangesL();
- TInt DeleteRemovedEntriesOnServerL();
- TInt LocalLoopL(TLocalLoopAction aAction);
-
- TInt ListL();
- TInt TimeReportL(TBool VEVENT, const TDesC8 &aStart, TBool aDelete = EFalse);
-
- // server actions
- TInt UploadEntryL(const TCalLocalUid &aUid,
- MCalChangeCallBack2::TChangeType aChangeType,
- MCalChangeCallBack2::TChangeEntryType aEntryType);
- TInt UploadEntryL(CCalEntry* aEntry,
- MCalChangeCallBack2::TChangeType aChangeType,
- MCalChangeCallBack2::TChangeEntryType aEntryType);
- TInt DownloadEntryL(const TDesC8 &aUrl);
- TInt DownloadEntryL(CDesC8Array* aArray);
- TInt DeleteEntryL(const TCalLocalUid &aUid);
- TInt DeleteEntryL(const TDesC8 &aUid);
- TInt HeadL(const TDesC8 &aUID);
-
- // local actions
- TInt AddModifyLocalEntryL(const TDesC8 &aUrl, const TDesC8 &aETag,
- CDesC8ArrayFlat* aArray);
- TInt DeleteLocalEntryL(const TDesC8 &aUID);
-
- TInt ParseResponsesDeleteL(const TDesC8 &aDocument);
- TInt ParseResponsesL(RXmlEngDocument &aDocument, TBool aMultiget = EFalse);
- TInt ParseResponsesL(const TDesC8 &aDocument, TBool aMultiget = EFalse);
-
- unsigned long DoesEntryExistL(const TDesC8 &aUrl);
- TPtrC8 GetUIDByUrl(const TDesC8 &aUrl);
- TBool ETagMatchL(const TDesC8& aUrl, const TDesC8& aETag);
- TInt StoreEntryL(const TDesC8 &aBuf, const TDesC8 &aEtag);
-
- void SyncFailedL();
- void SetLastSyncTimeL();
- void SetSyncTokenL(HBufC8* aToken);
- void SetCTagL(HBufC8* aToken);
-
- void CheckCalendarInfoL(RXmlEngDocument &aDocument);
-
- TBool GetOptionsL();
- TInt GetCalendarUrlsL(CDesC8ArrayFlat *aArray);
- void FindUrlsL(const TDesC8 &aDes, HBufC8 *&home, HBufC8 *&inbox,
- HBufC8 *&outbox);
- void GetBaseUrl(const TDesC8 &aUrl);
- HBufC8 * FindCalendarCollectionL(const TDesC8 &aUrl,
- CDesC8ArrayFlat *aArray);
-
- void DeleteCalObjects();
- TInt CreateCalObjectsL();
-
- CCalSession* iCalSession;
- CCalIter* iCalIter;
- CCalEntryView* iCalEntryView;
- CCalenExporter* iCalExporter;
- CCalenImporter* iCalImporter;
- CCalenInterimUtils2* iCalIntermimUtils2;
- HBufC *iCalendar;
- HBufC8 *iUrl;
- HBufC8 *iBaseUrl;
- HBufC8 *iHome;
-
- TCalDAVOptions iOptions;
- CHttpClient* iHttp;
-
- RXmlEngDOMImplementation iDomImpl;
- RXmlEngDOMParser iDomParser;
-
- // when we get a callback with a localuid, the corresponding entry is already deleted
- // we therefore need a different way to map from localuid to global uid/filename
- // this can be completly removed when introducing a new callback,
- // which includes the to be deleted localuid
- RArray<TCalLocalUid> iLocalUidArray;
- RArray<TBuf8<100> > iGlobalUidArray;
- //
- RArray<TCalLocalUid> iDeletedEntries;
-
- HBufC8 *iSynctoken;
- HBufC8 *iCTag;
- TBool iManualSync;
- TCalTime iLastSyncTime;
- TBool iFirstInit;
-
- // Options
- TTimeIntervalMinutes iSyncInterval;
- TTimeIntervalDays iPastDays;
- TBool iImmediateSync;
- TBool iKeepServerEntry;
- TBool iEnabled;
-
- CPeriodic* iTimer;
- };
-
-#endif // CALSTORE_H
--- a/calendarengines/caldav/inc/caldavenginemgr.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,86 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: provides a manager to keep track of all available engines
-*
-*/
-
-#ifndef CCALDAVENGINEMGR_H
-#define CCALDAVENGINEMGR_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include <calprogresscallback.h>
-
-class CCalDavEngine;
-/**
- * CCalDavEngineMgr
- *
- */
-class CCalDavEngineMgr : public CBase, MCalProgressCallBack
- {
-public:
-
- ~CCalDavEngineMgr();
-
- static CCalDavEngineMgr* NewL();
- static CCalDavEngineMgr* NewLC();
-
- void Progress(TInt aPercentageCompleted);
- void Completed(TInt aError);
- TBool NotifyProgress();
-
- TInt SyncL(const TDesC &aCalendar);
- TInt SyncAllL();
-
- TInt EnableL(const TDesC &aCalendar);
- TInt DisableL(const TDesC &aCalendar);
-
- TBool EnabledSyncL(const TDesC &aCalendar);
-
- TPtrC8 UrlL(const TDesC &aCalendar);
- void SetUrlL(const TDesC &aCalendar, const TDesC8 &aUrl);
-
- TPtrC8 UsernameL(const TDesC &aCalendar);
- void SetUsernameL(const TDesC &aCalendar, const TDesC8 &aUsername);
-
- TPtrC8 PasswordL(const TDesC &aCalendar);
- void SetPasswordL(const TDesC &aCalendar, const TDesC8 &aPassword);
-
- // TODO do also if enable was not called yet? if yes, create CalDavEngine and store settings
- TTimeIntervalMinutes SyncIntervalL(const TDesC &aCalendar);
- void SetSyncIntervalL(const TDesC &aCalendar,
- TTimeIntervalMinutes aSyncInterval);
-
- TTimeIntervalDays PastDaysL(const TDesC &aCalendar);
- void SetPastDaysL(const TDesC &aCalendar, TTimeIntervalDays aDays);
-
- TBool ImmediateSyncL(const TDesC &aCalendar);
- void SetImmediateSyncL(const TDesC &aCalendar, TBool aImmediateSyc);
-
- TBool KeepServerEntryL(const TDesC &aCalendar);
- void SetKeepServerEntryL(const TDesC &aCalendar, TBool aKeepServerEntry);
-
-private:
-
- CCalDavEngineMgr();
- void ConstructL();
-
- TInt FindEngineL(const TDesC &aName, TBool aCreate = EFalse);
- RPointerArray<CCalDavEngine> iEngines;
-
- };
-
-#endif // CCALDAVENGINEMGR_H
--- a/calendarengines/caldav/inc/caldavserver.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Caldav server, follows Symbian client/server
-* architecture
-*/
-
-#ifndef CCALDAVSERVER_H
-#define CCALDAVSERVER_H
-
-#include <e32base.h>
-
-#include "caldavutils.h"
-
-class CCalDavEngineMgr;
-
-// needed for creating server thread.
-const TUint KDefaultHeapSize = 0x10000;
-
-//**********************************
-//CCalDavServer
-//**********************************
-class CCalDavServer : public CPolicyServer
- {
-public:
- static CCalDavServer* NewLC();
- static TInt ThreadFunction(TAny* aStarted);
- static void PanicServer(TCalDavServPanic aPanic);
- CSession2
- * NewSessionL(const TVersion& aVersion, const RMessage2& aMessage) const;
-public:
-
- TInt EnableL(const TDesC &aCalendar);
- TInt DisableL(const TDesC &aCalendar);
-
- TBool EnabledSyncL(const TDesC &aCalendar) const;
-
- // TODO: make these asynchronous
- TInt SyncL(const TDesC &aCalendar);
- TInt SyncAllL();
-
- TPtrC8 UrlL(const TDesC &aCalendar);
- void SetUrlL(const TDesC &aCalendar, const TDesC8 &aUrl);
-
- TPtrC8 UsernameL(const TDesC &aCalendar);
- void SetUsernameL(const TDesC &aCalendar, const TDesC8 &aUsername);
-
- TPtrC8 PasswordL(const TDesC &aCalendar);
- void SetPasswordL(const TDesC &aCalendar, const TDesC8 &aPassword);
-
- TTimeIntervalMinutes SyncIntervalL(const TDesC &aCalendar) const;
- void SetSyncIntervalL(const TDesC &aCalendar,
- TTimeIntervalMinutes aSyncInterval);
-
- TTimeIntervalDays PastDaysL(const TDesC &aCalendar) const;
- void SetPastDaysL(const TDesC &aCalendar, TTimeIntervalDays aDays);
-
- TBool ImmediateSyncL(const TDesC &aCalendar) const;
- void SetImmediateSyncL(const TDesC &aCalendar, TBool aImmediateSyc);
-
- TBool KeepServerEntryL(const TDesC &aCalendar) const;
- void SetKeepServerEntryL(const TDesC &aCalendar, TBool aKeepServerEntry);
-
-private:
-
-private:
- static void ThreadFunctionL();
- ~CCalDavServer();
- CCalDavServer();
-
- CCalDavEngineMgr* iMgr;
-
-protected:
- void ConstructL();
- CCalDavServer(CActive::TPriority aActiveObjectPriority);
- };
-
-#endif
--- a/calendarengines/caldav/inc/caldavserversession.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Caldav server session, follows Symbian
-* client/server architecture
-*
-*/
-
-#ifndef CCALDAVSERVERSESSION_H
-#define CCALDAVSERVERSESSION_H
-
-#include <e32base.h>
-
-class CCalDavServer;
-
-//**********************************
-//CCalDavServerSession
-//**********************************
-/**
- This class represents a session with the server.
- Functions are provided to respond appropriately to client messages.
- */
-class CCalDavServerSession : public CSession2
- {
-public:
- CCalDavServerSession(CCalDavServer &aServer);
- void ServiceL(const RMessage2& aMessage);
-
- void EnableL(const RMessage2& aMessage);
- void DisableL(const RMessage2& aMessage);
-
- void SyncL(const RMessage2& aMessage);
- void SyncAllL(const RMessage2& aMessage);
-
- void UrlL(const RMessage2& aMessage);
- void SetUrlL(const RMessage2& aMessage);
-
- void UsernameL(const RMessage2& aMessage);
- void SetUsernameL(const RMessage2& aMessage);
-
- void PasswordL(const RMessage2& aMessage);
- void SetPasswordL(const RMessage2& aMessage);
-
- void SyncIntervalL(const RMessage2& aMessage);
- void SetSyncIntervalL(const RMessage2& aMessage);
-
- void PastDaysL(const RMessage2& aMessage);
- void SetPastDaysL(const RMessage2& aMessage);
-
- void ImmediateSyncL(const RMessage2& aMessage);
- void SetImmediateSyncL(const RMessage2& aMessage);
-
- void KeepServerEntryL(const RMessage2& aMessage);
- void SetKeepServerEntryL(const RMessage2& aMessage);
-
- void EnabledSyncL(const RMessage2& aMessage);
-
- // still there from symbian count example, not part of caldav
- void SetFromStringL(const RMessage2& aMessage);
- void Increase();
- void Decrease();
- void IncreaseBy(const RMessage2& aMessage);
- void DecreaseBy(const RMessage2& aMessage);
- void CounterValueL(const RMessage2& aMessage);
- void Reset();
- /********************************************************/
-
-protected:
- // panic the client
- void PanicClient(const RMessage2& aMessage, TInt aPanic) const;
-
-private:
- void DispatchMessageL(const RMessage2& aMessage);
-
- CCalDavServer& rServer;
- TInt iCount;
-
- };
-
-#endif
-
--- a/calendarengines/caldav/inc/caldavsession.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,202 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Client API to connect to Caldav server
-* Wrapper around RCalDavServer
-*/
-
-#ifndef CCALDAVSESSION_H
-#define CCALDAVSESSION_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-class CCalDavSessionImpl;
-
-/**
- * @class CCalenCustomisation
- * @brief Client API to connect to the CalDAV server.
- */
-NONSHARABLE_CLASS( CCalDavSession ) : public CBase
- {
-public:
- /** Allocates and constructs a session to the Calendar server.
- * @return Pointer to the newly created session.
- */
- IMPORT_C static CCalDavSession* NewL();
- /** Allocates and constructs a session to the Calendar server.
- @return Pointer to the newly created session.
- */
- IMPORT_C static CCalDavSession* NewLC();
-
- /**
- * standard destructor, close session with CalDavServer
- */
- IMPORT_C ~CCalDavSession();
-
- /**
- Enable access to a remote CalDAV server. At least url,
- username and password need to be set first.
-
- @param aCalendar calendar to enable, must be internal filename in the form c:calendar
- */
- IMPORT_C TInt Enable(const TDesC &aCalendar);
- /**
- Disable access to a remote CalDAV server.
-
- @param aCalendar calendar to disable, must be internal filename in the form c:calendar
- */
- IMPORT_C TInt Disable(const TDesC &aCalendar);
-
- /**
- On demand syncing of an enabled connection of one calendar file
-
- @param aCalendar calendar to enable, must be internal filename in the form c:calendar
- */
- IMPORT_C TInt SyncL(const TDesC &aCalendar);
- /**
- On demand syncing of all enabled connections
- */
- IMPORT_C TInt SyncAllL();
-
- /**
- Retrieve connection url
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aUrl url for the connection
- */
- IMPORT_C TInt Url(const TDesC &aCalendar, TDes8 &aUrl);
- /**
- Set connection url
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aUrl url for the url
- */
- IMPORT_C TInt SetUrl(const TDesC &aCalendar, const TDesC8 &aUrl);
-
- /**
- Retrieve connection username
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aUsername username for the connection
- */
-
- IMPORT_C TInt Username(const TDesC &aCalendar, TDes8 &aUsername);
- /**
- Set connection username
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aUsername username for the connection
- */
- IMPORT_C TInt SetUsername(const TDesC &aCalendar, const TDesC8 &aUsername);
-
- /**
- Retrieve connection password
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aPassword password for the connection
- */
-
- IMPORT_C TInt Password(const TDesC &aCalendar, TDes8 &aPassword);
- /**
- Set connection password
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aPassword password for the connection
- */
- IMPORT_C TInt SetPassword(const TDesC &aCalendar, const TDesC8 &aPassword);
- /**
- Retrieve synchonization interval
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aSyncInterval sync interval for the connection
- */
-
- IMPORT_C TInt SyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes& aSyncInterval);
- /**
- Set synchonization interval
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aSyncInterval sync interval for the connection, value of zero minutes meaning
- continuous connection
- */
- IMPORT_C TInt SetSyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes aSyncInterval);
-
- /**
- Retrieve time range into past for synchronization
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aDays number of days into the past for the connection
- */
- IMPORT_C TInt PastDays(const TDesC &aCalendar, TTimeIntervalDays &aDays);
- /**
- Set time range into past for synchronization
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aDays number of days into the past for the connection
- */
- IMPORT_C TInt SetPastDays(const TDesC &aCalendar, TTimeIntervalDays aDays);
-
- /**
- Retrieve immediate push of client changes
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aImmediateSync push client changes immediatly
- */
- IMPORT_C TInt ImmediateSync(const TDesC &aCalendar, TBool &aImmediateSyc);
- /**
- Set immediate push of client changes
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aImmediateSync push client changes immediatly
- */
- IMPORT_C TInt SetImmediateSync(const TDesC &aCalendar, TBool aImmediateSyc);
-
- /**
- During a synchronisation conflict, either the server or client needs to win, default is the server
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aKeepServerEntry server or client wins during synchronisation
- */
- IMPORT_C TInt KeepServerEntry(const TDesC &aCalendar,
- TBool &aKeepServerEntry);
- /**
- During a synchronisation conflict, either the server or client needs to win, which can be set here
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aKeepServerEntry server or client wins during synchronisation
- */
- IMPORT_C TInt SetKeepServerEntry(const TDesC &aCalendar,
- TBool aKeepServerEntry);
-
- /**
- Retrieve connection status
-
- @param aCalendar calendar for sync, must be internal filename in the form c:calendar
- @param aEnabledSync connection status
- */
- IMPORT_C TInt EnabledSync(const TDesC &aCalendar, TBool &aEnabledSync);
-
-private:
-
- CCalDavSession();
- void ConstructL();
-
- CCalDavSessionImpl* iImpl;
-
- };
-
-#endif // CCALDAVSESSION_H
--- a/calendarengines/caldav/inc/caldavsessionimpl.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,82 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Client API implementation
-* Wrapper around RCalDavServer
-*/
-
-#ifndef CCALDAVSESSIONIMPL_H
-#define CCALDAVSESSIONIMPL_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-class RCalDavServer;
-
-// CLASS DECLARATION
-
-/**
- * CCalDavSessionImpl
- *
- */
-class CCalDavSessionImpl : public CBase
- {
-public:
-
- ~CCalDavSessionImpl();
-
- static CCalDavSessionImpl* NewL();
- static CCalDavSessionImpl* NewLC();
-
- TInt Enable(const TDesC &aCalendar);
- TInt Disable(const TDesC &aCalendar);
-
- TInt SyncL(const TDesC &aCalendar);
- TInt SyncAllL();
-
- TInt Url(const TDesC &aCalendar, TDes8 &aUrl);
- TInt SetUrl(const TDesC &aCalendar, const TDesC8 &aUrl);
-
- TInt Username(const TDesC &aCalendar, TDes8 &aUsername);
- TInt SetUsername(const TDesC &aCalendar, const TDesC8 &aUsername);
-
- TInt Password(const TDesC &aCalendar, TDes8 &aPassword);
- TInt SetPassword(const TDesC &aCalendar, const TDesC8 &aPassword);
-
- TInt SyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes& aSyncInterval);
- TInt SetSyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes aSyncInterval);
-
- TInt PastDays(const TDesC &aCalendar, TTimeIntervalDays &aDays);
- TInt SetPastDays(const TDesC &aCalendar, TTimeIntervalDays aDays);
-
- TInt ImmediateSync(const TDesC &aCalendar, TBool &aImmediateSyc);
- TInt SetImmediateSync(const TDesC &aCalendar, TBool aImmediateSyc);
-
- TInt KeepServerEntry(const TDesC &aCalendar, TBool &aKeepServerEntry);
- TInt SetKeepServerEntry(const TDesC &aCalendar, TBool aKeepServerEntry);
-
- TInt EnabledSync(const TDesC &aCalendar, TBool &aEnabledSync);
-
-private:
-
- CCalDavSessionImpl();
- void ConstructL();
-
- RCalDavServer* iServer;
-
- };
-
-#endif // CCALDAVSESSIONIMPL_H
--- a/calendarengines/caldav/inc/caldavutils.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,251 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: various utility classes and functions
-* used in Caldav client and server code
-*/
-
-#ifndef CALDAVUTILS_H
-#define CALDAVUTILS_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-// CLASS DECLARATION
-class RHTTPTransaction;
-
-_LIT(KCalDavServerName,"!CalDavServer");
-_LIT(KCalDavServerFilename,"!CalDavServer.exe");
-_LIT8(KUserAgent, "Symbian 1.0");
-
-const TUint KCalDavServerMajorVersionNumber = 1;
-const TUint KCalDavServerMinorVersionNumber = 0;
-const TUint KCalDavServerBuildVersionNumber = 0;
-
-enum TCalDavServReq
- {
- ECalDavCreate = 1,
- ECalDavClose,
- ECalDavUnsupportedRequest,
- ECalDavEnable,
- ECalDavDisable,
- ECalDavMkCalendar,
- ECalDavDeleteCalendar,
- ECalDavSyncAll,
- ECalDavSync,
- ECalDavUrl,
- ECalDavSetUrl,
- ECalDavUsername,
- ECalDavSetUsername,
- ECalDavPassword,
- ECalDavSetPassword,
- ECalDavSyncInterval,
- ECalDavSetSyncInterval,
- ECalDavPastDays,
- ECalDavSetPastDays,
- ECalDavImmediateSync,
- ECalDavSetImmediateSync,
- ECalDavKeepServer,
- ECalDavSetKeepServer,
- ECalDavEnabled
- };
-
-enum TCalDavServLeave
- {
- ENonNumericString = 99
- };
-
-// reasons for server panic
-enum TCalDavServPanic
- {
- EBadRequest = 1,
- EBadDescriptor,
- EMainSchedulerError,
- ESvrCreateServer,
- ESvrStartServer,
- ECreateTrapCleanup,
- ENotImplementedYet,
- };
-
-struct TCalDAVOptions
- {
- // ALLOW header
- TBool DELETE;
- TBool GET;
- TBool HEAD;
- TBool MKCALENDAR;
- TBool MKCOL;
- TBool OPTIONS;
- TBool PROPFIND;
- TBool PROPPATCH;
- TBool PUT;
- TBool REPORT;
- TBool COPY;
- TBool POST;
- TBool MOVE;
- TBool ACL;
- TBool LOCK;
- TBool UNLOCK;
- TBool MULTIGET;
- TBool QUERY;
-
- TBool VEVENT;
- TBool VTODO;
- TBool VFREEBUSY;
- TBool VJOURNAL;
-
- //DAV header
- TBool ONE;
- TBool TWO;
- TBool THREE;
- TBool access_control;
- TBool calendar_access;
- TBool calendar_schedule;
- TBool calendar_auto_schedule;
- TBool extended_mkcol;
- TBool sync_collection;
- TBool sync_ctag;
- };
-_LIT8(colon,",");
-_LIT8(DAV,"DAV");
-_LIT8(ALLOW,"Allow");
-_LIT8(DELETE,"DELETE");
-_LIT8(GET,"GET");
-_LIT8(HEAD,"HEAD");
-_LIT8(MKCALENDAR,"MKCALENDAR");
-_LIT8(MKCOL,"MKCOL");
-_LIT8(OPTIONS,"OPTIONS");
-_LIT8(PROPFIND,"PROPFIND");
-_LIT8(PROPPATCH,"PROPPATCH");
-_LIT8(PUT,"PUT");
-_LIT8(REPORT,"REPORT");
-_LIT8(COPY,"COPY");
-_LIT8(POST,"POST");
-_LIT8(MOVE,"MOVE");
-_LIT8(ACL,"ACL");
-_LIT8(LOCK,"LOCK");
-_LIT8(UNLOCK,"UNLOCK");
-_LIT8(MULTIGET,"MULTIGET");
-//DAV header
-_LIT8(ZERO,"0");
-_LIT8(ONE,"1");
-_LIT8(TWO,"2");
-_LIT8(THREE,"3");
-_LIT8(access_control,"access-control");
-_LIT8(calendar_access,"calendar-access");
-_LIT8(calendar_schedule,"calendar-schedule");
-_LIT8(calendar_auto_schedule,"calendar-auto-schedule");
-_LIT8(sync_collection,"sync-collection");
-_LIT8(extended_mkcol,"extended-mkcol");
-_LIT8(KVEVENT,"VEVENT");
-_LIT8(KVTODO,"VTODO");
-_LIT8(KVJOURNAL,"VJOURNAL");
-_LIT8(KVFREBUSY,"VFREEBUSY");
-_LIT8(KDav,"DAV:");
-_LIT8(KMultistatus,"multistatus");
-_LIT8(LProp,"prop");
-_LIT8(KHref,"href");
-_LIT8(KResponse,"response");
-_LIT8(KStatus,"status");
-_LIT8(KOwner,"owner");
-_LIT8(KEtag,"getetag");
-_LIT8(KResourcetype,"resourcetype");
-_LIT8(KCalDav,"urn:ietf:params:xml:ns:caldav");
-_LIT8(KGetctag,"getctag");
-_LIT8(KSynctoken,"sync-token");
-_LIT8(KCalendarData,"calendar-data");
-_LIT8(KCalendar,"calendar");
-_LIT8(KCalendarHomeSet,"calendar-home-set");
-_LIT8(KOutbox,"schedule-outbox-URL");
-_LIT8(KInbox,"schedule-inbox-URL");
-_LIT8(KCalendarMultiget,"calendar-multiget");
-_LIT8(KCalendarQuery,"calendar-query");
-_LIT8(KDisplayname,"displayname");
-_LIT8(KSupportedCalendarComponentSet,"supported-calendar-component-set");
-_LIT8(KCalendar_Color,"calendar-color");
-
-// groupdav
-_LIT8(KVTodoCollection,"vtodo-collection");
-_LIT8(KVEventCollection,"vevent-collection");
-_LIT8(KIcs, ".ics");
-_LIT8(KUID,"UID:");
-_LIT8(KSlash,"/");
-_LIT8(KName,"name");
-_LIT8(KHrefstart,"<D:href xmlns:D=\"DAV:\">");
-_LIT8(KHrefend,"</D:href>");
-_LIT8(KMultistart,"<?xml version=\"1.0\" encoding=\"utf-8\" ?><C:calendar-multiget xmlns:C=\"urn:ietf:params:xml:ns:caldav\"><D:prop xmlns:D=\"DAV:\"><D:getetag/><C:calendar-data/></D:prop>");
-_LIT8(KMultiend,"</C:calendar-multiget>");
-_LIT8(KSync,"<?xml version=\"1.0\" encoding=\"utf-8\" ?><D:sync-collection xmlns:D=\"DAV:\"><D:sync-token>%S</D:sync-token><D:prop><D:getetag/></D:prop></D:sync-collection>");
-_LIT8(KCtag,"<?xml version=\"1.0\" encoding=\"utf-8\"?><D:propfind xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:D=\"DAV:\"><D:prop><T:getctag xmlns:T=\"http://calendarserver.org/ns/\"/></D:prop></D:propfind>");
-_LIT8(KSupportedSet,"<?xml version=\"1.0\" encoding=\"utf-8\"?><D:propfind xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:D=\"DAV:\"><D:prop><C:supported-calendar-component-set/><D:supported-report-set/><D:displayname/><A:calendar-color xmlns:A=\"http://apple.com/ns/ical/\"/></D:prop></D:propfind>");
-_LIT8(KCalendarurl,"<?xml version=\"1.0\" encoding=\"utf-8\"?><D:propfind xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:D=\"DAV:\"><D:prop><D:owner/><D:resourcetype/></D:prop></D:propfind>");
-_LIT8(KPrincipalurl,"<?xml version=\"1.0\" encoding=\"utf-8\"?><D:propfind xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:D=\"DAV:\"><D:prop><C:calendar-home-set/><C:schedule-inbox-URL/><C:schedule-outbox-URL/></D:prop></D:propfind>");
-_LIT8(KPropList,"<?xml version=\"1.0\" encoding=\"utf-8\"?><D:propfind xmlns:C=\"urn:ietf:params:xml:ns:caldav\" xmlns:D=\"DAV:\"><D:prop><D:getetag/></D:prop></D:propfind>");
-_LIT8(KTimeStartEVENT,"<?xml version=\"1.0\" encoding=\"UTF-8\"?><calendar-query xmlns:D=\"DAV:\" xmlns=\"urn:ietf:params:xml:ns:caldav\"><D:prop><D:getetag/></D:prop><filter><comp-filter name=\"VCALENDAR\"><comp-filter name=\"VEVENT\"><time-range start=");
-_LIT8(KTimeStartTODO,"<?xml version=\"1.0\" encoding=\"UTF-8\"?><calendar-query xmlns:D=\"DAV:\" xmlns=\"urn:ietf:params:xml:ns:caldav\"><D:prop><D:getetag/></D:prop><filter><comp-filter name=\"VCALENDAR\"><comp-filter name=\"VTODO\"><time-range start=");
-_LIT8(KTimeEnd," end=\"20200101T000000Z\"/></comp-filter></comp-filter></filter></calendar-query>");
-_LIT8(KTimeTest,"<?xml version=\"1.0\" encoding=\"UTF-8\"?><calendar-query xmlns:D=\"DAV:\" xmlns=\"urn:ietf:params:xml:ns:caldav\"><D:prop><D:getetag/></D:prop><filter><comp-filter name=\"VCALENDAR\"><comp-filter name=\"VEVENT\"><time-range start=\"20090509T220000Z\" end=\"20090509T220000Z\"/></comp-filter></comp-filter></filter></calendar-query>");
-
-_LIT8(KColorDisplayStart,"<?xml version=\"1.0\" encoding=\"utf-8\"?><D:propertyupdate xmlns:D=\"DAV:\"><D:set><D:prop><A:calendar-color xmlns:A=\"http://apple.com/ns/ical/\">");
-_LIT8(KColorDisplayMiddle,"</A:calendar-color><D:displayname>");
-_LIT8(KColorDisplayEnd,"</D:displayname></D:prop></D:set></D:propertyupdate>");
-
-// strings for CCalCalendarInfo Properties
-_LIT8(KCaldavEnabled,"caldavenabled");
-_LIT8(KCaldavFirstInit,"caldavfirstinit");
-_LIT8(KCaldavCtag,"caldavctag");
-_LIT8(KCaldavSynctoken,"caldavsynctoken");
-_LIT8(KCaldavManualSync,"caldavmanualsync");
-_LIT8(KCaldavTime,"caldavtime");
-_LIT8(KCaldavUser,"caldavuser");
-_LIT8(KCaldavPassword,"caldavpassword");
-_LIT8(KCaldavUrl,"caldavurl");
-_LIT8(KCaldavKeepServer,"caldavkeepserver");
-_LIT8(KCaldavImmediateSync,"caldavimmediatesync");
-_LIT8(KCaldavPastDays,"caldavpastdays");
-_LIT8(KCaldavSyncInterval,"caldavsyncinterval");
-
-class CalDavUtils : public CBase
- {
-public:
-
- ~CalDavUtils();
-
- static CalDavUtils* NewL();
- static CalDavUtils* NewLC();
-
- static void ScanDAVHeaderL(RHTTPTransaction &aTransaction,
- TCalDAVOptions &aOptions);
- static void ScanAllowHeaderL(RHTTPTransaction &aTransaction,
- TCalDAVOptions &aOptions);
- static void FixExportIssues(TDes8 &aDes);
- static void FixImportIssues(TDes8 &aDes);
- static void GetFileName(const TDesC8 &aIcs, TDes8 &aUrl);
-
- static HBufC8* EnsureSlashL(HBufC8* aIn);
- static HBufC8* CalDavUtils::EnsureSlashL(const TDesC8 &aIn);
-
-private:
-
- CalDavUtils();
- void ConstructL();
-
- static void FindAndRemoveMethod(TDes8 &aDes);
- static void FixBYMONTHDAY(TDes8 &aDes);
- static void FixSameTime(TDes8 &aDes);
- static void FixLineFeed(TDes8 &aDes);
-
- };
-
-#endif // CALDAVUTILS_H
--- a/calendarengines/caldav/inc/httpclient.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,146 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description:
-*
-*/
-
-#ifndef HTTPCLIENT_H
-#define HTTPCLIENT_H
-
-#include <http\MHTTPAuthenticationCallback.h>
-#include <http\mhttptransactioncallback.h>
-#include <http\mhttpdatasupplier.h>
-
-#include <es_sock.h>
-#include <extendedconnpref.h>
-
-struct TCalDAVOptions;
-
-_LIT8(KHTTP200,"http/1.1 200 ok");
-_LIT8(KHTTP201,"http/1.1 201 created");
-_LIT8(KHTTP404,"http/1.1 404 not found");
-
-#define ERROR 0
-#define OK 200
-#define CREATED 201
-#define NOCONTENT 204
-#define MULTISTATUS 207
-#define MUTIPLECHOICES 300
-#define BADREQUEST 400
-#define FORBIDDEN 403
-#define NOTFOUND 404
-#define NOTALLOWED 405
-#define CONFLICT 409
-#define PRECONDFAILED 412
-
-enum THttpAction
- {
- EActionUpload, EActionDelete, EActionOption, EActionNone
- };
-
-class CHttpClient : public CBase,
- public MHTTPDataSupplier,
- public MHTTPAuthenticationCallback,
- public MHTTPTransactionCallback
- {
-public:
- virtual ~CHttpClient();
- static CHttpClient* NewLC();
- static CHttpClient* NewL();
-
- TInt PutL(const TDesC8 &aUrl, const TDesC8 &aICS, CBufFlat *aResponse,
- const TDesC8 &aEtag = KNullDesC8);
- TInt MkCalendarL(const TDesC8 &aUrl, const TDesC8 &aBody,
- CBufFlat *aResponse);
- TInt DeleteL(const TDesC8 &aUrl, const TDesC8 &aETag = KNullDesC8);
- TInt HeadL(const TDesC8 &aUrl);
- TInt GetL(const TDesC8 &aUrl, CBufFlat *aResponse);
- TInt PropfindL(const TDesC8 &aUrl, const TDesC8 &aBodyRequest,
- CBufFlat *aResponse, TBool depth0 = ETrue);
- TInt ReportL(const TDesC8 &aUrl, const TDesC8 &aBodyRequest,
- CBufFlat *aResponse);
- TInt ProppatchL(const TDesC8 &aUrl, const TDesC8 &aBodyRequest,
- CBufFlat *aResponse);
-
- TInt GetServerOptionsL(const TDesC8 &aUrl, TCalDAVOptions &aOptions);
-
- // methods inherited from MHTTPDataSupplier
- virtual TBool GetNextDataPart(TPtrC8& aDataPart);
- virtual void ReleaseData();
- virtual TInt OverallDataSize();
- virtual TInt Reset();
-
- TInt ReturnCode();
- TPtrC8 ETag();
-
- //
- // methods from MHTTPTransactionCallback
- //
- virtual void MHFRunL(RHTTPTransaction aTransaction,
- const THTTPEvent& aEvent);
- virtual TInt MHFRunError(TInt aError, RHTTPTransaction aTransaction,
- const THTTPEvent& aEvent);
-
- // methods inherited from MHTTPAuthenticationCallback
- virtual TBool GetCredentialsL(const TUriC8& aURI, RString aRealm,
- RStringF aAuthenticationType, RString& aUsername,
- RString& aPassword);
-
- TPtrC8 User();
- void SetUserL(const TDesC8 &aUser);
-
- void SetPasswordL(const TDesC8 &aPassword);
- TPtrC8 Password();
-
-protected:
- CHttpClient();
- void ConstructL();
-private:
-
- void InvokeHttpMethodL(const TDesC8& aUri, RStringF aMethod);
- void SetHeaderL(RHTTPHeaders aHeaders, TInt aHdrField,
- const TDesC8& aHdrValue);
- void SetHeaderL(RHTTPHeaders aHeaders, const TDesC8 &aField,
- const TDesC8 &aValue);
- void GetEtagHeaderL(RHTTPTransaction& aTransaction);
-
- void GetPostBodyManuallyL();
-
- void OpenSessionL();
-
-private:
- RHTTPSession iSess;
- RHTTPTransaction iTrans;
- TParse iParsedFileName;
- CBufFlat* iBodyResponse;
- HBufC8* iBodyRequest;
-
- RSocketServ iSocketServ;
- RConnection iRConnection;
- TConnPrefList iPrefList;
- TExtendedConnPref iExtPrefs;
-
- HBufC8 *iUser;
- HBufC8 *iPassword;
-
- TCalDAVOptions *iOptions;
- THttpAction iAction;
-
- TInt iReturnCode;
- HBufC8* iEtag;
- TInt iCredentialCount;
-
- };
-
-#endif
--- a/calendarengines/caldav/src/caldavclient.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,329 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: provides a client API for Caldav server
-*
-*/
-
-#include "caldavclient.h"
-#include "caldavserver.h"
-#include "caldavutils.h"
-
-const TUint KDefaultMessageSlots = 4;
-
-// testing ************
-#include <e32base.h>
-#include <e32cons.h>
-#include <e32cmn.h>
-
-/**
- * RCalDavServer::RCalDavServer
- * default constructor
- */
-EXPORT_C RCalDavServer::RCalDavServer()
- {
- }
-
-/**
- * RCalDavServer::Connect
- * connect to server
- */
-EXPORT_C TInt RCalDavServer::Connect()
- {
- TInt retry = 2;
- for (;;)
- {
- TInt r = CreateSession(KCalDavServerName, Version(),
- KDefaultMessageSlots);
-
- if ((KErrNotFound != r) && (KErrServerTerminated != r))
- return (r);
-
- if (--retry == 0)
- return (r);
-
- r = StartServer();
- if ((KErrNone != r) && (KErrAlreadyExists != r))
- return (r);
- }
- }
-
-/**
- * RCalDavServer::Enable
- * enable Caldav sync
- */
-EXPORT_C TInt RCalDavServer::Enable(const TDesC &aCalendar)
- {
- TIpcArgs args(&aCalendar);
- return SendReceive(ECalDavEnable, args);
- }
-
-/**
- * RCalDavServer::Disable
- * disable Caldav sync
- */
-EXPORT_C TInt RCalDavServer::Disable(const TDesC &aCalendar)
- {
- TIpcArgs args(&aCalendar);
- return SendReceive(ECalDavDisable, args);
- }
-
-/**
- * RCalDavServer::EnabledSync
- * check for enabled sync
- */
-EXPORT_C TInt RCalDavServer::EnabledSync(const TDesC &aCalendar,
- TBool &aEnabled)
- {
- TPckg<TBool> enabled(aEnabled);
- TIpcArgs args(&aCalendar, &enabled);
- return (SendReceive(ECalDavEnabled, args));
- }
-
-/**
- * RCalDavServer::Sync
- * sync now a specific calendar
- */
-EXPORT_C TInt RCalDavServer::Sync(const TDesC &aCalendar)
- {
- TIpcArgs args(&aCalendar);
- return SendReceive(ECalDavSync, args);
- }
-
-/**
- * RCalDavServer::SyncAll
- * sync now all calendars
- */
-EXPORT_C TInt RCalDavServer::SyncAll()
- {
- return SendReceive(ECalDavSyncAll);
- }
-
-/**
- * RCalDavServer::Url
- * get caldav sync url
- */
-EXPORT_C TInt RCalDavServer::Url(const TDesC &aCalendar, TDes8 &aUrl)
- {
- TIpcArgs args(&aCalendar, &aUrl);
- return SendReceive(ECalDavUrl, args);
- }
-
-/**
- * RCalDavServer::SetUrl
- * set url
- */
-EXPORT_C TInt RCalDavServer::SetUrl(const TDesC &aCalendar, const TDesC8 &aUrl)
- {
- TIpcArgs args(&aCalendar, &aUrl);
- return SendReceive(ECalDavSetUrl, args);
- }
-
-/**
- * RCalDavServer::Username
- * get username
- */
-EXPORT_C TInt RCalDavServer::Username(const TDesC &aCalendar, TDes8 &aUsername)
- {
- TIpcArgs args(&aCalendar, &aUsername);
- return SendReceive(ECalDavUsername, args);
- }
-
-/**
- * RCalDavServer::SetUsername
- * set username
- */
-EXPORT_C TInt RCalDavServer::SetUsername(const TDesC &aCalendar,
- const TDesC8 &aUsername)
- {
- TIpcArgs args(&aCalendar, &aUsername);
- return SendReceive(ECalDavSetUsername, args);
- }
-
-/**
- * RCalDavServer::Password
- * get password
- */
-EXPORT_C TInt RCalDavServer::Password(const TDesC &aCalendar, TDes8 &aPassword)
- {
- TIpcArgs args(&aCalendar, &aPassword);
- return SendReceive(ECalDavPassword, args);
- }
-
-/**
- * RCalDavServer::SetPassword
- * set password
- */
-EXPORT_C TInt RCalDavServer::SetPassword(const TDesC &aCalendar,
- const TDesC8 &aPassword)
- {
- TIpcArgs args(&aCalendar, &aPassword);
- return SendReceive(ECalDavSetPassword, args);
- }
-
-/**
- * RCalDavServer::SyncInterval
- * get SyncInterval
- */
-EXPORT_C TInt RCalDavServer::SyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes& aSyncInterval)
- {
- TPckg<TTimeIntervalMinutes> syncinterval(aSyncInterval);
- TIpcArgs args(&aCalendar, &syncinterval);
- return (SendReceive(ECalDavSyncInterval, args));
- }
-
-/**
- * RCalDavServer::SetSyncInterval
- * set SyncInterval
- */
-EXPORT_C TInt RCalDavServer::SetSyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes aSyncInterval)
- {
- TPckg<TTimeIntervalMinutes> syncinterval(aSyncInterval);
- TIpcArgs args(&aCalendar, &syncinterval);
- return (SendReceive(ECalDavSetSyncInterval, args));
- }
-
-/**
- * RCalDavServer::PastDays
- * get past days
- */
-EXPORT_C TInt RCalDavServer::PastDays(const TDesC &aCalendar,
- TTimeIntervalDays &aDays)
- {
- TPckg<TTimeIntervalDays> pastdays(aDays);
- TIpcArgs args(&aCalendar, &pastdays);
- return (SendReceive(ECalDavPastDays, args));
- }
-
-/**
- * RCalDavServer::SetPastDays
- * set past days
- */
-EXPORT_C TInt RCalDavServer::SetPastDays(const TDesC &aCalendar,
- TTimeIntervalDays aDays)
- {
- TPckg<TTimeIntervalDays> pastdays(aDays);
- TIpcArgs args(&aCalendar, &pastdays);
- return (SendReceive(ECalDavSetPastDays, args));
- }
-
-/**
- * RCalDavServer::ImmediateSync
- * get Immediate Sync
- */
-EXPORT_C TInt RCalDavServer::ImmediateSync(const TDesC &aCalendar,
- TBool &aImmediateSyc)
- {
- TPckg<TBool> syncimmediate(aImmediateSyc);
- TIpcArgs args(&aCalendar, &syncimmediate);
- return (SendReceive(ECalDavImmediateSync, args));
- }
-
-/**
- * RCalDavServer::SetImmediateSync
- * set immediate Sync
- */
-EXPORT_C TInt RCalDavServer::SetImmediateSync(const TDesC &aCalendar,
- TBool aImmediateSyc)
- {
- TPckg<TBool> syncimmediate(aImmediateSyc);
- TIpcArgs args(&aCalendar, &syncimmediate);
- return SendReceive(ECalDavSetImmediateSync, args);
- }
-
-/**
- * RCalDavServer::KeepServerEntry
- * get KeepServerEntry
- */
-EXPORT_C TInt RCalDavServer::KeepServerEntry(const TDesC &aCalendar,
- TBool &aKeepServerEntry)
- {
- TPckg<TBool> keepserverentry(aKeepServerEntry);
- TIpcArgs args(&aCalendar, &keepserverentry);
- return SendReceive(ECalDavKeepServer, args);
- }
-
-/**
- * RCalDavServer::SetKeepServerEntry
- * set KeepServerEntry
- */
-EXPORT_C TInt RCalDavServer::SetKeepServerEntry(const TDesC &aCalendar,
- TBool aKeepServerEntry)
- {
- TPckg<TBool> keepserverentry(aKeepServerEntry);
- TIpcArgs args(&aCalendar, &keepserverentry);
- return SendReceive(ECalDavSetKeepServer, args);
- }
-
-/**
- * RCalDavServer::Version
- * get version
- */
-TVersion RCalDavServer::Version(void) const
- {
- return (TVersion(KCalDavServerMajorVersionNumber,
- KCalDavServerMinorVersionNumber, KCalDavServerBuildVersionNumber));
- }
-
-/**
- * RCalDavServer::UnsupportedRequest()
- * A server request to stop the server.
- * This is a request that is NOT implemented by the server; it is here to show
- * the handling of non-implemented requests.
- */
-TInt RCalDavServer::UnsupportedRequest()
- {
- return SendReceive(ECalDavUnsupportedRequest);
- }
-
-/**
- * RCalDavServer::BadRequest()
- * A request that the server knows nothing about.
- */
-void RCalDavServer::BadRequest()
- {
- SendReceive(9999);
- }
-
-static TInt StartServer()
- {
- RProcess server;
- TInt r = server.Create(KCalDavServerFilename, KNullDesC);
- if (r != KErrNone)
- return r;
-
- TRequestStatus stat;
- server.Rendezvous(stat);
-
- if (stat != KRequestPending)
- server.Kill(0); // abort startup
- else
- server.Resume(); // logon OK - start the server
-
- User::WaitForRequest(stat); // wait for start or death
-
- // Check the exit type.
- // We can't use the 'exit reason' because if the server panicked this
- // is set to the panic 'reason' (which may be '0' and cannot thus be distinguished
- // from KErrNone)
- r = server.ExitType();
- if (EExitPanic == r)
- r = KErrGeneral;
- else
- r = stat.Int();
-
- server.Close(); // This is no longer needed
- return r;
- }
--- a/calendarengines/caldav/src/caldavengine.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,2617 +0,0 @@
-/*
- * Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
- * Maximilian Odendahl
- *
- * Contributors:
- *
- * Description: main Caldav class, all magic happens here
- * one engine for each configured Caldav calendar
- */
-#include "caldavengine.h"
-#include <f32file.h>
-#include <S32FILE.H>
-#include <S32MEM.H>
-#include <avkon.rsg>
-#include <UTF.H>
-#include <agnexportobserver.h>
-#include <calsession.h>
-#include <caliterator.h>
-#include <calentry.h>
-#include <calentryview.h>
-#include <caltime.h>
-#include <calalarm.h>
-#include <calcategory.h>
-#include <caluser.h>
-#include <calrrule.h>
-#include <calinstance.h>
-#include <calinstanceview.h>
-#include <caleninterimutils2.h>
-#include <calenexporter.h>
-#include <calenimporter.h>
-#include <calcalendarinfo.h>
-#include "calenglobaldata.h"
-#include <xmlengdocument.h>
-#include <xmlengnode.h>
-#include <xmlengelement.h>
-#include <xmlengnodelist.h>
-#include <xmlengtext.h>
-#include "httpclient.h"
-#include <e32math.h> // divmod
-#define MULTIGETSPLIT 100
-#define ARRAYEXPAND 4
-#define URLMAX 500
-#define EXPANDSIZE_SMALL 512
-#define EXPANDSIZE_BIG 1024
-_LIT(KFormatString,"\"%F%Y%M%DT000000Z\"");
-
-/**
- * SyncTickL
- * timer for basic sync interval
- */
-TInt SyncTickL(TAny *aObject)
- {
- CCalDavEngine* engine = ((CCalDavEngine*) aObject);
- CPeriodic* timer = engine->Timer();
- if (engine && timer)
- {
- timer->Cancel();
- TRAP_IGNORE(engine->SyncL());
- TInt ticktime = engine->SyncInterval().Int() == 0 ? 1
- : engine->SyncInterval().Int();
- const TUint64 tickInterval = 1000000 * 60 * ticktime;
- timer->Start(tickInterval, tickInterval, TCallBack(SyncTickL, engine));
- }
- return 0;
- }
-
-#ifdef _DEBUG
-void ExportToFileNameL(const TDesC8& aDes, const TDesC &aFilename)
- {
- RFs fsSession;
- User::LeaveIfError(fsSession.Connect());
- CleanupClosePushL(fsSession);
-
- TInt err = fsSession.MkDirAll(aFilename);
-
- RFile file;
- User::LeaveIfError(file.Replace(fsSession, aFilename, EFileWrite));
- CleanupClosePushL(file);
-
- RFileWriteStream writeStream2;
- writeStream2.Attach(file);
- CleanupClosePushL(writeStream2);
-
- writeStream2 << aDes;
- writeStream2.CommitL();
- CleanupStack::PopAndDestroy(&writeStream2);
- CleanupStack::PopAndDestroy(&file);
- CleanupStack::PopAndDestroy(&fsSession);
- }
-
-void ExportToFileL(CCalEntry* aEntry, CCalenExporter *iCalExporter)
- {
- if (aEntry)
- {
- _LIT(KFileName, "C:\\logs\\caldav\\testing_export.txt");
-
- RFs fsSession;
- User::LeaveIfError(fsSession.Connect());
- CleanupClosePushL(fsSession);
-
- TInt err = fsSession.MkDirAll(KFileName);
-
- RFile file;
- User::LeaveIfError(file.Replace(fsSession, KFileName, EFileWrite));
- CleanupClosePushL(file);
-
- RFileWriteStream writeStream2;
- writeStream2.Attach(file);
- CleanupClosePushL(writeStream2);
-
- iCalExporter->ExportICalL(*aEntry, writeStream2);
- writeStream2.CommitL();
- CleanupStack::PopAndDestroy(&writeStream2);
- CleanupStack::PopAndDestroy(&file);
- CleanupStack::PopAndDestroy(&fsSession);
- }
- }
-#endif
-
-/**
- * SearchL
- * search inside xml tree for a specific node
- */
-void SearchL(TXmlEngNode &aTopNode, const TDesC8 &aName,
- const TDesC8 &aNamespace, TXmlEngNode & aReturnNode)
- {
- RXmlEngNodeList<TXmlEngNode> List;
- aTopNode.GetChildNodes(List);
- while (List.HasNext() && aReturnNode.IsNull())
- {
- TXmlEngNode Node = List.Next();
- TXmlEngNode::TXmlEngDOMNodeType Type = Node.NodeType();
- if (Type == TXmlEngNode::EElement)
- {
- //todo: compare namespace ?
- if (Node.Name() == aName)
- {
- aReturnNode = Node.CopyL();
- return;
- }
- else
- {
- SearchL(Node, aName, aNamespace, aReturnNode);
- if (!aReturnNode.IsNull())
- return;
- }
- }
- }
- }
-
-/**
- * SearchL
- * search inside xml tree for a specific node
- */
-void SearchL(TXmlEngNode &aTopNode, const TDesC8 &aName,
- const TDesC8 &aNamespace, RBuf8 &aBuf)
- {
- RXmlEngNodeList<TXmlEngNode> List;
- aTopNode.GetChildNodes(List);
- while (List.HasNext())
- {
- TXmlEngNode Node = List.Next();
- TXmlEngNode::TXmlEngDOMNodeType Type = Node.NodeType();
- if (Type == TXmlEngNode::EElement)
- {
- //todo: compare namespace ?
- if (Node.Name() == aName)
- {
- if (Node.IsSimpleTextContents())
- aBuf.Create(Node.Value());
- else
- Node.WholeTextContentsCopyL(aBuf);
- return;
- }
- else
- {
- SearchL(Node, aName, aNamespace, aBuf);
- if (aBuf.Length())
- return;
- }
- }
- }
- }
-
-/**
- * SearchL
- * search inside xml tree for a specific node
- */
-TPtrC8 SearchL(TXmlEngNode &aTopNode, const TDesC8 &aName,
- const TDesC8 &aNamespace)
- {
- RXmlEngNodeList<TXmlEngNode> List;
- aTopNode.GetChildNodes(List);
- while (List.HasNext())
- {
- TXmlEngNode Node = List.Next();
- TXmlEngNode::TXmlEngDOMNodeType Type = Node.NodeType();
- if (Type == TXmlEngNode::EElement)
- {
- //todo: compare namespace ?
- if (Node.Name() == aName)
- return Node.Value();
- else
- {
- TPtrC8 Return = SearchL(Node, aName, aNamespace);
- if (Return != KNullDesC8)
- return Return;
- }
- }
- }
- return KNullDesC8();
- }
-
-/**
- * GetBoolFromPropertiesL
- * get a boolean value from CCalCalendarInfo
- */
-TBool GetBoolFromPropertiesL(CCalCalendarInfo* info, const TDesC8 &aKey)
- {
- TBool boolean;
- TPckgC<TBool> pckgboolean(boolean);
- pckgboolean.Set(info->PropertyValueL(aKey));
- return pckgboolean();
- }
-
-/**
- * GetTimeFromPropertiesL
- * get a time value from CCalCalendarInfo
- */
-TCalTime GetTimeFromPropertiesL(CCalCalendarInfo* info, const TDesC8 &aKey)
- {
- TCalTime time;
- TPckgC<TCalTime> pckgtime(time);
- pckgtime.Set(info->PropertyValueL(aKey));
- return pckgtime();
- }
-
-/**
- * PropertyExists
- * finds a property from an array
- */
-TBool PropertyExists(CDesC8Array* aArray, const TDesC8 &aKey)
- {
- TInt pos = 0;
- return aArray->Find(aKey, pos, ECmpNormal) == KErrNone;
- }
-
-/**
- * CCalDavEngine::SetCalendarInfoL
- * set key and value pair at calendar session info
- */
-void CCalDavEngine::SetCalendarInfoL(const TDesC8 &aKey, const TDesC8 &aValue)
- {
- TBool createdelete = !iCalSession;
- if (createdelete)
- {
- iCalSession = CCalSession::NewL();
- TRAP_IGNORE(iCalSession->OpenL(*iCalendar));
- }
- CCalCalendarInfo* calendarInfo = iCalSession->CalendarInfoL();
- CleanupStack::PushL(calendarInfo);
- TPckgC<TBool> enabled(iEnabled);
- calendarInfo->SetPropertyL(KCaldavEnabled, enabled);
- if (aValue != KNullDesC8)
- calendarInfo->SetPropertyL(aKey, aValue);
- iCalSession->SetCalendarInfoL(*calendarInfo);
- CleanupStack::PopAndDestroy(calendarInfo);
-
- if (createdelete)
- {
- delete iCalSession;
- iCalSession = NULL;
- }
- }
-
-/**
- * CCalDavEngine::CCalDavEngine
- * default constructor
- */
-CCalDavEngine::CCalDavEngine() :
- iCalSession(0), iCalIter(0), iCalEntryView(0), iCalExporter(0),
- iCalImporter(0), iCalIntermimUtils2(0), iCalendar(0), iUrl(0),
- iBaseUrl(0), iHome(0), iHttp(0), iSynctoken(0), iCTag(0),
- iSyncInterval(DEFAULT_SYNC_MINUTES), iPastDays(DEFAULT_PAST_DAYS),
- iImmediateSync(DEFAULT_IMMEDIATE_SYNC), iKeepServerEntry(
- DEFAULT_KEEP_SERVER_ENTRY), iEnabled(EFalse), iTimer(0)
- {
- }
-
-/**
- * CCalDavEngine::~CCalDavEngine
- * default destructor
- */
-CCalDavEngine::~CCalDavEngine()
- {
- iLocalUidArray.Close();
- iGlobalUidArray.Close();
- iDeletedEntries.Close();
-
- iDomParser.Close();
- iDomImpl.Close();
-
- if (iCalendar)
- delete iCalendar;
-
- if (iUrl)
- delete iUrl;
-
- if (iBaseUrl)
- delete iBaseUrl;
-
- if (iHttp)
- delete iHttp;
-
- DeleteCalObjects();
-
- if (iCalIntermimUtils2)
- delete iCalIntermimUtils2;
-
- if (iSynctoken)
- delete iSynctoken;
-
- if (iCTag)
- delete iCTag;
-
- if (iHome)
- delete iHome;
-
- if (iTimer)
- delete iTimer;
- }
-
-/**
- * CCalDavEngine::NewLC
- * first phase construction
- */
-CCalDavEngine* CCalDavEngine::NewLC(const TDesC& aCalendar)
- {
- CCalDavEngine* self = new (ELeave) CCalDavEngine();
- CleanupStack::PushL(self);
- self->ConstructL(aCalendar);
- return self;
- }
-
-/**
- * CCalDavEngine::NewL
- * first phase construction
- */
-CCalDavEngine* CCalDavEngine::NewL(const TDesC& aCalendar)
- {
- CCalDavEngine* self = CCalDavEngine::NewLC(aCalendar);
- CleanupStack::Pop(self); // self;
- return self;
- }
-
-/**
- * CCalDavEngine::
- * second phase construction
- */
-void CCalDavEngine::ConstructL(const TDesC& aCalendar)
- {
- iManualSync = EFalse;
- iFirstInit = ETrue;
- iCalendar = aCalendar.AllocL();
-
- iHttp = CHttpClient::NewL();
-
- iDomImpl.OpenL();
- TInt err = iDomParser.Open(iDomImpl);
- if (KErrNone != err)
- User::Leave(err);
-
- iTimer = CPeriodic::NewL(EPriorityNormal);
- iCalIntermimUtils2 = CCalenInterimUtils2::NewL();
- iCalSession = CCalSession::NewL();
- TRAP_IGNORE(iCalSession->OpenL(aCalendar));
- CalendarInfoL();
- // we can't close the file, so delete it completly
- delete iCalSession;
- iCalSession = NULL;
- }
-
-/**
- * CCalDavEngine::Progress
- * Progress callback
- */
-void CCalDavEngine::Progress(TInt /*aPercentageCompleted*/)
- {
- }
-
-/**
- * CCalDavEngine::RegisterL
- * register all neccessary notification callback
- */
-void CCalDavEngine::RegisterL()
- {
- TDateTime Start;
- TDateTime End;
- End.SetYear(2200);
-
- TCalTime StartCal;
- TCalTime EndCal;
- StartCal.SetTimeLocalL(Start);
- EndCal.SetTimeLocalL(End);
- CalCommon::TCalTimeRange Range(StartCal, EndCal);
- CCalChangeNotificationFilter *Filter = CCalChangeNotificationFilter::NewL(
- MCalChangeCallBack2::EChangeEntryAll, true, Range);
- iCalSession->StartChangeNotification(*this, *Filter);
- iCalSession->StartFileChangeNotificationL(*this);
- delete Filter;
- }
-
-/**
- * CCalDavEngine::CalendarInfoL
- * load all properties from CalendarInfo
- */
-void CCalDavEngine::CalendarInfoL()
- {
- CCalCalendarInfo* calendarInfo = iCalSession->CalendarInfoL();
- if (calendarInfo->IsValid())
- {
- CleanupStack::PushL(calendarInfo);
- CDesC8Array* propertyKeys = calendarInfo->PropertyKeysL();
- CleanupStack::PushL(propertyKeys);
- TInt pos = 0;
- if (propertyKeys->Find(KCaldavEnabled, pos, ECmpNormal) == KErrNone)
- {
- iEnabled = GetBoolFromPropertiesL(calendarInfo, KCaldavEnabled);
- if (PropertyExists(propertyKeys, KCaldavFirstInit))
- iFirstInit = GetBoolFromPropertiesL(calendarInfo,
- KCaldavFirstInit);
- if (PropertyExists(propertyKeys, KCaldavSynctoken))
- iSynctoken
- = calendarInfo->PropertyValueL(KCaldavSynctoken).AllocL();
- if (PropertyExists(propertyKeys, KCaldavCtag))
- iCTag = calendarInfo->PropertyValueL(KCaldavCtag).AllocL();
- if (PropertyExists(propertyKeys, KCaldavManualSync))
- iManualSync = GetBoolFromPropertiesL(calendarInfo,
- KCaldavManualSync);
- if (PropertyExists(propertyKeys, KCaldavTime))
- iLastSyncTime = GetTimeFromPropertiesL(calendarInfo,
- KCaldavTime);
- if (PropertyExists(propertyKeys, KCaldavUrl))
- iUrl = calendarInfo->PropertyValueL(KCaldavUrl).AllocL();
- if (PropertyExists(propertyKeys, KCaldavUser))
- iHttp->SetUserL(calendarInfo->PropertyValueL(KCaldavUser));
- if (PropertyExists(propertyKeys, KCaldavPassword))
- iHttp->SetPasswordL(calendarInfo->PropertyValueL(
- KCaldavPassword));
- if (PropertyExists(propertyKeys, KCaldavKeepServer))
- iKeepServerEntry = GetBoolFromPropertiesL(calendarInfo,
- KCaldavKeepServer);
- if (PropertyExists(propertyKeys, KCaldavImmediateSync))
- iImmediateSync = GetBoolFromPropertiesL(calendarInfo,
- KCaldavImmediateSync);
- if (PropertyExists(propertyKeys, KCaldavPastDays))
- {
- TPckgC<TTimeIntervalDays> pastdays(iPastDays);
- pastdays.Set(calendarInfo->PropertyValueL(KCaldavPastDays));
- iPastDays = pastdays();
- }
- if (PropertyExists(propertyKeys, KCaldavSyncInterval))
- {
- TPckgC<TTimeIntervalMinutes> syncinterval(iSyncInterval);
- syncinterval.Set(calendarInfo->PropertyValueL(
- KCaldavSyncInterval));
- iSyncInterval = syncinterval();
- }
- // access point
- }
-
- CleanupStack::PopAndDestroy(propertyKeys);
- CleanupStack::Pop(calendarInfo);
- }
- delete calendarInfo;
- }
-
-/**
- * CCalDavEngine::InitL
- * check for correct url
- * load most Caldav url properties
- * do inital sync
- */
-TInt CCalDavEngine::InitL()
- {
- // this is only needed to find a GlobalUID from a LocalUID, used after an event was deleted
- // also used now for uploading of local events when only GlobalUID is know
- LocalLoopL(ELoopActionFillArray);
-
- if (iFirstInit)
- {
- TInt err = GetCalendarUrlsL(NULL);
- if (err == KErrArgument)
- return KErrArgument;
- GetOptionsL();
- SetLastSyncTimeL();
-
- TBool success;
- // get all server items
- if (iOptions.sync_collection)
- success = WebDavSyncL();
- else
- success = ListL() == KErrNone;
-
- if (!success)
- return KErrGeneral;
-
- // upload all local entries of this calendar to server
- LocalLoopL(ELoopActionUpload);
-
- if (iOptions.sync_collection)
- SetSyncTokenL(GetSyncTokenL());
- else
- SetCTagL(GetCTagL());
-
- iFirstInit = EFalse;
- iEnabled = ETrue;
- TPckgC<TBool> firstInit(iFirstInit);
- SetCalendarInfoL(KCaldavFirstInit, firstInit); // this will set iEnabled as well
- }
- else
- {
- TInt err = GetCalendarUrlsL(NULL);
- if (err == KErrArgument)
- return KErrArgument;
- GetOptionsL();
- SetLastSyncTimeL();
- iEnabled = ETrue;
- SetCalendarInfoL(KCaldavEnabled, KNullDesC8);
- SyncL();
- }
-
- return KErrNone;
- }
-
-/**
- * CCalDavEngine::Completed
- * Completed callback
- */
-void CCalDavEngine::Completed(TInt aError)
- {
- if (aError == KErrNone)
- {
- CActiveScheduler::Stop();
- }
- else
- iManualSync = true;
- }
-
-/**
- * CCalDavEngine::NotifyProgress
- * NotifyProgress callback
- */
-TBool CCalDavEngine::NotifyProgress()
- {
- return EFalse;
- }
-
-/**
- * CCalDavEngine::CalChangeNotification
- * change item callback, sync to server
- */
-void CCalDavEngine::CalChangeNotification(RArray<TCalChangeEntry> &aChangeItems)
- {
- for (TInt i = 0; i < aChangeItems.Count(); i++)
- {
- TRAP_IGNORE(HandleChangeL(aChangeItems[i].iChangeType, aChangeItems[i].iEntryType, aChangeItems[i].iEntryId));
- }
- }
-
-/**
- * CCalDavEngine::CalendarInfoChangeNotificationL
- * change callback, sync changed color or name to server
- */
-void CCalDavEngine::CalendarInfoChangeNotificationL(RPointerArray<
- CCalFileChangeInfo>& aCalendarInfoChangeEntries)
- {
- for (TInt i = 0; i < aCalendarInfoChangeEntries.Count(); i++)
- {
- if ((aCalendarInfoChangeEntries[i]->FileNameL() == *iCalendar)
- && (aCalendarInfoChangeEntries[i]->ChangeType()
- == MCalFileChangeObserver::ECalendarInfoUpdated))
- {
- TRAP_IGNORE(HandleCalendarInfoChangeL());
- }
- }
- }
-
-/**
- * CCalDavEngine::HandleCalendarInfoChangeL
- * sync changed color or name to server
- */
-void CCalDavEngine::HandleCalendarInfoChangeL()
- {
- if (iHttp)
- {
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- CCalCalendarInfo* info = iCalSession->CalendarInfoL();
- CleanupStack::PushL(info);
-
- HBufC8* name =
- CnvUtfConverter::ConvertFromUnicodeToUtf8L(info->NameL());
- CleanupStack::PushL(name);
-
- TRgb color = info->Color();
- _LIT8(KColorformat,"#%02x%02x%02xFF");
- TBuf8<9> colorbuf;
- colorbuf.Format(KColorformat, color.Red(), color.Green(), color.Blue());
-
- HBufC8* patch = HBufC8::NewLC(KColorDisplayStart().Length()
- + colorbuf.Length() + KColorDisplayMiddle().Length()
- + name->Length() + KColorDisplayEnd().Length());
- patch->Des().Append(KColorDisplayStart);
- patch->Des().Append(colorbuf);
- patch->Des().Append(KColorDisplayMiddle);
- patch->Des().Append(*name);
- patch->Des().Append(KColorDisplayEnd);
- iHttp->ProppatchL(*iUrl, *patch, response);
- CleanupStack::PopAndDestroy(4); // response, info, name, patch
- }
- }
-
-/**
- * CCalDavEngine::HandleChangeL
- * change item callback, sync to server
- */
-void CCalDavEngine::HandleChangeL(
- MCalChangeCallBack2::TChangeType &aChangeType,
- MCalChangeCallBack2::TChangeEntryType &aEntryType, TCalLocalUid &aUid)
- {
- switch (aChangeType)
- {
- case MCalChangeCallBack2::EChangeAdd:
- case MCalChangeCallBack2::EChangeModify:
- {
- if (iImmediateSync)
- UploadEntryL(aUid, aChangeType, aEntryType);
- else
- // enable manual sync for the next sync interval
- SyncFailedL();
- break;
- }
- case MCalChangeCallBack2::EChangeDelete:
- {
- if (iImmediateSync)
- DeleteEntryL(aUid);
- else
- {
- iDeletedEntries.Append(aUid);
- SyncFailedL();
- }
- break;
- }
- case MCalChangeCallBack2::EChangeUndefined:
- {
- // upload new and modified entries to server
- UploadModifiedSinceDateL();
-
- // Find locally deleted ones and delete on server
- DeleteRemovedEntriesOnServerL();
-
- break;
- }
- }
- }
-
-/**
- * CCalDavEngine::EnableL
- * enable Caldav sync
- */
-TInt CCalDavEngine::EnableL()
- {
- if (!iCalEntryView) //do not use iEnabled here,might be set already in ConstructL()
- {
- TInt aErr = CreateCalObjectsL();
- if ((aErr == KErrNone) && (InitL() == KErrNone))
- {
- iTimer->Cancel();
- TInt ticktime = iSyncInterval.Int() == 0 ? 1 : iSyncInterval.Int();
- const TUint64 tickInterval = 1000000 * 60 * ticktime;
- iTimer->Start(tickInterval, tickInterval,
- TCallBack(SyncTickL, this));
- // register change notification
- RegisterL();
- return KErrNone;
- }
- else
- {
- iEnabled = EFalse;
- SetCalendarInfoL(KCaldavEnabled, KNullDesC8);
- DeleteCalObjects();
- return KErrArgument;
- }
- }
- return KErrNone;
- }
-
-/**
- * CCalDavEngine::DeleteCalObjects
- * delete all calendar objects
- */
-void CCalDavEngine::DeleteCalObjects()
- {
- delete iCalIter;
- iCalIter = NULL;
- delete iCalEntryView;
- iCalEntryView = NULL;
- delete iCalImporter;
- iCalImporter = NULL;
- delete iCalExporter;
- iCalExporter = NULL;
- if (iCalSession)
- {
- iCalSession->StopChangeNotification();
- iCalSession->StopFileChangeNotification();
- delete iCalSession;
- }
- iCalSession = NULL;
- }
-
-/**
- * CCalDavEngine::CreateCalObjectsL
- * create all calendar objects
- */
-TInt CCalDavEngine::CreateCalObjectsL()
- {
- iCalSession = CCalSession::NewL();
- TRAPD(aErr,iCalSession->OpenL(*iCalendar));
- iCalExporter = CCalenExporter::NewL(*iCalSession);
- iCalImporter = CCalenImporter::NewL(*iCalSession);
- iCalEntryView = CCalEntryView::NewL(*iCalSession);
- iCalIter = CCalIter::NewL(*iCalSession);
- return aErr;
- }
-
-/**
- * CCalDavEngine::DisableL
- * disable sync
- */
-void CCalDavEngine::DisableL()
- {
- if (iEnabled)
- {
- iTimer->Cancel();
- iEnabled = EFalse;
- SetCalendarInfoL(KCaldavEnabled, KNullDesC8);
- DeleteCalObjects();
- }
- }
-
-/**
- * CCalDavEngine::EnabledSync
- * check for enabled sync
- */
-TBool CCalDavEngine::EnabledSync()
- {
- return iEnabled;
- }
-
-/**
- * CCalDavEngine::TimeReportL
- * do a CalDav time report
- */
-TInt CCalDavEngine::TimeReportL(TBool VEVENT, const TDesC8 &aStart,
- TBool aDelete)
- {
- CBufFlat* body = CBufFlat::NewL(EXPANDSIZE_BIG);
- CleanupStack::PushL(body);
-
- body->InsertL(body->Size(), VEVENT ? KTimeStartEVENT() : KTimeStartTODO());
- body->InsertL(body->Size(), aStart); // "20090509T220000Z"/>
- body->InsertL(body->Size(), KTimeEnd);
-
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_BIG);
- CleanupStack::PushL(response);
- TInt ret = iHttp->ReportL(*iUrl, body->Ptr(0), response);
-
- if (ret == MULTISTATUS)
- ret = aDelete ? ParseResponsesDeleteL(response->Ptr(0))
- : ParseResponsesL(response->Ptr(0));
- else
- ret = KErrGeneral;
-
- CleanupStack::PopAndDestroy(response);
- CleanupStack::PopAndDestroy(body);
- return ret;
- }
-
-/**
- * CCalDavEngine::ListL
- * get events either using time report or basic propfind
- */
-TInt CCalDavEngine::ListL()
- {
- if (iOptions.calendar_access)
- {
- TTime syncstart;
- syncstart.HomeTime();
- syncstart = syncstart - iPastDays;
- TBuf<100> nowStr;
- syncstart.FormatL(nowStr, KFormatString);
- TBuf8<100> nowStrAdd;
- nowStrAdd.Append(nowStr);
-
- TInt eventreturn = KErrNone;
- if (iOptions.VEVENT)
- eventreturn = TimeReportL(ETrue, nowStrAdd);
-
- TInt todoreturn = KErrNone;
- if (iOptions.VTODO)
- todoreturn = TimeReportL(EFalse, nowStrAdd);
-
- return (eventreturn == KErrNone) && (todoreturn == KErrNone) ? KErrNone
- : KErrGeneral;
- }
- else
- {
- // use PROPFIND report
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- TInt ret = iHttp->PropfindL(*iUrl, KPropList, response, EFalse);
- if (ret == MULTISTATUS)
- ret = ParseResponsesL(response->Ptr(0));
- else
- ret = KErrGeneral;
- CleanupStack::PopAndDestroy(response);
- return ret;
- }
- }
-
-/**
- * CCalDavEngine::SyncL
- * sync a calendar
- */
-TInt CCalDavEngine::SyncL()
- {
- if (iUrl)
- {
- if (iOptions.sync_collection)
- return WebDavSyncL();
- else
- return ManualSyncL();
- }
- return KErrGeneral;
- }
-
-/**
- * CCalDavEngine::ManualSyncL
- * if sync failed previously, try again manually
- */
-TBool CCalDavEngine::ManualSyncL()
- {
- TBool client = ClientChangesL();
- if (iOptions.sync_ctag)
- {
- HBufC8 *newCTag = GetCTagL();
- TBool server = ETrue;
- if ((CTag() != *newCTag) && (*newCTag != KNullDesC8))
- {
- server = ServerChangesL();
- if (server)
- SetCTagL(newCTag);
- else
- delete newCTag;
- }
- else
- delete newCTag;
-
- return client || server;
- }
- else
- {
- TBool server = ServerChangesL();
- return client || server;
- }
- }
-
-/**
- * CCalDavEngine::ServerChangesL
- * sync server changes
- */
-TBool CCalDavEngine::ServerChangesL()
- {
- // loop over all server items to find new and modified entries
- // uses either propfind or calendar-query
- TInt ret = ListL();
-
- // loop over all local items to find deleted ones on the server
- LocalLoopL(ELoopActionDeleteLocal);
-
- return ret == KErrNone;
- }
-
-/**
- * CCalDavEngine::LocalLoopL
- * loop over local calendar store
- */
-TInt CCalDavEngine::LocalLoopL(TLocalLoopAction aAction)
- {
- TBuf8<URLMAX> iter = iCalIter->FirstL();
- TBuf8<URLMAX> url;
- while (iter != KNullDesC8)
- {
- url.Append(*iUrl);
- url.Append(iter);
- url.Append(KIcs);
- switch (aAction)
- {
- case ELoopActionDeleteLocal:
- {
- if (HeadL(iter) == NOTFOUND)
- DeleteLocalEntryL(url);
- break;
- }
- case ELoopActionFillArray:
- {
- RPointerArray<CCalEntry> entryArray;
- CleanupClosePushL(entryArray);
- iCalEntryView->FetchL(iter, entryArray);
- if (entryArray.Count())
- {
- iLocalUidArray.Append(entryArray[0]->LocalUidL());
- iGlobalUidArray.Append(entryArray[0]->UidL());
- }
- entryArray.ResetAndDestroy();
- CleanupStack::PopAndDestroy(&entryArray);
-
- break;
- }
- case ELoopActionUpload:
- {
- TInt pos = iGlobalUidArray.Find(iter);
- if ((pos != KErrNotFound) && (iLocalUidArray.Count() > pos))
- UploadEntryL(iLocalUidArray[pos],
- MCalChangeCallBack2::EChangeAdd,
- MCalChangeCallBack2::EChangeEntryAll);
- break;
- }
- }
- url.Delete(0, url.Length());
- iter = iCalIter->NextL();
- }
- return KErrNone;
- }
-
-/**
- * CCalDavEngine::ParseResponsesDeleteL
- * process a recieved multistatus response
- */
-TInt CCalDavEngine::ParseResponsesDeleteL(const TDesC8 &aDocument)
- {
- TInt ret = KErrNone;
- RXmlEngDocument document = iDomParser.ParseL(aDocument);
- CleanupClosePushL(document);
- if (document.NotNull())
- {
- // this method works for response as well as sync-response
- // do not use GetElementsByTagNameL for one specific responses directly
- TXmlEngElement ResponseListTop;
- SearchL(document, KMultistatus, KNullDesC8, ResponseListTop);
-
- RXmlEngNodeList<TXmlEngNode> ResponseList;
- CleanupClosePushL(ResponseList);
- ResponseListTop.GetChildNodes(ResponseList);
-
- while (ResponseList.HasNext())
- {
- TXmlEngNode node = ResponseList.Next();
- if (node.NodeType() == TXmlEngNode::EElement)
- {
- TPtrC8 href = SearchL(node, KHref, KNullDesC8);
- // don't do anything with home itself
- if ((href.Right(KIcs().Length()) == KIcs))
- {
- if (!DoesEntryExistL(href))
- DeleteEntryL(href);
- }
- }
- }
- CleanupStack::PopAndDestroy(&ResponseList);
-
- }
- else
- ret = KErrArgument;
- CleanupStack::PopAndDestroy(&document);
- return ret;
- }
-
-/**
- * CCalDavEngine::ParseResponsesL
- * process a recieved multistatus response
- */
-TInt CCalDavEngine::ParseResponsesL(RXmlEngDocument &aDocument, TBool aMultiget)
- {
- TInt ret = KErrNone;
- if (aDocument.NotNull())
- {
- CDesC8ArrayFlat *multiget = NULL;
- if (iOptions.MULTIGET)
- {
- multiget = new (ELeave) CDesC8ArrayFlat(ARRAYEXPAND);
- CleanupStack::PushL(multiget);
- }
-
- // this method works for response as well as sync-response
- // do not use GetElementsByTagNameL for one specific responses directly
- TXmlEngElement ResponseListTop;
- SearchL(aDocument, KMultistatus, KNullDesC8, ResponseListTop);
-
- RXmlEngNodeList<TXmlEngNode> ResponseList;
- CleanupClosePushL(ResponseList);
- ResponseListTop.GetChildNodes(ResponseList);
-
- while (ResponseList.HasNext())
- {
- TXmlEngNode node = ResponseList.Next();
- if (node.NodeType() == TXmlEngNode::EElement)
- {
- TPtrC8 href = SearchL(node, KHref, KNullDesC8);
- //do not use Search, only looking for first childs,
- //as D:propstat has D:status as well
- RXmlEngNodeList<TXmlEngElement> statuslist;
- CleanupClosePushL(statuslist);
- node.AsElement().GetElementsByTagNameL(statuslist, KStatus,
- KDav);
- //only one or zero item
- HBufC8* status =
- statuslist.Count() ? statuslist.Next().Value().AllocL()
- : KNullDesC8().AllocL();
- CleanupStack::PopAndDestroy(&statuslist);
- CleanupStack::PushL(status);
- status->Des().LowerCase();
- TPtrC8 etag = SearchL(node, KEtag, KNullDesC8);
- RBuf8 calendardata;
- SearchL(node, KCalendarData, KNullDesC8, calendardata);
- calendardata.CleanupClosePushL();
-
- // don't do anything with home itself
- if (href.Right(KIcs().Length()) == KIcs)
- {
- if ((*status == KHTTP200) || (*status == KHTTP201) || (*status == KNullDesC8))
- {
- if ((calendardata == KNullDesC8))
- {
- if (aMultiget)
- {
- // ATTENTION: an empty response to a multiget should never happen
- // data wrapped inside CDATA, e.g. bedework ??
- }
- else
- //TOOD: if this is a webdav sync response, we should skip the etag check
- AddModifyLocalEntryL(href, etag, multiget);
- }
- else
- {
- // response to a multiget or time-range report, we now already have everything we need
- StoreEntryL(calendardata, etag);
- }
- }
- else if (*status == KHTTP404)
- {
- if (iOptions.sync_collection)
- {
- // if this is an initial sync without token,
- // this should be ignored, Sun Server bug!!!
- if (SyncToken() != KNullDesC8)
- DeleteLocalEntryL(href);
- }
- else
- {
- //multiget answer, but deleted in the meantime, should delete locally as well
- DeleteLocalEntryL(href);
- }
- }
- }
- CleanupStack::PopAndDestroy(&calendardata);
- CleanupStack::PopAndDestroy(status);
- }
- }
- CleanupStack::PopAndDestroy(&ResponseList);
-
- if (iOptions.MULTIGET)
- {
- if (multiget->Count())
- {
- DownloadEntryL(multiget);
- multiget->Reset();
- }
- CleanupStack::PopAndDestroy(multiget);
- }
- }
- else
- ret = KErrArgument;
-
- return ret;
- }
-
-/**
- * CCalDavEngine::ParseResponsesL
- * process a recieved multistatus response
- */
-TInt CCalDavEngine::ParseResponsesL(const TDesC8 &aDocument, TBool aMultiget)
- {
-#ifdef _DEBUG
- _LIT(KFilename,"c:\\logs\\caldav\\parseresonseslatest.txt");
- ExportToFileNameL(aDocument, KFilename);
-#endif
-
- RXmlEngDocument document = iDomParser.ParseL(aDocument);
- CleanupClosePushL(document);
- TInt ret = ParseResponsesL(document, aMultiget);
- CleanupStack::PopAndDestroy(&document);
- return ret;
- }
-
-/**
- * CCalDavEngine::StoreEntryL
- * store event in local store
- */
-#ifdef ETAG
-TInt CCalDavEngine::StoreEntryL(const TDesC8 &aBuf, const TDesC8 &aEtag)
-#else
-TInt CCalDavEngine::StoreEntryL(const TDesC8 &aBuf, const TDesC8 &/*aEtag*/)
-#endif
- {
-#ifdef _DEBUG
- _LIT(KFileName2, "C:\\logs\\caldav\\testing_import.txt");
- ExportToFileNameL(aBuf, KFileName2);
-#endif
-
- HBufC8* buffer = HBufC8::NewL(aBuf.Length() + 500);
- buffer->Des().Append(aBuf);
- TPtr8 ptr = buffer->Des();
- CalDavUtils::FixImportIssues(ptr);
-
- RPointerArray<CCalEntry> Array;
- CleanupClosePushL(Array);
- RDesReadStream ReadStream;
- ReadStream.Open(ptr);
- CleanupClosePushL(ReadStream);
-#ifdef _DEBUG
- _LIT(KFileName, "C:\\logs\\caldav\\testing_import_fixed.txt");
- ExportToFileNameL(ptr, KFileName);
-#endif
- TRAPD(error, iCalImporter->ImportICalendarL(ReadStream,Array));
- CleanupStack::PopAndDestroy(&ReadStream); // calls close on rSteam
- if ((error == KErrNone) && (Array.Count()))
- {
- iCalIntermimUtils2->StoreL(*iCalEntryView, *Array[0], ETrue); // or should last one be EFalse??
- TInt pos = iLocalUidArray.Find(Array[0]->LocalUidL());
- if (pos == KErrNotFound)
- {
- iLocalUidArray.Append(Array[0]->LocalUidL());
- iGlobalUidArray.Append(Array[0]->UidL());
- }
-#ifdef ETAG
- Array[0]->SetETag(aEtag);
-#endif
- }
- Array.ResetAndDestroy();
- CleanupStack::PopAndDestroy(&Array);
-
- delete buffer;
- return error;
- }
-
-/**
- * CCalDavEngine::WebDavSyncReportL
- * webdav sync report
- * http://tools.ietf.org/html/draft-daboo-webdav-sync-02
- */
-TInt CCalDavEngine::WebDavSyncReportL(TBool aSynctoken)
- {
- HBufC8 *Buf = HBufC8::NewL(KSync().Length() + SyncToken().Length());
- TPtrC8 token = SyncToken();
- if (aSynctoken)
- Buf->Des().Format(KSync, &token);
- else
- Buf->Des().Format(KSync, &KNullDesC8());
- CleanupStack::PushL(Buf);
-
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_BIG);
- CleanupStack::PushL(response);
- TInt ret = iHttp->ReportL(*iUrl, *Buf, response);
-
- if (ret == MULTISTATUS)
- {
- RXmlEngDocument document = iDomParser.ParseL(response->Ptr(0));
- CleanupClosePushL(document);
- if (document.NotNull())
- {
- TPtrC8 Token = SearchL(document, KSynctoken, KNullDesC8);
- if ((Token != KNullDesC8) && (Token != SyncToken()))
- {
- ret = ParseResponsesL(document);
- //store newest token
- if (ret == KErrNone)
- SetSyncTokenL(Token.AllocL());
- }
- else
- ret = KErrNone;
- }
- else
- ret = KErrGeneral;
- CleanupStack::PopAndDestroy(&document);
- }
- CleanupStack::PopAndDestroy(response);
- CleanupStack::PopAndDestroy(Buf);
- return ret;
- }
-
-/**
- * CCalDavEngine::WebDavSyncL
- * sync using webdav sync
- * http://tools.ietf.org/html/draft-daboo-webdav-sync-02
- */
-TBool CCalDavEngine::WebDavSyncL()
- {
- if (iHttp)
- {
- // commit any left over client changes
- TBool RetClient = ClientChangesL();
- // get all changes from server
- TInt ret = WebDavSyncReportL(ETrue);
- if (ret == CONFLICT)
- ret = WebDavSyncReportL(EFalse);
- return (ret == KErrNone) && RetClient;
- }
- return EFalse;
- }
-
-/**
- * CCalDavEngine::GetUIDByUrl
- * parse url to find UID
- */
-TPtrC8 CCalDavEngine::GetUIDByUrl(const TDesC8 &aUrl)
- {
- TPtrC8 UID;
- TInt Pos = aUrl.LocateReverse('/');
- TInt Pos2 = aUrl.Find(KIcs);
-
- if ((Pos != KErrNotFound) && (Pos2 != KErrNotFound))
- UID.Set(aUrl.Mid(Pos + 1, Pos2 - Pos - 1));
- else
- {
- if (Pos != KErrNotFound)
- UID.Set(aUrl.Mid(Pos + 1, aUrl.Length() - Pos - 1));
- else if (Pos2 != KErrNotFound)
- UID.Set(aUrl.Left(aUrl.Length() - KIcs().Length()));
- else
- UID.Set(aUrl);
- }
-
- return UID;
- }
-
-/**
- * CCalDavEngine::DoesEntryExistL
- * check if entry exists in local store
- */
-unsigned long CCalDavEngine::DoesEntryExistL(const TDesC8 &aUrl)
- {
- // check if we already have it locally by uid
- RPointerArray<CCalEntry> entryArray;
- CleanupClosePushL(entryArray);
- iCalEntryView->FetchL(GetUIDByUrl(aUrl), entryArray);
- // get parent
- CCalEntry *entry = entryArray.Count() ? entryArray[0] : NULL;
- TInt ret = entry ? entry->LocalUidL() : 0;
- entryArray.ResetAndDestroy();
- CleanupStack::PopAndDestroy(&entryArray);
- return ret;
- }
-
-/**
- * CCalDavEngine::ETagMatchL
- * checks for equal ETag
- */
-TBool CCalDavEngine::ETagMatchL(const TDesC8& /*aUrl*/, const TDesC8& /*aETag*/)
- {
-#ifdef ETAG
- // check if we already have it locally by uid
- RPointerArray<CCalEntry> entryArray;
- CleanupClosePushL(entryArray);
- iCalEntryView->FetchL(GetUIDByUrl(aUrl), entryArray);
- // get parent
- CCalEntry *entry = entryArray.Count() ? entryArray[0] : NULL;
- TBool ret = entry ? entry->ETag() == aETag : EFalse;
- entryArray.ResetAndDestroy();
- CleanupStack::PopAndDestroy(&entryArray);
- return ret;
-#else
- return EFalse;
-#endif
- }
-
-/**
- * CCalDavEngine::AddModifyLocalEntryL
- * add or modify existing event
- */
-TInt CCalDavEngine::AddModifyLocalEntryL(const TDesC8 &aUrl,
- const TDesC8 &aETag, CDesC8ArrayFlat* aArray)
- {
- // check if we have the entry locally
- // check for etag if we have the latest version, if not, download and import or add to multiget request
- if (!ETagMatchL(aUrl, aETag))
- {
- if (aArray)
- aArray->AppendL(aUrl);
- else
- DownloadEntryL(aUrl);
- }
- return KErrNone;
- }
-
-/**
- * CCalDavEngine::DownloadEntryL
- * download entries using multiget from server
- */
-TInt CCalDavEngine::DownloadEntryL(CDesC8Array* aArray)
- {
- TInt ret = KErrNone;
- TInt64 remainder;
- TInt64 result = Math::DivMod64(aArray->Count(), MULTIGETSPLIT, remainder);
-
- // split large multigets request into several smaller ones
- for (TInt64 l = 0; l <= result; l++)
- {
- // do the multiget request and pass it to parserepsonses again to read in the data
- CBufFlat* body = CBufFlat::NewL(EXPANDSIZE_BIG);
- CleanupStack::PushL(body);
-
- body->InsertL(body->Size(), KMultistart);
- for (TInt64 i = 0; i <= ((l == result) ? remainder - 1 : MULTIGETSPLIT
- - 1); i++)
- {
- body->InsertL(body->Size(), KHrefstart);
- body->InsertL(body->Size(), (*aArray)[MULTIGETSPLIT * l + i]);
- body->InsertL(body->Size(), KHrefend);
- }
- body->InsertL(body->Size(), KMultiend);
-
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_BIG);
- CleanupStack::PushL(response);
- TInt Return = iHttp->ReportL(*iUrl, body->Ptr(0), response);
-
- if (Return == MULTISTATUS)
- {
- TInt parsereturn = ParseResponsesL(response->Ptr(0), ETrue);
- // if it failed before, we do not want to override this error
- ret = (ret == KErrNone) ? parsereturn : ret;
- }
- else
- ret = KErrGeneral;
- CleanupStack::PopAndDestroy(response);
- CleanupStack::PopAndDestroy(body);
-
- }
- return ret;
- }
-
-/**
- * CCalDavEngine::DownloadEntryL
- * download entry from server
- */
-TInt CCalDavEngine::DownloadEntryL(const TDesC8 &aUrl)
- {
- TBuf8<URLMAX> url;
- url.Append(*iUrl);
- url.Append(GetUIDByUrl(aUrl));
- url.Append(KIcs);
-
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- TInt ret = iHttp->GetL(url, response);
- if (ret == OK)
- ret = StoreEntryL(response->Ptr(0), iHttp->ETag());
- else
- ret = KErrGeneral;
- CleanupStack::PopAndDestroy(response);
- return ret;
- }
-
-/**
- * CCalDavEngine::DeleteLocalEntryL
- * delete an event from local store
- */
-TInt CCalDavEngine::DeleteLocalEntryL(const TDesC8 &aUID)
- {
- CDesC8ArrayFlat * Array = new (ELeave) CDesC8ArrayFlat(ARRAYEXPAND);
- CleanupStack::PushL(Array);
- Array->AppendL(GetUIDByUrl(aUID));
- // we could have delete it ourselves, so it is already gone
- TRAPD(error, iCalEntryView->DeleteL(*Array));
- Array->Reset();
- CleanupStack::PopAndDestroy(Array);
- return error;
- }
-
-/**
- * CCalDavEngine::DeleteRemovedEntriesOnServerL
- * check for removed entries on server
- */
-TInt CCalDavEngine::DeleteRemovedEntriesOnServerL()
- {
- if (iOptions.calendar_access)
- {
- TTime syncstart;
- syncstart.HomeTime();
- syncstart = syncstart - iPastDays;
- TBuf<100> nowStr;
- syncstart.FormatL(nowStr, KFormatString);
- TBuf8<100> nowStrAdd;
- nowStrAdd.Append(nowStr);
-
- TInt eventreturn = KErrNone;
- if (iOptions.VEVENT)
- eventreturn = TimeReportL(ETrue, nowStrAdd, ETrue);
-
- TInt todoreturn = KErrNone;
- if (iOptions.VTODO)
- todoreturn = TimeReportL(EFalse, nowStrAdd, ETrue);
-
- return (eventreturn == KErrNone) && (todoreturn == KErrNone) ? KErrNone
- : KErrGeneral;
- }
- else
- {
- // use PROPFIND report
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- TInt ret = iHttp->PropfindL(*iUrl, KPropList, response, EFalse);
- if (ret == MULTISTATUS)
- ret = ParseResponsesDeleteL(response->Ptr(0));
- else
- ret = KErrGeneral;
- CleanupStack::PopAndDestroy(response);
- return ret;
- }
-
- }
-
-/**
- * CCalDavEngine::UploadModifiedSinceDateL
- * check for any modified data after last sync time
- */
-TBool CCalDavEngine::UploadModifiedSinceDateL()
- {
- TBool manualsync = EFalse;
- // upload modified and newly create ones
- RArray<TCalLocalUid> *Ids = new (ELeave) RArray<TCalLocalUid> (ARRAYEXPAND);
- iCalEntryView->GetIdsModifiedSinceDateL(iLastSyncTime, *Ids);
- for (TInt i = 0; i < Ids->Count(); i++)
- {
- TCalLocalUid id = (*Ids)[i];
- TInt ret = UploadEntryL(id, MCalChangeCallBack2::EChangeUndefined,
- MCalChangeCallBack2::EChangeEntryAll);
- // TOOD: if it fails during upload, ignore
- // if it fails due to internet connection, try again
- if (ret != KErrNone)
- manualsync = ETrue;
- }
- Ids->Reset();
- delete Ids;
- return manualsync;
- }
-
-/**
- * CCalDavEngine::ClientChangesL
- * check for left over local client changes
- */
-TBool CCalDavEngine::ClientChangesL()
- {
- if (iCalEntryView && iManualSync)
- {
- iManualSync = EFalse;
-
- // upload modified and newly create ones
- iManualSync = UploadModifiedSinceDateL();
-
- // delete locally deleted entries on server
- for (TInt i = iDeletedEntries.Count() - 1; i >= 0; --i)
- {
- TInt ret = DeleteEntryL(iDeletedEntries[i]);
- if (ret == KErrNone)
- iDeletedEntries.Remove(i);
-
- }
-
- iManualSync = iDeletedEntries.Count() ? ETrue : EFalse;
-
- TPckgC<TBool> manualSync(iManualSync);
- SetCalendarInfoL(KCaldavManualSync, manualSync);
- }
-
- return ETrue;
- }
-
-/**
- * CCalDavEngine::MkcalendarL
- * create a new calendar on the server
- */
-TInt CCalDavEngine::MkcalendarL(const TDesC8 &aName)
- {
- if (iOptions.MKCALENDAR)
- {
- TBuf8<URLMAX> url;
- url.Append(*iHome);
- url.Append(aName);
- url.Append(KSlash);
-
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
-
- // TOOD: initialize with name, body etc.
- TInt ret = iHttp->MkCalendarL(url, KNullDesC8, response);
-
- if ((ret == CREATED) || (ret == OK))
- ret = KErrNone;
- else if ((ret == NOTALLOWED) || (ret == FORBIDDEN))
- ret = KErrArgument;
- else
- ret = KErrGeneral;
- CleanupStack::PopAndDestroy(response);
- return ret;
- }
- else
- return KErrNotSupported;
- }
-
-/**
- * CCalDavEngine::DeleteCalendarL
- * delete a calendar on the server
- */
-TInt CCalDavEngine::DeleteCalendarL(const TDesC8 &aName)
- {
- if (iOptions.MKCALENDAR)
- {
- TBuf8<URLMAX> url;
- url.Append(*iHome);
- url.Append(aName);
- url.Append(KSlash);
-
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- TInt ret = iHttp->DeleteL(url);
- if ((ret == NOCONTENT) || (ret == OK))
- ret = KErrNone;
- else
- ret = KErrGeneral;
- CleanupStack::PopAndDestroy(response);
- return ret;
- }
- else
- return KErrNotSupported;
- }
-
-/**
- * CCalDavEngine::HeadL
- * check for existence of an entry on server
- */
-TInt CCalDavEngine::HeadL(const TDesC8 &aUID)
- {
- // special handing for yahoo neccessary
- // after deleting an event, it is still there and findable with HEAD
- _LIT8(KYahoo,"yahoo");
- _LIT8(KTrash,"trash");
-
- TBuf8<URLMAX> url;
- url.Append(*iUrl);
- url.Append(aUID);
- url.Append(KIcs);
- if (iUrl->Find(KYahoo) == KErrNotFound)
- {
- TInt head = iHttp->HeadL(url);
- return (head == NOCONTENT) || (head == OK) ? OK : head;
- }
- else
- {
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- TInt ret = iHttp->PropfindL(url, KNullDesC8, response);
-
- if (ret == MULTISTATUS)
- {
- RXmlEngDocument document = iDomParser.ParseL(response->Ptr(0));
- CleanupClosePushL(document);
- if (document.NotNull())
- {
- HBufC8* href = SearchL(document, KHref, KNullDesC8).AllocL();
- href->Des().LowerCase();
- ret = href->Find(KTrash) == KErrNotFound ? OK : NOTFOUND;
- delete href;
- }
- CleanupStack::PopAndDestroy(&document);
- CleanupStack::PopAndDestroy(response);
- return ret;
- }
- else
- {
- CleanupStack::PopAndDestroy(response);
- return NOTFOUND;
- }
- }
- }
-
-/**
- * CCalDavEngine::DeleteEntryL
- * delete entry on server
- */
-TInt CCalDavEngine::DeleteEntryL(const TDesC8 &aUid)
- {
- TBuf8<URLMAX> url;
- url.Append(*iBaseUrl);
- url.Append(aUid);
- return iHttp->DeleteL(url);
- }
-
-/**
- * CCalDavEngine::DeleteEntryL
- * delete entry on server
- */
-TInt CCalDavEngine::DeleteEntryL(const TCalLocalUid &aUid)
- {
- TInt Ret = KErrNone;
- // find the filename for a given local UID
- TInt aPos = iLocalUidArray.Find(aUid);
- if (aPos != KErrNotFound)
- {
- TBuf8<URLMAX> url;
- url.Append(*iUrl);
- url.Append(iGlobalUidArray[aPos]);
- url.Append(KIcs);
-
-#ifdef ETAG
- CCalEntry* entry = iCalEntryView->FetchL(aUid);
- CleanupStack::PushL(entry);
- TInt Return = entry ? iHttp->DeleteL(url, entry->ETag())
- : iHttp->DeleteL(url);
- CleanupStack::PopAndDestroy(entry);
-#else
- TInt Return = iHttp->DeleteL(url);
-#endif
-
- if ((Return == NOCONTENT) || (Return == OK))
- {
- SetLastSyncTimeL();
- }
- else if (Return == PRECONDFAILED)
- {
- // someone modified this in the meantime
- // ask user if he wants the new event or still delete it
- TBool modify = EFalse;
- if (modify)
- DownloadEntryL(url);
- else
- iHttp->DeleteL(url);
- }
- else if (Return == NOTFOUND)
- {
- // someone deleted this already
- Ret = KErrGeneral;
- }
- else if (Return == FORBIDDEN)
- {
- // event read-only
- Ret = KErrGeneral;
- }
- else
- {
- Ret = KErrGeneral;
- SyncFailedL();
- TInt pos = iDeletedEntries.Find(aUid);
- if (pos == KErrNotFound)
- iDeletedEntries.Append(aUid);
- }
- }
- else
- Ret = KErrGeneral;
- return Ret;
- }
-
-/**
- * CCalDavEngine::UploadEntryL
- * upload entry to server
- */
-TInt CCalDavEngine::UploadEntryL(CCalEntry* aEntry,
- MCalChangeCallBack2::TChangeType aChangeType,
- MCalChangeCallBack2::TChangeEntryType aEntryType)
- {
- if (aEntry)
- {
- TInt ret = KErrNone;
- TBool upload = EFalse;
- switch (aEntryType)
- {
- case MCalChangeCallBack2::EChangeEntryEvent:
- case MCalChangeCallBack2::EChangeEntryTodo:
- {
- upload = aEntry && ((MCalChangeCallBack2::EChangeEntryEvent
- && iOptions.VEVENT)
- || (MCalChangeCallBack2::EChangeEntryTodo
- && iOptions.VTODO));
- break;
- }
- case MCalChangeCallBack2::EChangeEntryAll:
- {
- if (aEntry)
- {
- switch (aEntry->EntryTypeL())
- {
- case CCalEntry::EAppt:
- case CCalEntry::EAnniv:
- case CCalEntry::EEvent:
- case CCalEntry::EReminder:
- {
- upload = iOptions.VEVENT;
- break;
- }
- case CCalEntry::ETodo:
- {
- upload = iOptions.VTODO;
- break;
- }
- }
- }
-
- }
- }
- if (upload)
- {
- CBufFlat* BufFlat = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(BufFlat);
- RBufWriteStream writeStream(*BufFlat);
- CleanupClosePushL(writeStream);
- iCalExporter->ExportICalL(*aEntry, writeStream);
- writeStream.CommitL();
- CleanupStack::PopAndDestroy(&writeStream);
-
- HBufC8* buffer = BufFlat->Ptr(0).AllocL();
- CleanupStack::PopAndDestroy(BufFlat);
- CleanupStack::PushL(buffer);
- TPtr8 ptr = buffer->Des();
- CalDavUtils::FixExportIssues(ptr);
-
-#ifdef _DEBUG
- ExportToFileL(aEntry, iCalExporter);
- _LIT(KFileName, "C:\\logs\\caldav\\testing_export_fixed.txt");
- ExportToFileNameL(ptr, KFileName);
-#endif
-
- TBuf8<URLMAX> url;
- url.Append(*iUrl);
- url.Append(aEntry->UidL());
- url.Append(KIcs);
-
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
-
-#ifdef ETAG
- TPtrC8 etag = aEntry->GetETag();
- TBool newentry = (aChangeType == MCalChangeCallBack2::EChangeAdd)
- || ((aChangeType == MCalChangeCallBack2::EChangeUndefined)
- && (etag == KNullDesC8));
- TInt Ret = newentry ? iHttp->PutL(url, *buffer, response)
- : iHttp->PutL(url, *buffer, response, etag);
-#else
- TBool newentry = (aChangeType == MCalChangeCallBack2::EChangeAdd)
- || (aChangeType == MCalChangeCallBack2::EChangeUndefined);
- TInt Ret = newentry ? iHttp->PutL(url, *buffer, response)
- : iHttp->PutL(url, *buffer, response, _L8("ETAG"));
-#endif
- if ((Ret == CREATED) || (Ret == NOCONTENT) || (Ret == OK))
- {
- if (newentry)
- {
- iLocalUidArray.Append(aEntry->LocalUidL());
- iGlobalUidArray.Append(aEntry->UidL());
- }
-#ifdef ETAG
- aEntry->SetETag(iHttp->ETag());
-#endif
- SetLastSyncTimeL();
- }
- else if (Ret == PRECONDFAILED)
- {
- if (newentry)// same filename already exists, use a different one and upload again
- {
- TBuf8<URLMAX> nextUrl;
- nextUrl.Append(*iUrl);
- nextUrl.Append(aEntry->UidL());
- TTime time;
- time.HomeTime();
- _LIT(KTimeFormat,"%H%T%S");
- TBuf<20> StringTime;
- time.FormatL(StringTime, KTimeFormat);
- nextUrl.Append(StringTime);
- nextUrl.Append(_L8(".ics"));
- response->Reset();
- TInt Ret = iHttp->PutL(nextUrl, *buffer, response);
- if ((Ret == CREATED) || (Ret == OK))
- {
- iLocalUidArray.Append(aEntry->LocalUidL());
- iGlobalUidArray.Append(aEntry->UidL());
-#ifdef ETAG
- aEntry->SetETag(iHttp->ETag());
-#endif
- SetLastSyncTimeL();
- }
- else
- {
- SyncFailedL();
- ret = KErrAbort;
- }
- }
- else
- {
- if (!iKeepServerEntry)
- {
- response->Reset();
- // upload again without ETAG to overwrite server entry
- TInt Ret = iHttp->PutL(url, *buffer, response);
- if ((Ret == CREATED) || (Ret == OK))
- {
-#ifdef ETAG
- aEntry->SetETag(iHttp->ETag());
-#endif
- SetLastSyncTimeL();
- }
- else
- {
- SyncFailedL();
- ret = KErrAbort;
- }
- }
- else
- {
- // download the server event and update local store
- ret = DownloadEntryL(url);
- if (ret == KErrNone)
- SetLastSyncTimeL();
- else
- {
- SyncFailedL();
- ret = KErrAbort;
- }
- }
- }
- }
- else
- {
- SyncFailedL();
- ret = KErrAbort;
- }
- CleanupStack::PopAndDestroy(response);
- CleanupStack::PopAndDestroy(buffer);
- }
- return ret;
- }
- return KErrArgument;
- }
-
-/**
- * CCalDavEngine::UploadEntryL
- * upload entry to server
- */
-TInt CCalDavEngine::UploadEntryL(const TCalLocalUid &aUid,
- MCalChangeCallBack2::TChangeType aChangeType,
- MCalChangeCallBack2::TChangeEntryType aEntryType)
- {
- CCalEntry * aEntry = iCalEntryView->FetchL(aUid);
- CleanupStack::PushL(aEntry);
- TInt ret = UploadEntryL(aEntry, aChangeType, aEntryType);
- CleanupStack::PopAndDestroy(aEntry);
- return ret;
- }
-
-/**
- * CCalDavEngine::GetSyncTokenL
- * get latest Webdav Sync token
- */
-HBufC8* CCalDavEngine::GetSyncTokenL()
- {
- HBufC8 *aBuf = HBufC8::NewL(KSync().Length());
- aBuf->Des().Format(KSync, &KNullDesC8());
- CleanupStack::PushL(aBuf);
-
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- TInt RetServer = iHttp->ReportL(*iUrl, *aBuf, response);
-
- if (RetServer)
- {
- RXmlEngDocument document = iDomParser.ParseL(response->Ptr(0));
- CleanupClosePushL(document);
- if (document.NotNull())
- {
- HBufC8* ret = SearchL(document, KSynctoken, KNullDesC8).AllocL();
- CleanupStack::PopAndDestroy(&document);
- CleanupStack::PopAndDestroy(response);
- CleanupStack::PopAndDestroy(aBuf);
- return ret;
- }
- CleanupStack::PopAndDestroy(&document);
- }
- CleanupStack::PopAndDestroy(response);
- CleanupStack::PopAndDestroy(aBuf);
- return KNullDesC8().AllocL();
- }
-
-/**
- * CCalDavEngine::CheckCalendarInfoL
- * check for new calendar displayname and color
- */
-void CCalDavEngine::CheckCalendarInfoL(RXmlEngDocument &aDocument)
- {
- TBool change = EFalse;
- CCalCalendarInfo* info = iCalSession->CalendarInfoL();
- CleanupStack::PushL(info);
-
- HBufC8* color = SearchL(aDocument, KCalendar_Color, KNullDesC8).AllocLC();
- if ((*color != KNullDesC8) && (color->Length() > 6))
- {
- TLex8 lexred(color->Des().Mid(1, 2));
- TInt red;
- lexred.Val(red);
- TLex8 lexgreen(color->Des().Mid(3, 2));
- TInt green;
- lexgreen.Val(green);
- TLex8 lexblue(color->Des().Mid(5, 2));
- TInt blue;
- lexblue.Val(blue);
- TRgb newcolor(red, green, blue);
- if (info->Color() != newcolor)
- {
- info->SetColor(newcolor);
- change = ETrue;
- }
- }
- CleanupStack::PopAndDestroy(color);
-
- HBufC8* displayname =
- SearchL(aDocument, KDisplayname, KNullDesC8).AllocLC();
- if (*displayname != KNullDesC8)
- {
- HBufC16* name =
- CnvUtfConverter::ConvertToUnicodeFromUtf8L(*displayname);
- CleanupStack::PushL(name);
- if (info->NameL() != *name)
- {
- info->SetNameL(*name);
- change = ETrue;
- }
- CleanupStack::PopAndDestroy(name);
- change = ETrue;
- }
- CleanupStack::PopAndDestroy(displayname);
-
- if (change)
- iCalSession->SetCalendarInfoL(*info);
- CleanupStack::PopAndDestroy(info);
-
- }
-
-/**
- * CCalDavEngine::GetCTagL
- * get latest CTag
- * https://trac.calendarserver.org/browser/CalendarServer/trunk/doc/Extensions/caldav-ctag.txt
- */
-HBufC8* CCalDavEngine::GetCTagL()
- {
- if (iHttp)
- {
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- TInt ret = iHttp->PropfindL(*iUrl, KCtag, response);
-
- if (ret == MULTISTATUS)
- {
- RXmlEngDocument document = iDomParser.ParseL(response->Ptr(0));
- CleanupClosePushL(document);
- if (document.NotNull())
- {
- HBufC8* status =
- SearchL(document, KStatus, KNullDesC8).AllocLC();
- HBufC8* ctag =
- SearchL(document, KGetctag, KNullDesC8).AllocLC();
- status->Des().LowerCase();
- if ((*ctag != KNullDesC8) && (*status == KHTTP200))
- {
- CleanupStack::Pop(ctag);
- CleanupStack::PopAndDestroy(status);
- CleanupStack::PopAndDestroy(&document);
- CleanupStack::PopAndDestroy(response);
- return ctag;
- }
- else
- CleanupStack::PopAndDestroy(ctag);
- CleanupStack::PopAndDestroy(status);
- }
- CleanupStack::PopAndDestroy(&document);
-
- }
- CleanupStack::PopAndDestroy(response);
- }
- return KNullDesC8().AllocL();
- }
-
-/**
- * CCalDavEngine::GetOptionsL
- * get OPTIONS from server
- */
-TBool CCalDavEngine::GetOptionsL()
- {
- if (iHttp)
- {
- // check DAV and allow headers
- iHttp->GetServerOptionsL(*iUrl, iOptions);
-
- // check ctag extension
- HBufC8* ctag = GetCTagL();
- if (*ctag != KNullDesC8)
- iOptions.sync_ctag = true;
- delete ctag;
-
- // check supported elements
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- TInt Ret = iHttp->PropfindL(*iUrl, KSupportedSet, response);
-
- if (Ret == MULTISTATUS)
- {
- RXmlEngDocument document = iDomParser.ParseL(response->Ptr(0));
- CleanupClosePushL(document);
- if (document.NotNull())
- {
- CheckCalendarInfoL(document);
-
- //<C:supported-calendar-component-set/>
- TXmlEngElement supportedelement;
- SearchL(document, KSupportedCalendarComponentSet, KNullDesC8,
- supportedelement);
- if (supportedelement.NotNull())
- {
- RXmlEngNodeList<TXmlEngElement> supportedelements;
- CleanupClosePushL(supportedelements);
- supportedelement.GetChildElements(supportedelements);
- while (supportedelements.HasNext())
- {
- TXmlEngElement element = supportedelements.Next();
- TPtrC8 value = element.AttributeValueL(KName);
- if (value == KNullDesC8)
- value.Set(element.AttributeValueL(KName, KCalDav));
- if (value == KVEVENT)
- iOptions.VEVENT = ETrue;
- else if (value == KVTODO)
- iOptions.VTODO = ETrue;
- else if (value == KVFREBUSY)
- iOptions.VFREEBUSY = ETrue;
- else if (value == KVJOURNAL)
- iOptions.VJOURNAL = ETrue;
- }
- CleanupStack::PopAndDestroy(&supportedelements);
- }
- }
- CleanupStack::PopAndDestroy(&document);
- }
- CleanupStack::PopAndDestroy(response);
- }
- return ETrue;
- }
-
-/**
- * CCalDavEngine::SetSyncTokenL
- * set sync token
- */
-void CCalDavEngine::SetSyncTokenL(HBufC8* aToken)
- {
- if (iSynctoken)
- {
- delete iSynctoken;
- iSynctoken = NULL;
- }
- iSynctoken = aToken;
- SetCalendarInfoL(KCaldavSynctoken, *iSynctoken);
- }
-
-/**
- * CCalDavEngine::SyncToken
- * get synctoken
- */
-TPtrC8 CCalDavEngine::SyncToken()
- {
- return iSynctoken ? *iSynctoken : KNullDesC8();
- }
-
-/**
- * CCalDavEngine::SetCTagL
- * set ctag
- */
-void CCalDavEngine::SetCTagL(HBufC8* aToken)
- {
- if (iCTag)
- {
- delete iCTag;
- iCTag = NULL;
- }
- iCTag = aToken;
- SetCalendarInfoL(KCaldavCtag, *iCTag);
- }
-
-/**
- * CCalDavEngine::CTag
- * get ctag
- */
-TPtrC8 CCalDavEngine::CTag()
- {
- return iCTag ? *iCTag : KNullDesC8();
- }
-
-/**
- * CCalDavEngine::SetLastSyncTimeL
- * set last sync time
- */
-void CCalDavEngine::SetLastSyncTimeL()
- {
- // only set a new last sync time, if we did not have a failed one before
- // otherwise, the old one would be lost
- if (!iManualSync)
- {
- TTime time;
- time.UniversalTime();
- iLastSyncTime.SetTimeUtcL(time);
- TPckgC<TCalTime> lasttime(iLastSyncTime);
- SetCalendarInfoL(KCaldavTime, lasttime);
- }
- }
-
-/**
- * CCalDavEngine::SyncFailedL
- * sync failed, enable manual sync
- */
-void CCalDavEngine::SyncFailedL()
- {
- if (!iManualSync)
- {
- iManualSync = ETrue;
- TPckgC<TBool> manualSync(iManualSync);
- SetCalendarInfoL(KCaldavManualSync, manualSync);
- }
- }
-
-/**
- * CCalDavEngine::GetBaseUrl
- * get base domain url
- */
-void CCalDavEngine::GetBaseUrl(const TDesC8 &aUrl)
- {
- _LIT8(http,"http://");
- _LIT8(https,"https://");
-
- if (iBaseUrl)
- {
- delete iBaseUrl;
- iBaseUrl = NULL;
- }
-
- if (aUrl.Length() > http().Length())
- {
- TInt length = aUrl.Find(https) != KErrNotFound ? https().Length()
- : http().Length();
- TInt pos = aUrl.Mid(length).Locate('/');
- iBaseUrl = aUrl.Left(pos + length).Alloc();
- }
- }
-
-/**
- * CCalDavEngine::FindUrlsL
- * find home, inbox and outbox property
- */
-void CCalDavEngine::FindUrlsL(const TDesC8 &aDes, HBufC8 *&home,
- HBufC8 *&inbox, HBufC8 *&outbox)
- {
- RXmlEngDocument document = iDomParser.ParseL(aDes);
- CleanupClosePushL(document);
- if (document.NotNull())
- {
- HBufC8* status = SearchL(document, KStatus, KNullDesC8).AllocLC();
- status->Des().LowerCase();
- if (*status == KHTTP200)
- {
- TXmlEngElement calendarhome, inboxhome, outboxhome;
-
- SearchL(document, KCalendarHomeSet, KNullDesC8, calendarhome);
- if (calendarhome.NotNull())
- {
- TPtrC8 homeend = SearchL(calendarhome, KHref, KNullDesC8);
- home = HBufC8::NewL(iBaseUrl->Length() + homeend.Length());
- home->Des().Append(*iBaseUrl);
- home->Des().Append(homeend);
- }
-
- SearchL(document, KInbox, KNullDesC8, inboxhome);
- if (inboxhome.NotNull())
- {
- TPtrC8 inboxend = SearchL(inboxhome, KHref, KNullDesC8);
- inbox = HBufC8::NewL(iBaseUrl->Length() + inboxend.Length());
- inbox->Des().Append(*iBaseUrl);
- inbox->Des().Append(inboxend);
- }
-
- SearchL(document, KOutbox, KNullDesC8, outboxhome);
- if (outboxhome.NotNull())
- {
- TPtrC8 outboxend = SearchL(outboxhome, KHref, KNullDesC8);
- outbox = HBufC8::NewL(iBaseUrl->Length() + outboxend.Length());
- outbox->Des().Append(*iBaseUrl);
- outbox->Des().Append(outboxend);
- }
- }
- CleanupStack::PopAndDestroy(status);
- }
- CleanupStack::PopAndDestroy(&document);
- }
-
-/**
- * CCalDavEngine::FindCalendarCollectionL
- * find all calendar collections under home url
- */
-HBufC8* CCalDavEngine::FindCalendarCollectionL(const TDesC8 &aUrl,
- CDesC8ArrayFlat *aArray)
- {
- HBufC8* homecalendar = 0;
-
- // do propfind depth:1 and find all calendar collections
- // right now, take the first one as default
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- TInt retcode = iHttp->PropfindL(aUrl, KCalendarurl, response, EFalse);
- if (retcode == MULTISTATUS)
- {
- RXmlEngDocument document = iDomParser.ParseL(response->Ptr(0));
- CleanupClosePushL(document);
- if (document.NotNull() && document.DocumentElement().NotNull())
- {
- RXmlEngNodeList<TXmlEngElement> ResponseList;
- CleanupClosePushL(ResponseList);
- document.DocumentElement().GetElementsByTagNameL(ResponseList,
- KResponse, KDav);
- TBool FirstOneDone = EFalse;
- while (ResponseList.HasNext())
- {
- TXmlEngElement node = ResponseList.Next();
- TPtrC8 href = SearchL(node, KHref, KNullDesC8);
- TPtrC8 status = SearchL(node, KStatus, KNullDesC8);
-
- TXmlEngElement calendar;
- TXmlEngElement vevent_collection;
- TXmlEngElement vtodo_collection;
- SearchL(node, KCalendar, KNullDesC8, calendar);
- SearchL(node, KVEventCollection, KNullDesC8, vevent_collection);
- SearchL(node, KVTodoCollection, KNullDesC8, vtodo_collection);
-
- if (calendar.NotNull() || vevent_collection.NotNull()
- || vtodo_collection.NotNull())
- {
- if (!FirstOneDone)
- {
- homecalendar = HBufC8::NewL(iBaseUrl->Length()
- + href.Length());
- homecalendar->Des().Append(*iBaseUrl);
- homecalendar->Des().Append(href);
-
- iOptions.VEVENT = vevent_collection.NotNull();
- iOptions.VTODO = vtodo_collection.NotNull();
-
- FirstOneDone = ETrue;
- }
-
- if (aArray)
- {
- TBuf8<URLMAX> url;
- url.Append(*iBaseUrl);
- url.Append(href);
- aArray->AppendL(url);
- }
- }
- }
- CleanupStack::PopAndDestroy(&ResponseList);
- }
- CleanupStack::PopAndDestroy(&document);
- }
- CleanupStack::PopAndDestroy(response);
- return homecalendar;
- }
-
-/**
- * CCalDavEngine::GetCalendarUrlsL
- * find calendar url based on any url
- * could be principal url, home or direct calendar url
- */
-TInt CCalDavEngine::GetCalendarUrlsL(CDesC8ArrayFlat *aArray)
- {
- if (iHttp && iUrl)
- {
- HBufC8 *principal = 0;
- HBufC8 *home = 0;
- HBufC8 *homecalendar = 0;
- HBufC8 *inbox = 0;
- HBufC8 *outbox = 0;
-
- GetBaseUrl(*iUrl);
-
- // TODO: does this really find groupdav collection?
-
- // find out if this is a caldav or groupdav calendar collection
- CBufFlat* response = CBufFlat::NewL(EXPANDSIZE_SMALL);
- CleanupStack::PushL(response);
- TInt retcode = iHttp->PropfindL(*iUrl, KCalendarurl, response);
- if (retcode == MULTISTATUS)
- {
- RXmlEngDocument document = iDomParser.ParseL(response->Ptr(0));
- CleanupClosePushL(document);
- if (document.NotNull())
- {
- HBufC8* status =
- SearchL(document, KStatus, KNullDesC8).AllocLC();
- status->Des().LowerCase();
- TXmlEngElement calendar;
- SearchL(document, KCalendar, KNullDesC8, calendar);
- // it should be <owner><href>value</href></owner>
- // but oracle beehive server does <owner>value</owner>
- TXmlEngElement owner;
- SearchL(document, KOwner, KNullDesC8, owner);
- TPtrC8 ownerref1 = SearchL(owner, KHref, KNullDesC8);
- TPtrC8 ownerref2 = owner.Value();
- TPtrC8 ownerref;
- ownerref.Set(ownerref1 != KNullDesC8 ? ownerref1 : ownerref2);
-
- if (calendar.NotNull() && (ownerref != KNullDesC8) && (*status
- == KHTTP200))
- {
- // this is a calendar collection and we know the principal as well now
- homecalendar = iUrl->AllocL();
- _LIT8(KHTTP,"http");
- HBufC8* http = ownerref.Left(KHTTP().Length()).AllocLC();
- if (*http == KHTTP)
- {
- // sogo server does not return relative, but principal url
- principal = ownerref.AllocL();
- }
- else
- {
- principal = HBufC8::NewL(iBaseUrl->Length()
- + ownerref.Length());
- principal->Des().Append(*iBaseUrl);
- principal->Des().Append(ownerref);
- }
- CleanupStack::PopAndDestroy(http);
- }
- CleanupStack::PopAndDestroy(status);
- }
- CleanupStack::PopAndDestroy(&document);
- }
-
- // if we have principal, ask for home, otherwise see if principal was given in the first place
- if (principal)
- {
- response->Reset();
- TInt retcode =
- iHttp->PropfindL(*principal, KPrincipalurl, response);
- if (retcode == MULTISTATUS)
- {
- FindUrlsL(response->Ptr(0), home, inbox, outbox);
- }
- }
- else
- {
- response->Reset();
- TInt retcode = iHttp->PropfindL(*iUrl, KPrincipalurl, response);
- if (retcode == MULTISTATUS)
- {
- FindUrlsL(response->Ptr(0), home, inbox, outbox);
- }
- }
-
- home = CalDavUtils::EnsureSlashL(home);
- inbox = CalDavUtils::EnsureSlashL(inbox);
- outbox = CalDavUtils::EnsureSlashL(outbox);
-
- // find out all calendar collections under home
- if (home)
- {
- // TODO: temporary? we already have homecalendar...
- if (!homecalendar)
- {
- homecalendar = FindCalendarCollectionL(*home, aArray);
- }
- }
- else
- {
- // have not found out home nor a groupdav collection, maybe we are home ourselves
- homecalendar = FindCalendarCollectionL(*iUrl, aArray);
- if (homecalendar)
- home = iUrl->AllocL();
- }
-
- CleanupStack::PopAndDestroy(response);
- delete principal;
- delete inbox;
- delete outbox;
-
- if (home)
- iHome = CalDavUtils::EnsureSlashL(home);
- if (homecalendar)
- {
- delete iUrl;
- iUrl = NULL;
- iUrl = CalDavUtils::EnsureSlashL(homecalendar);
- return KErrNone;
- }
- else
- return KErrArgument;
- }
- return KErrArgument;
- }
-
-/**
- * CCalDavEngine::CalendarName
- * get calendar name
- */
-TPtrC CCalDavEngine::CalendarName() const
- {
- return iCalendar ? *iCalendar : KNullDesC();
- }
-
-/**
- * CCalDavEngine::Home
- * get home
- */
-TPtrC8 CCalDavEngine::Home() const
- {
- return iHome ? *iHome : KNullDesC8();
- }
-
-/**
- * CCalDavEngine::Url
- * get url
- */
-TPtrC8 CCalDavEngine::Url() const
- {
- return iUrl ? *iUrl : KNullDesC8();
- }
-
-/**
- * CCalDavEngine::SetUrlL
- * set url
- */
-void CCalDavEngine::SetUrlL(const TDesC8 &aUrl)
- {
- if (iUrl ? *iUrl != aUrl : ETrue)
- {
- DisableL();
-
- if (iUrl)
- {
- delete iUrl;
- iUrl = NULL;
- }
-
- iUrl = CalDavUtils::EnsureSlashL(aUrl);
- SetCalendarInfoL(KCaldavUrl, *iUrl);
- }
- }
-
-/**
- * CCalDavEngine::User
- * get user
- */
-TPtrC8 CCalDavEngine::User() const
- {
- return iHttp->User();
- }
-
-/**
- * CCalDavEngine::SetUserL
- * set user
- */
-void CCalDavEngine::SetUserL(const TDesC8 &aUser)
- {
- if (iHttp->User() != aUser)
- {
- DisableL();
- SetCalendarInfoL(KCaldavUser, aUser);
- iHttp->SetUserL(aUser);
- }
- }
-
-/**
- * CCalDavEngine::Password
- * get password
- */
-TPtrC8 CCalDavEngine::Password() const
- {
- return iHttp->Password();
- }
-
-/**
- * CCalDavEngine::SetPasswordL
- * set password
- */
-void CCalDavEngine::SetPasswordL(const TDesC8 &aPassword)
- {
- if (iHttp->Password() != aPassword)
- {
- DisableL();
- iHttp->SetPasswordL(aPassword);
- SetCalendarInfoL(KCaldavPassword, aPassword);
- }
- }
-
-/**
- * CCalDavEngine::SyncInterval
- * get SyncInterval
- */
-TTimeIntervalMinutes CCalDavEngine::SyncInterval() const
- {
- return iSyncInterval;
- }
-
-/**
- * CCalDavEngine::SetSyncIntervalL
- * set SetSyncIntervalL
- */
-void CCalDavEngine::SetSyncIntervalL(TTimeIntervalMinutes aSyncInterval)
- {
- iSyncInterval = aSyncInterval;
- TPckgC<TTimeIntervalMinutes> minutes(iSyncInterval);
- SetCalendarInfoL(KCaldavSyncInterval, minutes);
- }
-
-/**
- * CCalDavEngine::PastDays
- * get past days
- */
-TTimeIntervalDays CCalDavEngine::PastDays() const
- {
- return iPastDays;
- }
-
-/**
- * CCalDavEngine::SetPastDaysL
- * Set PastDaysL
- */
-void CCalDavEngine::SetPastDaysL(TTimeIntervalDays aDays)
- {
- iPastDays = aDays;
- TPckgC<TTimeIntervalDays> days(iPastDays);
- SetCalendarInfoL(KCaldavPastDays, days);
- }
-
-/**
- * CCalDavEngine::ImmediateSync
- * get ImmediateSyncL
- */
-TBool CCalDavEngine::ImmediateSync() const
- {
- return iImmediateSync;
- }
-
-/**
- * CCalDavEngine::SetImmediateSyncL
- * Set ImmediateSyncL
- */
-void CCalDavEngine::SetImmediateSyncL(TBool aImmediateSyc)
- {
- iImmediateSync = aImmediateSyc;
- TPckgC<TBool> immediatesync(iImmediateSync);
- SetCalendarInfoL(KCaldavImmediateSync, immediatesync);
- }
-
-/**
- * CCalDavEngine::KeepServerEntry
- * get KeepServerEntryL
- */
-TBool CCalDavEngine::KeepServerEntry() const
- {
- return iKeepServerEntry;
- }
-
-/**
- * CCalDavEngine::SetKeepServerEntryL
- * Set KeepServerEntryL
- */
-void CCalDavEngine::SetKeepServerEntryL(TBool aKeepServerEntry)
- {
- iKeepServerEntry = aKeepServerEntry;
- TPckgC<TBool> keepserver(iKeepServerEntry);
- SetCalendarInfoL(KCaldavKeepServer, keepserver);
- }
-
-/**
- * CCalDavEngine::Timer
- * get timer
- */
-CPeriodic* CCalDavEngine::Timer()
- {
- return iTimer;
- }
--- a/calendarengines/caldav/src/caldavenginemgr.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,372 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: provides a manager to keep track of all available engines
-*
-*/
-
-#include "caldavenginemgr.h"
-#include "caldavengine.h"
-
-#include <calsession.h>
-#include <calcalendarinfo.h>
-#include "calenglobaldata.h"
-
-/**
- * CCalDavEngineMgr::CCalDavEngineMgr()
- * default constructor
- */
-CCalDavEngineMgr::CCalDavEngineMgr()
- {
- }
-
-/**
- * CCalDavEngineMgr::~CCalDavEngineMgr()
- * default destructor
- */
-CCalDavEngineMgr::~CCalDavEngineMgr()
- {
- for (TInt i = iEngines.Count() - 1; i >= 0; --i)
- delete iEngines[i];
- iEngines.Close();
- }
-
-/**
- * CCalDavEngineMgr::NewLC()
- * first phase construction
- */
-CCalDavEngineMgr* CCalDavEngineMgr::NewLC()
- {
- CCalDavEngineMgr* self = new (ELeave) CCalDavEngineMgr();
- CleanupStack::PushL(self);
- self->ConstructL();
- return self;
- }
-
-/**
- * CCalDavEngineMgr::NewL()
- * first phase construction
- */
-CCalDavEngineMgr* CCalDavEngineMgr::NewL()
- {
- CCalDavEngineMgr* self = CCalDavEngineMgr::NewLC();
- CleanupStack::Pop(); // self;
- return self;
- }
-
-/**
- * CCalDavEngineMgr::Progress()
- * progress callback
- */
-void CCalDavEngineMgr::Progress(TInt /*aPercentageCompleted*/)
- {
- }
-
-/**
- * CCalDavEngineMgr::Completed()
- * completed callback
- */
-void CCalDavEngineMgr::Completed(TInt /*aError*/)
- {
- }
-
-/**
- * CCalDavEngineMgr::NotifyProgress()
- * NotifyProgress callback
- */
-TBool CCalDavEngineMgr::NotifyProgress()
- {
- return EFalse;
- }
-
-/**
- * CCalDavEngineMgr::ConstructL()
- * second phase construction
- * check all calendar files, for each one which has caldav sync enabled,
- * create a CCalDavengine and enable sync
- */
-void CCalDavEngineMgr::ConstructL()
- {
- RPointerArray<CCalCalendarInfo> calendarInfoList;
- CCalenGlobalData* data = CCalenGlobalData::NewL(*this);
- data->InitializeGlobalDataL();
- CleanupStack::PushL(data);
- data->GetAllCalendarInfoL(calendarInfoList);
- CleanupClosePushL(calendarInfoList);
-
- for (TInt i = 0; i < calendarInfoList.Count(); i++)
- {
- CDesC8Array* propertyKeys = calendarInfoList[i]->PropertyKeysL();
- CleanupStack::PushL(propertyKeys);
- TInt pos = 0;
- if (propertyKeys->Find(KCaldavEnabled, pos, ECmpNormal) == KErrNone)
- {
- CCalDavEngine* engine = CCalDavEngine::NewL(
- calendarInfoList[i]->FileNameL());
- iEngines.Append(engine);
- if (engine->EnabledSync())
- engine->EnableL();
- }
- CleanupStack::PopAndDestroy(propertyKeys);
- }
- CleanupStack::PopAndDestroy(&calendarInfoList);
- CleanupStack::PopAndDestroy(data);
- }
-
-/**
- * CCalDavEngineMgr::FindEngineL()
- * find engines inside engine array, create if neccessary
- */
-TInt CCalDavEngineMgr::FindEngineL(const TDesC &aName, TBool aCreate)
- {
- CCalSession* session = CCalSession::NewL();
- TRAPD(error,session->OpenL(aName));
- delete session;
- if (error != KErrNone)
- return KErrNotFound;
-
- for (TInt i = 0; i <= iEngines.Count() - 1; i++)
- {
- if (iEngines[i]->CalendarName() == aName)
- return i;
- }
-
- if (aCreate)
- {
- iEngines.Append(CCalDavEngine::NewL(aName));
- return iEngines.Count() - 1;
- }
- else
- return KErrNotFound;
- }
-
-/**
- * CCalDavEngineMgr::SyncL()
- * sync specific calendar
- */
-TInt CCalDavEngineMgr::SyncL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
- if (pos != KErrNotFound)
- return iEngines[pos]->SyncL();
- else
- return KErrNotFound;
- }
-
-/**
- * CCalDavEngineMgr::SyncAllL()
- * sync all calendars
- */
-TInt CCalDavEngineMgr::SyncAllL()
- {
- // sync all caldav enabled calendars
- for (TInt i = 0; i <= iEngines.Count() - 1; i++)
- iEngines[i]->SyncL();
- return KErrNone;
- }
-
-/**
- * CCalDavEngineMgr::DisableL()
- *
- */
-TInt CCalDavEngineMgr::DisableL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
-
- if (pos != KErrNotFound)
- iEngines[pos]->DisableL();
-
- return pos == KErrNotFound ? KErrNotFound : KErrNone;
- }
-
-/**
- * CCalDavEngineMgr::EnableL()
- *
- */
-TInt CCalDavEngineMgr::EnableL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
- if (pos != KErrNotFound)
- {
- return iEngines[pos]->EnableL();
- }
-
- return KErrArgument;
- }
-
-/**
- * CCalDavEngineMgr::UrlL()
- *
- */
-TPtrC8 CCalDavEngineMgr::UrlL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
- return (pos != KErrNotFound) ? iEngines[pos]->Url() : KNullDesC8();
- }
-
-/**
- * CCalDavEngineMgr::SetUrlL()
- *
- */
-void CCalDavEngineMgr::SetUrlL(const TDesC &aCalendar, const TDesC8 &aUrl)
- {
- TInt pos = FindEngineL(aCalendar, ETrue);
- if (pos != KErrNotFound)
- iEngines[pos]->SetUrlL(aUrl);
- }
-
-/**
- * CCalDavEngineMgr::UsernameL()
- *
- */
-TPtrC8 CCalDavEngineMgr::UsernameL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
- return (pos != KErrNotFound) ? iEngines[pos]->User() : KNullDesC8();
- }
-
-/**
- * CCalDavEngineMgr::SetUsernameL()
- *
- */
-void CCalDavEngineMgr::SetUsernameL(const TDesC &aCalendar,
- const TDesC8 &aUsername)
- {
- TInt pos = FindEngineL(aCalendar, ETrue);
- if (pos != KErrNotFound)
- iEngines[pos]->SetUserL(aUsername);
- }
-
-/**
- * CCalDavEngineMgr::PasswordL()
- *
- */
-TPtrC8 CCalDavEngineMgr::PasswordL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
- return (pos != KErrNotFound) ? iEngines[pos]->Password() : KNullDesC8();
- }
-
-/**
- * CCalDavEngineMgr::SetPasswordL()
- *
- */
-void CCalDavEngineMgr::SetPasswordL(const TDesC &aCalendar,
- const TDesC8 &aPassword)
- {
- TInt pos = FindEngineL(aCalendar, ETrue);
- if (pos != KErrNotFound)
- iEngines[pos]->SetPasswordL(aPassword);
- }
-
-/**
- * CCalDavEngineMgr::SyncIntervalL()
- *
- */
-TTimeIntervalMinutes CCalDavEngineMgr::SyncIntervalL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
- return (pos != KErrNotFound) ? iEngines[pos]->SyncInterval()
- : TTimeIntervalMinutes(DEFAULT_SYNC_MINUTES);
- }
-
-/**
- * CCalDavEngineMgr::SetSyncIntervalL()
- *
- */
-void CCalDavEngineMgr::SetSyncIntervalL(const TDesC &aCalendar,
- TTimeIntervalMinutes aSyncInterval)
- {
- TInt pos = FindEngineL(aCalendar, ETrue);
- if (pos != KErrNotFound)
- iEngines[pos]->SetSyncIntervalL(aSyncInterval);
- }
-
-/**
- * CCalDavEngineMgr::PastDaysL()
- *
- */
-TTimeIntervalDays CCalDavEngineMgr::PastDaysL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
- return (pos != KErrNotFound) ? iEngines[pos]->PastDays()
- : TTimeIntervalDays(DEFAULT_PAST_DAYS);
- }
-
-/**
- * CCalDavEngineMgr::SetPastDaysL()
- *
- */
-void CCalDavEngineMgr::SetPastDaysL(const TDesC &aCalendar,
- TTimeIntervalDays aDays)
- {
- TInt pos = FindEngineL(aCalendar, ETrue);
- if (pos != KErrNotFound)
- iEngines[pos]->SetPastDaysL(aDays);
- }
-
-/**
- * CCalDavEngineMgr::ImmediateSyncL()
- *
- */
-TBool CCalDavEngineMgr::ImmediateSyncL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
- return pos != KErrNotFound ? iEngines[pos]->ImmediateSync()
- : DEFAULT_IMMEDIATE_SYNC;
- }
-
-/**
- * CCalDavEngineMgr::SetImmediateSyncL()
- *
- */
-void CCalDavEngineMgr::SetImmediateSyncL(const TDesC &aCalendar,
- TBool aImmediateSyc)
- {
- TInt pos = FindEngineL(aCalendar, ETrue);
- if (pos != KErrNotFound)
- iEngines[pos]->SetImmediateSyncL(aImmediateSyc);
- }
-
-/**
- * CCalDavEngineMgr::KeepServerEntryL()
- *
- */
-TBool CCalDavEngineMgr::KeepServerEntryL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
- return pos != KErrNotFound ? iEngines[pos]->KeepServerEntry()
- : DEFAULT_KEEP_SERVER_ENTRY;
- }
-
-/**
- * CCalDavEngineMgr::SetKeepServerEntryL()
- *
- */
-void CCalDavEngineMgr::SetKeepServerEntryL(const TDesC &aCalendar,
- TBool aKeepServerEntry)
- {
- TInt pos = FindEngineL(aCalendar, ETrue);
- if (pos != KErrNotFound)
- iEngines[pos]->SetKeepServerEntryL(aKeepServerEntry);
- }
-
-/**
- * CCalDavEngineMgr::EnabledSyncL()
- *
- */
-TBool CCalDavEngineMgr::EnabledSyncL(const TDesC &aCalendar)
- {
- TInt pos = FindEngineL(aCalendar);
- return (pos != KErrNotFound) ? iEngines[pos]->EnabledSync() : EFalse;
- }
--- a/calendarengines/caldav/src/caldavserver.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,373 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Caldav server, follows Symbian client/server
-* architecture
-*/
-
-#include <e32svr.h>
-#include <e32uid.h>
-#include <S32MEM.H>
-
-#include <xmlengdocument.h>
-#include <xmlengtext.h>
-
-#include "caldavserver.h"
-#include "caldavenginemgr.h"
-#include "caldavserverSession.h"
-#include "httpclient.h"
-
-const TUint KServerPolicyRangeCount = 2;
-
-const TInt KServerPolicyRanges[KServerPolicyRangeCount] =
- {
- 0, // range is 0 inclusive
- 200
- // range is 1-KMaxTInt inclusive
- };
-
-const TUint8 KServerPolicyElementsIndex[KServerPolicyRangeCount] =
- {
- 0, // applies to 0th range
- CPolicyServer::ENotSupported
- // applies to 1st range
- };
-
-/**
- * CPolicyServer::TPolicyElement()
- *
- */
-const CPolicyServer::TPolicyElement
- KServerPolicyElements[] =
- {
- {
- _INIT_SECURITY_POLICY_C5(ECapabilityWriteDeviceData,ECapabilityWriteUserData, ECapabilityReadDeviceData,ECapabilityReadUserData,ECapabilityNetworkServices), CPolicyServer::EFailClient
- }
- };
-
-const CPolicyServer::TPolicy KServerPolicy =
- {
- CPolicyServer::EAlwaysPass, // specifies all connect attempts should pass
- KServerPolicyRangeCount,
- KServerPolicyRanges,
- KServerPolicyElementsIndex,
- KServerPolicyElements
- };
-
-/**
- * CCalDavServer::CCalDavServer
- * default constructor
- */
-CCalDavServer::CCalDavServer(CActive::TPriority aActiveObjectPriority) :
- CPolicyServer(aActiveObjectPriority, KServerPolicy)
- {
- }
-
-/**
- * CCalDavServer::NewSessionL
- * Creates a new session with the server.
- */
-CSession2* CCalDavServer::NewSessionL(const TVersion& aVersion,
- const RMessage2& /*aMessage*/) const
- {
- // Check that the version is OK
- TVersion v(KCalDavServerMajorVersionNumber,
- KCalDavServerMinorVersionNumber, KCalDavServerBuildVersionNumber);
- if (!User::QueryVersionSupported(v, aVersion))
- User::Leave(KErrNotSupported);
-
- // CAN USE THE aMessage argument to check client's security and identity
- // can make use of this later but for now ignore. AH 4/5/05
- // the connect message is delivered via the RMessage2 object passed.
-
- // do something with this later (and move it to the start of the function?)
-
- // Create the session.
- return new (ELeave) CCalDavServerSession(*const_cast<CCalDavServer*> (this));
- }
-
-/**
-* CCalDavServer::PanicServer
- A utility function to panic the server.
- */
-void CCalDavServer::PanicServer(TCalDavServPanic aPanic)
- {
- _LIT(KTxtServerPanic,"CalDav server panic");
- User::Panic(KTxtServerPanic, aPanic);
- }
-
-/**
- * CCalDavServer::ThreadFunction
- * The count server thread function that initialises the server.
- */
-TInt CCalDavServer::ThreadFunction(TAny* /**aStarted*/)
- {
- CTrapCleanup* cleanupStack = CTrapCleanup::New();
- if (!(cleanupStack))
- {
- PanicServer(ECreateTrapCleanup);
- }
- TRAPD( err, ThreadFunctionL() );
- if (err != KErrNone)
- {
- PanicServer(ESvrCreateServer);
- }
-
- delete cleanupStack;
- cleanupStack = NULL;
-
- return KErrNone;
-
- }
-
-/**
- * CCalDavServer::NewLC
- * first phase construction
- */
-CCalDavServer* CCalDavServer::NewLC()
- {
- CCalDavServer* self =
- new (ELeave) CCalDavServer(CActive::EPriorityStandard);
- CleanupStack::PushL(self);
- self->ConstructL();
- return self;
- }
-
-/**
- * CCalDavServer::ConstructL
- * second phase construction
- */
-void CCalDavServer::ConstructL()
- {
- StartL(KCalDavServerName);
-
- iMgr = CCalDavEngineMgr::NewL();
- }
-
-/**
- * CCalDavServer::ThreadFunctionL
- * start scheduler and construct function
- */
-void CCalDavServer::ThreadFunctionL()
- {
- // Construct active scheduler
- CActiveScheduler* activeScheduler = new (ELeave) CActiveScheduler;
- CleanupStack::PushL(activeScheduler);
-
- // Install active scheduler
- // We don't need to check whether an active scheduler is already installed
- // as this is a new thread, so there won't be one
- CActiveScheduler::Install(activeScheduler);
-
- // Construct our server, leave it on clean-up stack
- CCalDavServer::NewLC();
-
- // Naming the server thread after the server helps to debug panics
- User::LeaveIfError(User::RenameThread(KCalDavServerName));
-
- RProcess::Rendezvous(KErrNone);
-
- // Start handling requests
- CActiveScheduler::Start();
-
- CleanupStack::PopAndDestroy(2, activeScheduler); //Anonymous CCalDavServer
- }
-
-/**
- * CCalDavServer::~CCalDavServer
- * default destructor
- */
-CCalDavServer::~CCalDavServer()
- {
- if (iMgr)
- delete iMgr;
- }
-
-/**
- * CCalDavServer::SyncL
- *
- */
-TInt CCalDavServer::SyncL(const TDesC &aCalendar)
- {
- return iMgr->SyncL(aCalendar);
- }
-
-/**
- * CCalDavServer::SyncAllL
- *
- */
-TInt CCalDavServer::SyncAllL()
- {
- return iMgr->SyncAllL();
- }
-
-/**
- * CCalDavServer::EnableL
- *
- */
-TInt CCalDavServer::EnableL(const TDesC &aCalendar)
- {
- return iMgr->EnableL(aCalendar);
- }
-
-/**
- * CCalDavServer::DisableL
- *
- */
-TInt CCalDavServer::DisableL(const TDesC &aCalendar)
- {
- return iMgr->DisableL(aCalendar);
- }
-
-/**
- * CCalDavServer::UrlL
- *
- */
-TPtrC8 CCalDavServer::UrlL(const TDesC &aCalendar)
- {
- return iMgr->UrlL(aCalendar);
- }
-
-/**
- * CCalDavServer::SetUrlL
- *
- */
-void CCalDavServer::SetUrlL(const TDesC &aCalendar, const TDesC8 &aUrl)
- {
- return iMgr->SetUrlL(aCalendar, aUrl);
- }
-
-/**
- * CCalDavServer::UsernameL
- *
- */
-TPtrC8 CCalDavServer::UsernameL(const TDesC &aCalendar)
- {
- return iMgr->UsernameL(aCalendar);
- }
-
-/**
- * CCalDavServer::SetUsernameL
- *
- */
-void CCalDavServer::SetUsernameL(const TDesC &aCalendar, const TDesC8 &aUsername)
- {
- return iMgr->SetUsernameL(aCalendar, aUsername);
- }
-
-/**
- * CCalDavServer::PasswordL
- *
- */
-TPtrC8 CCalDavServer::PasswordL(const TDesC &aCalendar)
- {
- return iMgr->PasswordL(aCalendar);
- }
-
-/**
- * CCalDavServer::SetPasswordL
- *
- */
-void CCalDavServer::SetPasswordL(const TDesC &aCalendar, const TDesC8 &aPassword)
- {
- return iMgr->SetPasswordL(aCalendar, aPassword);
- }
-
-/**
- * CCalDavServer::SyncIntervalL
- *
- */
-TTimeIntervalMinutes CCalDavServer::SyncIntervalL(const TDesC &aCalendar) const
- {
- return iMgr->SyncIntervalL(aCalendar);
- }
-
-/**
- * CCalDavServer::SetSyncIntervalL
- *
- */
-void CCalDavServer::SetSyncIntervalL(const TDesC &aCalendar,
- TTimeIntervalMinutes aSyncInterval)
- {
- iMgr->SetSyncIntervalL(aCalendar, aSyncInterval);
- }
-
-/**
- * CCalDavServer::EnabledSyncL
- *
- */
-TBool CCalDavServer::EnabledSyncL(const TDesC &aCalendar) const
- {
- return iMgr->EnabledSyncL(aCalendar);
- }
-
-/**
- * CCalDavServer::PastDaysL
- *
- */
-TTimeIntervalDays CCalDavServer::PastDaysL(const TDesC &aCalendar) const
- {
- return iMgr->PastDaysL(aCalendar);
- }
-
-/**
- * CCalDavServer::SetPastDaysL
- *
- */
-void CCalDavServer::SetPastDaysL(const TDesC &aCalendar, TTimeIntervalDays aDays)
- {
- iMgr->SetPastDaysL(aCalendar, aDays);
- }
-
-/**
- * CCalDavServer::ImmediateSyncL
- *
- */
-TBool CCalDavServer::ImmediateSyncL(const TDesC &aCalendar) const
- {
- return iMgr->ImmediateSyncL(aCalendar);
- }
-
-/**
- * CCalDavServer::SetImmediateSyncL
- *
- */
-void CCalDavServer::SetImmediateSyncL(const TDesC &aCalendar,
- TBool aImmediateSyc)
- {
- iMgr->SetImmediateSyncL(aCalendar, aImmediateSyc);
- }
-
-/**
- * CCalDavServer::KeepServerEntryL
- *
- */
-TBool CCalDavServer::KeepServerEntryL(const TDesC &aCalendar) const
- {
- return iMgr->KeepServerEntryL(aCalendar);
- }
-
-/**
- * CCalDavServer::SetKeepServerEntryL
- *
- */
-void CCalDavServer::SetKeepServerEntryL(const TDesC &aCalendar,
- TBool aKeepServerEntry)
- {
- iMgr->SetKeepServerEntryL(aCalendar, aKeepServerEntry);
- }
-
-TInt E32Main()
- {
- return CCalDavServer::ThreadFunction(NULL);
- }
--- a/calendarengines/caldav/src/caldavserversession.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,400 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Caldav server session, follows Symbian
-* client/server architecture
-*/
-
-#include <e32cmn.h>
-
-#include "caldavserversession.h"
-#include "caldavserver.h"
-#include "caldavutils.h"
-
-#define MAXLENGTH 500
-
-CCalDavServerSession::CCalDavServerSession(CCalDavServer &aServer) :
- rServer(aServer)
- {
- }
-
-/**
- Services a client request.
- */
-void CCalDavServerSession::ServiceL(const RMessage2& aMessage)
- {
- TRAP_IGNORE(DispatchMessageL(aMessage));
- }
-
-/**
- Called by ServiceL()
-
- It tests the function code and then delegates to
- the appropriate function.
- */
-void CCalDavServerSession::DispatchMessageL(const RMessage2& aMessage)
- {
- switch (aMessage.Function())
- {
- case ECalDavEnable:
- EnableL(aMessage);
- return;
- case ECalDavDisable:
- DisableL(aMessage);
- return;
- case ECalDavSyncAll:
- SyncAllL(aMessage);
- return;
- case ECalDavSync:
- SyncL(aMessage);
- return;
- case ECalDavUrl:
- UrlL(aMessage);
- return;
- case ECalDavSetUrl:
- SetUrlL(aMessage);
- return;
- case ECalDavUsername:
- UsernameL(aMessage);
- return;
- case ECalDavSetUsername:
- SetUsernameL(aMessage);
- return;
- case ECalDavPassword:
- PasswordL(aMessage);
- return;
- case ECalDavSetPassword:
- SetPasswordL(aMessage);
- return;
- case ECalDavSyncInterval:
- SyncIntervalL(aMessage);
- return;
- case ECalDavSetSyncInterval:
- SetSyncIntervalL(aMessage);
- return;
- case ECalDavPastDays:
- PastDaysL(aMessage);
- return;
- case ECalDavSetPastDays:
- SetPastDaysL(aMessage);
- return;
- case ECalDavImmediateSync:
- ImmediateSyncL(aMessage);
- return;
- case ECalDavSetImmediateSync:
- SetImmediateSyncL(aMessage);
- return;
- case ECalDavKeepServer:
- KeepServerEntryL(aMessage);
- return;
- case ECalDavSetKeepServer:
- SetKeepServerEntryL(aMessage);
- return;
- case ECalDavEnabled:
- EnabledSyncL(aMessage);
- return;
- case ECalDavUnsupportedRequest:
- User::Leave(KErrNotSupported);
- // Requests that we don't understand at all are a different matter.
- // This is considered a client programming error, so we panic the
- // client - this also completes the message.
- default:
- PanicClient(aMessage, EBadRequest);
- return;
- }
- }
-
-/**
- Panics the client
- */
-void CCalDavServerSession::PanicClient(const RMessage2& aMessage, TInt aPanic) const
- {
- _LIT(KTxtServer,"CalDav server");
- aMessage.Panic(KTxtServer, aPanic);
- }
-
-void CCalDavServerSession::EnableL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TInt result = rServer.EnableL(*calendar);
-
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(result);
- }
-
-void CCalDavServerSession::DisableL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TInt result = rServer.DisableL(*calendar);
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(result);
- }
-
-void CCalDavServerSession::SyncL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TInt result = rServer.SyncL(*calendar);
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(result);
- }
-
-void CCalDavServerSession::SyncAllL(const RMessage2& aMessage)
- {
- TInt result = rServer.SyncAllL();
- aMessage.Complete(result);
- }
-
-void CCalDavServerSession::UrlL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- aMessage.WriteL(1, rServer.UrlL(*calendar));
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::SetUrlL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- length = aMessage.GetDesLength(1);
- HBufC8* url = HBufC8::NewLC(length);
- TPtr8 urlPtr(url->Des());
- aMessage.ReadL(1, urlPtr);
-
- rServer.SetUrlL(*calendar, *url);
- CleanupStack::PopAndDestroy(url);
- CleanupStack::PopAndDestroy(calendar);
-
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::UsernameL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- aMessage.WriteL(1, rServer.UsernameL(*calendar));
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::SetUsernameL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- length = aMessage.GetDesLength(1);
- HBufC8* username = HBufC8::NewLC(length);
- TPtr8 usernamePtr(username->Des());
- aMessage.ReadL(1, usernamePtr);
-
- rServer.SetUsernameL(*calendar, *username);
- CleanupStack::PopAndDestroy(username);
- CleanupStack::PopAndDestroy(calendar);
-
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::PasswordL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- aMessage.WriteL(1, rServer.PasswordL(*calendar));
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::SetPasswordL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- length = aMessage.GetDesLength(1);
- HBufC8* password = HBufC8::NewLC(length);
- TPtr8 passwordPtr(password->Des());
- aMessage.ReadL(1, passwordPtr);
-
- rServer.SetPasswordL(*calendar, *password);
- CleanupStack::PopAndDestroy(password);
- CleanupStack::PopAndDestroy(calendar);
-
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::SyncIntervalL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TTimeIntervalMinutes interval = rServer.SyncIntervalL(*calendar);
- TPckg<TTimeIntervalMinutes> intervalDes(interval);
- aMessage.WriteL(1, intervalDes);
-
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::SetSyncIntervalL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TTimeIntervalMinutes interval;
- ;
- TPckg<TTimeIntervalMinutes> intervalDes(interval);
- aMessage.ReadL(1, intervalDes);
-
- rServer.SetSyncIntervalL(*calendar, interval);
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::PastDaysL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TTimeIntervalDays days = rServer.PastDaysL(*calendar);
- TPckg<TTimeIntervalDays> daysDes(days);
- aMessage.WriteL(1, daysDes);
-
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::SetPastDaysL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TTimeIntervalDays days;
- TPckg<TTimeIntervalDays> daysDes(days);
- aMessage.ReadL(1, daysDes);
-
- rServer.SetPastDaysL(*calendar, days);
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::ImmediateSyncL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TBool immediate = rServer.ImmediateSyncL(*calendar);
- TPckg<TBool> immediateDes(immediate);
- aMessage.WriteL(1, immediateDes);
-
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::SetImmediateSyncL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TBool immediate;
- TPckg<TBool> immediateDes(immediate);
- aMessage.ReadL(1, immediateDes);
- rServer.SetImmediateSyncL(*calendar, immediate);
-
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::KeepServerEntryL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TBool keepserver = rServer.ImmediateSyncL(*calendar);
- TPckg<TBool> keepserverDes(keepserver);
- aMessage.WriteL(1, keepserverDes);
-
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::EnabledSyncL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TBool enabledsync = rServer.EnabledSyncL(*calendar);
- TPckg<TBool> enabledsyncDes(enabledsync);
- aMessage.WriteL(1, enabledsyncDes);
-
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
-
-void CCalDavServerSession::SetKeepServerEntryL(const RMessage2& aMessage)
- {
- TUint length = aMessage.GetDesLength(0);
- HBufC* calendar = HBufC::NewLC(length);
- TPtr calendarPtr(calendar->Des());
- aMessage.ReadL(0, calendarPtr);
-
- TBool keepserver;
- TPckg<TBool> keepserverDes(keepserver);
- aMessage.ReadL(1, keepserverDes);
- rServer.SetImmediateSyncL(*calendar, keepserver);
-
- CleanupStack::PopAndDestroy(calendar);
- aMessage.Complete(KErrNone);
- }
--- a/calendarengines/caldav/src/caldavsession.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,154 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Client API to connect to Caldav server
-* Wrapper around RCalDavServer
-*/
-
-#include "caldavsession.h"
-#include "caldavsessionimpl.h"
-
-CCalDavSession::CCalDavSession()
- {
- }
-
-EXPORT_C CCalDavSession::~CCalDavSession()
- {
- delete iImpl;
- }
-
-EXPORT_C CCalDavSession* CCalDavSession::NewLC()
- {
- CCalDavSession* self = new (ELeave) CCalDavSession();
- CleanupStack::PushL(self);
- self->ConstructL();
- return self;
- }
-
-EXPORT_C CCalDavSession* CCalDavSession::NewL()
- {
- CCalDavSession* self = CCalDavSession::NewLC();
- CleanupStack::Pop(self);
- return self;
- }
-
-void CCalDavSession::ConstructL()
- {
- iImpl = CCalDavSessionImpl::NewL();
- }
-
-EXPORT_C TInt CCalDavSession::Enable(const TDesC &aCalendar)
- {
- return iImpl->Enable(aCalendar);
- }
-
-EXPORT_C TInt CCalDavSession::Disable(const TDesC &aCalendar)
- {
- return iImpl->Disable(aCalendar);
- }
-
-EXPORT_C TInt CCalDavSession::SyncL(const TDesC &aCalendar)
- {
- return iImpl->SyncL(aCalendar);
- }
-
-EXPORT_C TInt CCalDavSession::SyncAllL()
- {
- return iImpl->SyncAllL();
- }
-
-EXPORT_C TInt CCalDavSession::Url(const TDesC &aCalendar, TDes8 &aUrl)
- {
- return iImpl->Url(aCalendar, aUrl);
- }
-
-EXPORT_C TInt CCalDavSession::SetUrl(const TDesC &aCalendar, const TDesC8 &aUrl)
- {
- return iImpl->SetUrl(aCalendar, aUrl);
- }
-
-EXPORT_C TInt CCalDavSession::Username(const TDesC &aCalendar, TDes8 &aUsername)
- {
- return iImpl->Username(aCalendar, aUsername);
- }
-
-EXPORT_C TInt CCalDavSession::SetUsername(const TDesC &aCalendar,
- const TDesC8 &aUsername)
- {
- return iImpl->SetUsername(aCalendar, aUsername);
- }
-
-EXPORT_C TInt CCalDavSession::Password(const TDesC &aCalendar, TDes8 &aPassword)
- {
- return iImpl->Password(aCalendar, aPassword);
- }
-
-EXPORT_C TInt CCalDavSession::SetPassword(const TDesC &aCalendar,
- const TDesC8 &aPassword)
- {
- return iImpl->SetPassword(aCalendar, aPassword);
- }
-
-EXPORT_C TInt CCalDavSession::SyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes& aSyncInterval)
- {
- return iImpl->SyncInterval(aCalendar, aSyncInterval);
- }
-
-EXPORT_C TInt CCalDavSession::SetSyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes aSyncInterval)
- {
- return iImpl->SetSyncInterval(aCalendar, aSyncInterval);
- }
-
-EXPORT_C TInt CCalDavSession::PastDays(const TDesC &aCalendar,
- TTimeIntervalDays &aDays)
- {
- return iImpl->PastDays(aCalendar, aDays);
- }
-
-EXPORT_C TInt CCalDavSession::SetPastDays(const TDesC &aCalendar,
- TTimeIntervalDays aDays)
- {
- return iImpl->SetPastDays(aCalendar, aDays);
- }
-
-EXPORT_C TInt CCalDavSession::ImmediateSync(const TDesC &aCalendar,
- TBool &aImmediateSyc)
- {
- return iImpl->ImmediateSync(aCalendar, aImmediateSyc);
- }
-
-EXPORT_C TInt CCalDavSession::SetImmediateSync(const TDesC &aCalendar,
- TBool aImmediateSyc)
- {
- return iImpl->SetImmediateSync(aCalendar, aImmediateSyc);
- }
-
-EXPORT_C TInt CCalDavSession::KeepServerEntry(const TDesC &aCalendar,
- TBool &aKeepServerEntry)
- {
- return iImpl->KeepServerEntry(aCalendar, aKeepServerEntry);
- }
-
-EXPORT_C TInt CCalDavSession::SetKeepServerEntry(const TDesC &aCalendar,
- TBool aKeepServerEntry)
- {
- return iImpl->SetKeepServerEntry(aCalendar, aKeepServerEntry);
- }
-
-EXPORT_C TInt CCalDavSession::EnabledSync(const TDesC &aCalendar,
- TBool &aEnabledSync)
- {
- return iImpl->EnabledSync(aCalendar, aEnabledSync);
- }
--- a/calendarengines/caldav/src/caldavsessionimpl.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,160 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Client API implementation
-* Wrapper around RCalDavServer
-*/
-
-#include "caldavsessionimpl.h"
-#include "caldavclient.h"
-
-CCalDavSessionImpl::CCalDavSessionImpl()
- {
- // No implementation required
- }
-
-CCalDavSessionImpl::~CCalDavSessionImpl()
- {
- if (iServer)
- {
- iServer->Close();
- delete iServer;
- }
- }
-
-CCalDavSessionImpl* CCalDavSessionImpl::NewLC()
- {
- CCalDavSessionImpl* self = new (ELeave) CCalDavSessionImpl();
- CleanupStack::PushL(self);
- self->ConstructL();
- return self;
- }
-
-CCalDavSessionImpl* CCalDavSessionImpl::NewL()
- {
- CCalDavSessionImpl* self = CCalDavSessionImpl::NewLC();
- CleanupStack::Pop(self);
- return self;
- }
-
-void CCalDavSessionImpl::ConstructL()
- {
- iServer = new (ELeave) RCalDavServer();
- User::LeaveIfError(iServer->Connect());
- }
-
-TInt CCalDavSessionImpl::Enable(const TDesC &aCalendar)
- {
- return iServer->Enable(aCalendar);
- }
-
-TInt CCalDavSessionImpl::Disable(const TDesC &aCalendar)
- {
- return iServer->Disable(aCalendar);
- }
-
-TInt CCalDavSessionImpl::SyncL(const TDesC &aCalendar)
- {
- return iServer->Sync(aCalendar);
- }
-
-TInt CCalDavSessionImpl::SyncAllL()
- {
- return iServer->SyncAll();
- }
-
-TInt CCalDavSessionImpl::Url(const TDesC &aCalendar, TDes8 &aUrl)
- {
- return iServer->Url(aCalendar, aUrl);
- }
-
-TInt CCalDavSessionImpl::SetUrl(const TDesC &aCalendar, const TDesC8 &aUrl)
- {
- return iServer->SetUrl(aCalendar, aUrl);
- }
-
-TInt CCalDavSessionImpl::Username(const TDesC &aCalendar, TDes8 &aUsername)
- {
- return iServer->Username(aCalendar, aUsername);
- }
-
-TInt CCalDavSessionImpl::SetUsername(const TDesC &aCalendar,
- const TDesC8 &aUsername)
- {
- return iServer->SetUsername(aCalendar, aUsername);
- }
-
-TInt CCalDavSessionImpl::Password(const TDesC &aCalendar, TDes8 &aPassword)
- {
- return iServer->Password(aCalendar, aPassword);
- }
-
-TInt CCalDavSessionImpl::SetPassword(const TDesC &aCalendar,
- const TDesC8 &aPassword)
- {
- return iServer->SetPassword(aCalendar, aPassword);
- }
-
-TInt CCalDavSessionImpl::SyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes& aSyncInterval)
- {
- return iServer->SyncInterval(aCalendar, aSyncInterval);
- }
-
-TInt CCalDavSessionImpl::SetSyncInterval(const TDesC &aCalendar,
- TTimeIntervalMinutes aSyncInterval)
- {
- return iServer->SetSyncInterval(aCalendar, aSyncInterval);
- }
-
-TInt CCalDavSessionImpl::PastDays(const TDesC &aCalendar,
- TTimeIntervalDays &aDays)
- {
- return iServer->PastDays(aCalendar, aDays);
- }
-
-TInt CCalDavSessionImpl::SetPastDays(const TDesC &aCalendar,
- TTimeIntervalDays aDays)
- {
- return iServer->SetPastDays(aCalendar, aDays);
- }
-
-TInt CCalDavSessionImpl::ImmediateSync(const TDesC &aCalendar,
- TBool &aImmediateSyc)
- {
- return iServer->ImmediateSync(aCalendar, aImmediateSyc);
- }
-
-TInt CCalDavSessionImpl::SetImmediateSync(const TDesC &aCalendar,
- TBool aImmediateSyc)
- {
- return iServer->SetImmediateSync(aCalendar, aImmediateSyc);
- }
-
-TInt CCalDavSessionImpl::KeepServerEntry(const TDesC &aCalendar,
- TBool &aKeepServerEntry)
- {
- return iServer->KeepServerEntry(aCalendar, aKeepServerEntry);
- }
-
-TInt CCalDavSessionImpl::SetKeepServerEntry(const TDesC &aCalendar,
- TBool aKeepServerEntry)
- {
- return iServer->SetKeepServerEntry(aCalendar, aKeepServerEntry);
- }
-
-TInt CCalDavSessionImpl::EnabledSync(const TDesC &aCalendar,
- TBool &aEnabledSync)
- {
- return iServer->EnabledSync(aCalendar, aEnabledSync);
- }
--- a/calendarengines/caldav/src/caldavutils.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,375 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: various utility classes and functions
-* used in Caldav client and server code
-*/
-
-#include "caldavutils.h"
-
-#include <http\MHTTPAuthenticationCallback.h>
-#include <http\mhttptransactioncallback.h>
-#include <http\mhttpdatasupplier.h>
-#include <http\rhttpheaders.h>
-
-/**
- * CalDavUtils::CalDavUtils
- * default constructor
- */
-CalDavUtils::CalDavUtils()
- {
- // No implementation required
- }
-
-/**
- * CalDavUtils::~CalDavUtils
- * default destructor
- */
-CalDavUtils::~CalDavUtils()
- {
- }
-
-/**
- * CalDavUtils::NewLC
- * first phase construction
- */
-CalDavUtils* CalDavUtils::NewLC()
- {
- CalDavUtils* self = new (ELeave) CalDavUtils();
- CleanupStack::PushL(self);
- self->ConstructL();
- return self;
- }
-
-/**
- * CalDavUtils::NewL
- * first phase construction
- */
-CalDavUtils* CalDavUtils::NewL()
- {
- CalDavUtils* self = CalDavUtils::NewLC();
- CleanupStack::Pop(self); // self;
- return self;
- }
-
-/**
- * CalDavUtils::ConstructL
- * second phase construction
- */
-void CalDavUtils::ConstructL()
- {
- }
-
-/**
- * CalDavUtils::FixImportIssues
- * fix import issues
- */
-void CalDavUtils::FixImportIssues(TDes8 &aDes)
- {
- const TUint KICalCarriageReturnChar('\r');
- _LIT8(KICalNewlineChar,"\n");
- _LIT8(KICalCarriageReturnLineFeed,"\r\n");
-
- TInt ret = aDes.Find(KICalNewlineChar);
-
- while ((ret != KErrNotFound) && (ret == 0 ? ETrue : (aDes[ret - 1]
- != KICalCarriageReturnChar)))
- {
- aDes.Replace(ret, 1, KICalCarriageReturnLineFeed);
- TInt mid = aDes.Mid(ret + 2).Find(KICalNewlineChar);
- ret = mid != KErrNone ? mid + ret + 2 : KErrNotFound;
- }
- }
-
-/**
- * CalDavUtils::FixExportIssues
- * fix export issues, hopefully can be removed in the future
- */
-void CalDavUtils::FixExportIssues(TDes8 &aDes)
- {
- FixSameTime(aDes);
- FindAndRemoveMethod(aDes);
- FixBYMONTHDAY(aDes);
- FixLineFeed(aDes);
- //TODO: using public, nothing is exported
- }
-
-/**
- * CalDavUtils::FixLineFeed
- * fix lidne feed
- */
-void CalDavUtils::FixLineFeed(TDes8 &aDes)
- {
- _LIT8(lf1,"
");
- _LIT8(KBackSlashN,"\\n");
- TInt ret = aDes.Find(lf1);
- while (ret != KErrNotFound)
- {
- aDes.Replace(ret, lf1().Length(), KBackSlashN);
- ret = aDes.Find(lf1);
- }
- }
-
-/**
- * CalDavUtils::FixSameTime
- * fix same time
- */
-void CalDavUtils::FixSameTime(TDes8 &aDes)
- {
-#define DATELENGTH 15
- _LIT8(DTSTART,"DTSTART:");
- _LIT8(DTEND,"DTEND:");
- _LIT8(DUE,"DUE:");
- _LIT8(nine,"9");
- _LIT8(five,"5");
- _LIT8(VEVENT,"VEVENT");
- _LIT8(VTODO,"VTODO");
-
- // add one second if DTSTART and DTEND is the same
- // ATTENTION: works only for very simple cases right now
- // DTSTART:20090630T000000
- // DTEND:20090630T000000
- if (aDes.Find(VEVENT) != KErrNone)
- {
- TInt PosStart = aDes.Find(DTSTART);
- TInt PosDue = aDes.Find(DTEND);
-
- if ((PosStart != KErrNone) && (PosDue != KErrNone))
- {
- TPtrC8 PtrStart = aDes.Mid(PosStart + DTSTART().Length(),
- DATELENGTH);
- TPtrC8 PtrStop = aDes.Mid(PosDue + DTEND().Length(), DATELENGTH);
-
- if (PtrStart == PtrStop)
- {
- aDes.Replace(PosDue + DTEND().Length() + DATELENGTH - 1, 1,
- nine);
- aDes.Replace(PosDue + DTEND().Length() + DATELENGTH - 2, 1,
- five);
- aDes.Replace(PosDue + DTEND().Length() + DATELENGTH - 3, 1,
- nine);
- }
- }
- }
-
- // add one second if DTSTART and DUE is the same
- // ATTENTION: works only for very simple cases right now
- // DTSTART:20090630T000000
- // DUE:20090630T000000
-
- if (aDes.Find(VTODO) != KErrNone)
- {
- TInt PosStart = aDes.Find(DTSTART);
- TInt PosDue = aDes.Find(DUE);
-
- if ((PosStart != KErrNone) && (PosDue != KErrNone))
- {
- TPtrC8 PtrStart = aDes.Mid(PosStart + DTSTART().Length(),
- DATELENGTH);
- TPtrC8 PtrStop = aDes.Mid(PosDue + DUE().Length(), DATELENGTH);
-
- if (PtrStart == PtrStop)
- {
- aDes.Replace(PosDue + DUE().Length() + DATELENGTH - 1, 1, nine);
- aDes.Replace(PosDue + DUE().Length() + DATELENGTH - 2, 1, five);
- aDes.Replace(PosDue + DUE().Length() + DATELENGTH - 3, 1, nine);
- }
- }
- }
- }
-
-/**
- * CalDavUtils::FindAndRemoveMethod
- * fix wrong method export
- */
-void CalDavUtils::FindAndRemoveMethod(TDes8 &aDes)
- {
- _LIT8(method,"METHOD:PUBLISH\r\n");
- TInt Ret = aDes.Find(method);
- while (Ret != KErrNotFound)
- {
- aDes.Delete(Ret, method().Length());
- Ret = aDes.Find(method);
- }
- }
-
-/**
- * CalDavUtils::FixBYMONTHDAY
- * fix wrong BYMONTHDAY export
- */
-void CalDavUtils::FixBYMONTHDAY(TDes8 &aDes)
- {
- _LIT8(method0,"BYMONTHDAY=0");
- _LIT8(method1,"BYMONTHDAY=1");
- TInt ret = aDes.Find(method0);
- while (ret != KErrNotFound)
- {
- aDes.Replace(ret, method1().Length(), method1);
- ret = aDes.Find(method0);
- }
- }
-
-/**
- * CalDavUtils::ScanAllowHeaderL
- * fix scan allow header
- */
-void CalDavUtils::ScanAllowHeaderL(RHTTPTransaction &aTransaction,
- TCalDAVOptions &aOptions)
- {
- RStringF Header = aTransaction.Session().StringPool().OpenFStringL(ALLOW);
- THTTPHdrVal HeaderVal;
- if (aTransaction.Response().GetHeaderCollection().GetField(Header, 0,
- HeaderVal) == KErrNone)
- {
- RStringF FieldValStr = aTransaction.Session().StringPool().StringF(
- HeaderVal.StrF());
- const TDesC8 &FieldValDesC = FieldValStr.DesC();
- HBufC8 *FieldVal = FieldValDesC.AllocLC();
- // delete all colons
- TInt Pos = FieldVal->Find(colon);
- while (Pos != KErrNotFound)
- {
- FieldVal->Des().Delete(Pos, 1);
- Pos = FieldVal->Find(colon);
- }
- TLex8 Lex(FieldVal->Des());
- TBool stop = EFalse;
- while (!stop)
- {
- TPtrC8 Ptr = Lex.NextToken();
- stop = Ptr.Length() == 0;
- if (Ptr == DELETE)
- aOptions.DELETE = ETrue;
- else if (Ptr == GET)
- aOptions.GET = ETrue;
- else if (Ptr == HEAD)
- aOptions.HEAD = ETrue;
- else if (Ptr == MKCALENDAR)
- aOptions.MKCALENDAR = ETrue;
- else if (Ptr == MKCOL)
- aOptions.MKCOL = ETrue;
- else if (Ptr == OPTIONS)
- aOptions.OPTIONS = ETrue;
- else if (Ptr == PROPFIND)
- aOptions.PROPFIND = ETrue;
- else if (Ptr == PROPPATCH)
- aOptions.PROPPATCH = ETrue;
- else if (Ptr == PUT)
- aOptions.PUT = ETrue;
- else if (Ptr == REPORT)
- aOptions.REPORT = ETrue;
- else if (Ptr == COPY)
- aOptions.COPY = ETrue;
- else if (Ptr == POST)
- aOptions.POST = ETrue;
- else if (Ptr == MOVE)
- aOptions.MOVE = ETrue;
- else if (Ptr == ACL)
- aOptions.ACL = ETrue;
- else if (Ptr == LOCK)
- aOptions.LOCK = ETrue;
- else if (Ptr == UNLOCK)
- aOptions.UNLOCK = ETrue;
- }
- CleanupStack::PopAndDestroy(FieldVal);
- }
- Header.Close();
- }
-
-/**
- * CalDavUtils::ScanDAVHeaderL
- * scan DAV header
- */
-void CalDavUtils::ScanDAVHeaderL(RHTTPTransaction &aTransaction,
- TCalDAVOptions &aOptions)
- {
- RStringF Header = aTransaction.Session().StringPool().OpenFStringL(DAV);
- THTTPHdrVal aHeaderVal;
- if (aTransaction.Response().GetHeaderCollection().GetField(Header, 0,
- aHeaderVal) == KErrNone)
- {
- RStringF FieldValStr = aTransaction.Session().StringPool().StringF(
- aHeaderVal.StrF());
- const TDesC8 &FieldValDesC = FieldValStr.DesC();
- HBufC8 *FieldVal = FieldValDesC.AllocLC();
- // delete all colons
- TInt Pos = FieldVal->Find(colon);
- while (Pos != KErrNotFound)
- {
- FieldVal->Des().Delete(Pos, 1);
- Pos = FieldVal->Find(colon);
- }
- TLex8 Lex(FieldVal->Des());
- TBool stop = EFalse;
- while (!stop)
- {
- TPtrC8 Ptr = Lex.NextToken();
- stop = Ptr.Length() == 0;
- if (Ptr == ONE)
- aOptions.ONE = ETrue;
- else if (Ptr == TWO)
- aOptions.TWO = ETrue;
- else if (Ptr == THREE)
- aOptions.THREE = ETrue;
- else if (Ptr == access_control)
- aOptions.access_control = ETrue;
- else if (Ptr == calendar_access)
- {
- aOptions.calendar_access = ETrue;
- // this is a CalDAV server for sure, MULTIGET and calendar-query is required
- // we do not check for this anymore in CCaldavEngine::GetOptions()
- aOptions.MULTIGET = ETrue;
- aOptions.QUERY = ETrue;
- }
- else if (Ptr == calendar_schedule)
- aOptions.calendar_schedule = ETrue;
- else if (Ptr == calendar_auto_schedule)
- aOptions.calendar_auto_schedule = ETrue;
- else if (Ptr == sync_collection)
- aOptions.sync_collection = ETrue;
- else if (Ptr == extended_mkcol)
- aOptions.extended_mkcol = ETrue;
- }
- CleanupStack::PopAndDestroy(FieldVal);
- }
- Header.Close();
- }
-
-/**
- * CalDavUtils::EnsureSlashL
- * ensure trailing slash
- */
-HBufC8* CalDavUtils::EnsureSlashL(HBufC8* aIn)
- {
- if ((aIn == NULL) || (aIn->Right(KSlash().Length()) == KSlash))
- return aIn;
- else
- {
- HBufC8 *out = HBufC8::NewL(aIn->Length() + KSlash().Length());
- out->Des().Append(*aIn);
- out->Des().Append(KSlash);
- delete aIn;
- aIn = NULL;
- return out;
- }
- }
-
-/**
- * CalDavUtils::EnsureSlashL
- * ensure trailing slash
- */
-HBufC8* CalDavUtils::EnsureSlashL(const TDesC8 &aIn)
- {
- HBufC8 *out = aIn.AllocL();
- return CalDavUtils::EnsureSlashL(out);
- }
--- a/calendarengines/caldav/src/httpclient.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,687 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: basic http/webdav functionality
-* handles all needed internet access for Caldav
-*/
-
-#include "httpclient.h"
-#include "caldavutils.h"
-#include <uri8.h>
-#include <http.h>
-#include <EIKENV.H>
-
-_LIT8(KTextXml,"text/xml");
-_LIT8(KTextCalendar,"text/calendar");
-_LIT8(KDepth,"depth");
-
-/**
- * CHttpClient::CHttpClient
- * default constructor
- */
-CHttpClient::CHttpClient() :
- iUser(0), iPassword(0), iEtag(0), iCredentialCount(0)
- {
- }
-
-/**
- * CHttpClient::~CHttpClient
- * default destructor
- */
-CHttpClient::~CHttpClient()
- {
- delete iUser;
- delete iPassword;
- delete iEtag;
-
- iSess.Close();
- iRConnection.Close();
- iSocketServ.Close();
-
- }
-
-/**
- * CHttpClient::NewLC
- * first phase constructor
- */
-CHttpClient* CHttpClient::NewLC()
- {
- CHttpClient* me = new (ELeave) CHttpClient;
- CleanupStack::PushL(me);
- me->ConstructL();
- return me;
- }
-
-/**
- * CHttpClient::NewL
- * first phase construction
- */
-CHttpClient* CHttpClient::NewL()
- {
- CHttpClient* me = NewLC();
- CleanupStack::Pop(me);
- return me;
- }
-
-/**
- * CHttpClient::OpenSessionL
- * open session and instal authentification
- */
-void CHttpClient::OpenSessionL()
- {
- TRAPD(err, iSess.OpenL());
-
- if (err != KErrNone)
- {
- _LIT(KErrMsg, "Cannot create session. Is internet access point configured?");
- _LIT(KExitingApp, "Exiting app.");
- CEikonEnv::Static()->InfoWinL(KErrMsg, KExitingApp);
- User::Leave(err);
- }
-
- // Install this class as the callback for authentication requests
- InstallAuthenticationL(iSess);
-
- // Set the session's connection info...
- RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
- // ...to use the socket server
- connInfo.SetPropertyL(iSess.StringPool().StringF(HTTP::EHttpSocketServ,
- RHTTPSession::GetTable()), THTTPHdrVal(iSocketServ.Handle()));
- // ...to use the connection
- connInfo.SetPropertyL(
- iSess.StringPool().StringF(HTTP::EHttpSocketConnection,
- RHTTPSession::GetTable()),
- THTTPHdrVal(REINTERPRET_CAST(TInt, &(iRConnection))));
-
- }
-
-/**
- * CHttpClient::ConstructL
- * second phase construction
- */
-void CHttpClient::ConstructL()
- {
- User::LeaveIfError(iSocketServ.Connect());
- User::LeaveIfError(iRConnection.Open(iSocketServ));
-
- iExtPrefs.SetSnapPurpose( CMManager::ESnapPurposeInternet );
- iExtPrefs.SetNoteBehaviour( TExtendedConnPref::ENoteBehaviourConnDisableNotes);
- iPrefList.AppendL(&iExtPrefs);
- iRConnection.Start(iPrefList);
-
- OpenSessionL();
- }
-
-/**
- * CHttpClient::DeleteL
- * HTTP DELETE
- */
-TInt CHttpClient::DeleteL(const TDesC8 &aUrl, const TDesC8 &aETag)
- {
- iReturnCode = ERROR;
-
- TUriParser8 uri;
- uri.Parse(aUrl);
-
- iTrans = iSess.OpenTransactionL(uri, *this, iSess.StringPool().StringF(
- HTTP::EDELETE, RHTTPSession::GetTable()));
- if (aETag != KNullDesC8)
- SetHeaderL(iTrans.Request().GetHeaderCollection(), HTTP::EIfMatch,
- aETag);
- SetHeaderL(iTrans.Request().GetHeaderCollection(), HTTP::EUserAgent,
- KUserAgent);
- iTrans.SubmitL();
-
- CActiveScheduler::Start();
- return iReturnCode;
- }
-
-/**
- * CHttpClient::HeadL
- * HTTP HEAD
- */
-TInt CHttpClient::HeadL(const TDesC8 &aUrl)
- {
- iReturnCode = ERROR;
-
- TUriParser8 uri;
- uri.Parse(aUrl);
-
- iTrans = iSess.OpenTransactionL(uri, *this, iSess.StringPool().StringF(
- HTTP::EHEAD, RHTTPSession::GetTable()));
- SetHeaderL(iTrans.Request().GetHeaderCollection(), HTTP::EUserAgent,
- KUserAgent);
- iTrans.SubmitL();
- CActiveScheduler::Start();
- return iReturnCode;
- }
-
-/**
- * CHttpClient::GetL
- * HTTP Get
- */
-TInt CHttpClient::GetL(const TDesC8 &aUrl, CBufFlat *aResponse)
- {
- iReturnCode = ERROR;
-
- iBodyResponse = aResponse;
-
- TUriParser8 uri;
- uri.Parse(aUrl);
-
- iTrans = iSess.OpenTransactionL(uri, *this, iSess.StringPool().StringF(
- HTTP::EGET, RHTTPSession::GetTable()));
- SetHeaderL(iTrans.Request().GetHeaderCollection(), HTTP::EUserAgent,
- KUserAgent);
- iTrans.SubmitL();
- CActiveScheduler::Start();
- iBodyResponse = NULL;
- return iReturnCode;
- }
-
-/**
- * CHttpClient::MkCalendarL
- * Caldav MKCALENDAR
- */
-TInt CHttpClient::MkCalendarL(const TDesC8 &aUrl, const TDesC8 &aBody,
- CBufFlat *aResponse)
- {
- iReturnCode = ERROR;
-
- if (aBody != KNullDesC8)
- {
- iBodyRequest = aBody.Alloc();
- iTrans.Request().SetBody(*this);
- }
-
- iBodyResponse = aResponse;
-
- TUriParser8 uri;
- uri.Parse(aUrl);
-
- RStringF mkcalendar = iSess.StringPool().OpenFStringL(MKCALENDAR);
- iTrans = iSess.OpenTransactionL(uri, *this, mkcalendar);
- RHTTPHeaders hdr = iTrans.Request().GetHeaderCollection();
-
- SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
- SetHeaderL(hdr, HTTP::EContentType, KTextXml);
-
- iTrans.SubmitL();
- CActiveScheduler::Start();
-
- mkcalendar.Close();
- if (iBodyRequest)
- {
- delete iBodyRequest;
- iBodyRequest = NULL;
- }
- iBodyResponse = NULL;
-
- return iReturnCode;
- }
-
-/**
- * CHttpClient::PutL
- * HTTP PUT
- */
-TInt CHttpClient::PutL(const TDesC8 &aUrl, const TDesC8 &aIcs,
- CBufFlat *aResponse, const TDesC8 &aEtag)
- {
- iReturnCode = ERROR;
-
- iBodyRequest = aIcs.Alloc();
- iBodyResponse = aResponse;
-
- TUriParser8 uri;
- uri.Parse(aUrl);
-
- iTrans = iSess.OpenTransactionL(uri, *this, iSess.StringPool().StringF(
- HTTP::EPUT, RHTTPSession::GetTable()));
- RHTTPHeaders hdr = iTrans.Request().GetHeaderCollection();
-
- iTrans.Request().SetBody(*this);
-
- if (aEtag == KNullDesC8)
- {
- _LIT8(KStar, "*");
- SetHeaderL(hdr, HTTP::EIfNoneMatch, KStar);
- }
- else
- {
-#ifdef ETAG
- SetHeaderL(hdr,HTTP::EIfMatch,aEtag);
-#endif
- }
-
- SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
- SetHeaderL(hdr, HTTP::EContentType, KTextCalendar);
-
- iTrans.SubmitL();
- CActiveScheduler::Start();
-
- delete iBodyRequest;
- iBodyRequest = NULL;
- iBodyResponse = NULL;
-
- return iReturnCode;
- }
-
-/**
- * CHttpClient::ReportL
- * Caldav REPORT
- */
-TInt CHttpClient::ReportL(const TDesC8 &aUrl, const TDesC8 &aBodyRequest,
- CBufFlat *aResponse)
- {
- iReturnCode = ERROR;
- iBodyResponse = aResponse;
-
- TUriParser8 uri;
- uri.Parse(aUrl);
-
- RStringF report = iSess.StringPool().OpenFStringL(REPORT);
- iTrans = iSess.OpenTransactionL(uri, *this, report);
- if (aBodyRequest.Length())
- {
- iBodyRequest = aBodyRequest.Alloc();
- iTrans.Request().SetBody(*this);
- }
-
- RHTTPHeaders hdr = iTrans.Request().GetHeaderCollection();
- SetHeaderL(hdr, HTTP::EContentType, KTextXml);
- SetHeaderL(hdr, KDepth, ONE);
- SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
- iTrans.SubmitL();
- CActiveScheduler::Start();
-
- report.Close();
-
- delete iBodyRequest;
- iBodyRequest = NULL;
- iBodyResponse = NULL;
-
- return iReturnCode;
- }
-
-/**
- * CHttpClient::PropfindL
- * WebDAV PROPFIND
- */
-TInt CHttpClient::PropfindL(const TDesC8 &aUrl, const TDesC8 &aBodyRequest,
- CBufFlat *aResponse, TBool depth)
- {
- iReturnCode = ERROR;
- iBodyResponse = aResponse;
-
- TUriParser8 uri;
- uri.Parse(aUrl);
-
- RStringF propfind = iSess.StringPool().OpenFStringL(PROPFIND);
- iTrans = iSess.OpenTransactionL(uri, *this, propfind);
- if (aBodyRequest.Length())
- {
- iBodyRequest = aBodyRequest.Alloc();
- iTrans.Request().SetBody(*this);
- }
-
- RHTTPHeaders hdr = iTrans.Request().GetHeaderCollection();
- SetHeaderL(hdr, HTTP::EContentType, KTextXml);
- SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
- if (depth)
- SetHeaderL(hdr, KDepth, ZERO);
- else
- SetHeaderL(hdr, KDepth, ONE);
-
- iTrans.SubmitL();
- CActiveScheduler::Start();
-
- propfind.Close();
-
- delete iBodyRequest;
- iBodyRequest = NULL;
- iBodyResponse = NULL;
-
- return iReturnCode;
- }
-
-/**
- * CHttpClient::ProppatchL
- * Webdav PROPPATCH
- */
-TInt CHttpClient::ProppatchL(const TDesC8 &aUrl, const TDesC8 &aBodyRequest, CBufFlat *aResponse)
- {
- iReturnCode = ERROR;
- iBodyResponse = aResponse;
-
- TUriParser8 uri;
- uri.Parse(aUrl);
-
- RStringF proppatch = iSess.StringPool().OpenFStringL(PROPPATCH);
- iTrans = iSess.OpenTransactionL(uri, *this, proppatch);
- RHTTPHeaders hdr = iTrans.Request().GetHeaderCollection();
- SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
- SetHeaderL(hdr, HTTP::EContentType, KTextXml);
-
- iBodyRequest = aBodyRequest.Alloc();
- iTrans.Request().SetBody(*this);
-
- iTrans.SubmitL();
- CActiveScheduler::Start();
-
- proppatch.Close();
-
- delete iBodyRequest;
- iBodyRequest = NULL;
- iBodyResponse = NULL;
-
- return iReturnCode;
- }
-
-/**
- * CHttpClient::GetServerOptionsL
- * HTTP OPTIONS
- */
-TInt CHttpClient::GetServerOptionsL(const TDesC8 &aUrl,
- TCalDAVOptions &aOptions)
- {
- iReturnCode = ERROR;
- iAction = EActionOption;
- iOptions = &aOptions;
-
- TUriParser8 uri;
- uri.Parse(aUrl);
-
- RStringF options = iSess.StringPool().OpenFStringL(OPTIONS);
- iTrans = iSess.OpenTransactionL(uri, *this, options);
- SetHeaderL(iTrans.Request().GetHeaderCollection(), HTTP::EUserAgent,
- KUserAgent);
- iTrans.SubmitL();
-
- CActiveScheduler::Start();
-
- options.Close();
-
- iAction = EActionNone;
- return iReturnCode;
- }
-
-/**
- * CHttpClient::GetNextDataPart
- * GetNextDataPart callback
- */
-TBool CHttpClient::GetNextDataPart(TPtrC8& aDataPart)
- {
- aDataPart.Set(iBodyRequest->Des());
- return ETrue;
- }
-
-/**
- * CHttpClient::ReleaseData
- * ReleaseData callback
- */
-void CHttpClient::ReleaseData()
- {
- }
-
-/**
- * CHttpClient::OverallDataSize
- * OverallDataSize callback
- */
-TInt CHttpClient::OverallDataSize()
- {
- if (iBodyRequest)
- return iBodyRequest->Length();
- else
- return 0;
- }
-
-/**
- * CHttpClient::Reset
- * Reset callback
- */
-TInt CHttpClient::Reset()
- {
- return KErrNone;
- }
-
-/**
- * CHttpClient::SetHeaderL
- * sets int header at session headers
- */
-void CHttpClient::SetHeaderL(RHTTPHeaders aHeaders, TInt aHdrField,
- const TDesC8& aHdrValue)
- {
- RStringF valStr = iSess.StringPool().OpenFStringL(aHdrValue);
- CleanupClosePushL(valStr);
- THTTPHdrVal val(valStr);
- aHeaders.SetFieldL(iSess.StringPool().StringF(aHdrField,
- RHTTPSession::GetTable()), val);
- CleanupStack::PopAndDestroy(&valStr);
- }
-
-/**
- * CHttpClient::SetHeaderL
- * set string header at session headers
- */
-void CHttpClient::SetHeaderL(RHTTPHeaders aHeaders, const TDesC8 &aField,
- const TDesC8 &aValue)
- {
- RStringF FieldVal = iSess.StringPool().OpenFStringL(aField);
- CleanupClosePushL(FieldVal);
- RStringF valStr = iSess.StringPool().OpenFStringL(aValue);
- CleanupClosePushL(valStr);
- THTTPHdrVal val(valStr);
- aHeaders.SetFieldL(FieldVal, val);
- CleanupStack::PopAndDestroy(&valStr);
- CleanupStack::PopAndDestroy(&FieldVal);
- }
-
-/**
- * CHttpClient::GetCredentialsL
- * ask for username and password for authentification
- */
-TBool CHttpClient::GetCredentialsL(const TUriC8& /*aURI*/, RString aRealm,
- RStringF /*aAuthenticationType*/, RString& aUsername,
- RString& aPassword)
- {
- if (iCredentialCount)
- {
- iCredentialCount = 0;
- User::Leave(KErrAccessDenied);
- }
- iCredentialCount++;
- aUsername = aRealm.Pool().OpenStringL(*iUser);
- aPassword = aRealm.Pool().OpenStringL(*iPassword);
- return ETrue;
- }
-
-/**
- * CHttpClient::GetEtagHeaderL
- * check for ETag and save it
- */
-void CHttpClient::GetEtagHeaderL(RHTTPTransaction &aTransaction)
- {
- RStringF Header = aTransaction.Session().StringPool().StringF(HTTP::EETag,
- RHTTPSession::GetTable());
- THTTPHdrVal HeaderVal;
- if (aTransaction.Response().GetHeaderCollection().GetField(Header, 0,
- HeaderVal) == KErrNone)
- {
- RStringF FieldValStr = aTransaction.Session().StringPool().StringF(
- HeaderVal.StrF());
- const TDesC8 &FieldValDesC = FieldValStr.DesC();
- delete iEtag;
- iEtag = NULL;
- iEtag = FieldValDesC.AllocL();
- }
- }
-
-/**
- * CHttpClient::MHFRunL
- * http state machine callback
- */
-void CHttpClient::MHFRunL(RHTTPTransaction aTransaction,
- const THTTPEvent& aEvent)
- {
- switch (aEvent.iStatus)
- {
- case THTTPEvent::EGotResponseHeaders:
- {
- // HTTP response headers have been received. We can determine now if there is
- // going to be a response body to save.
- RHTTPResponse resp = aTransaction.Response();
- iReturnCode = resp.StatusCode();
-
- if (iAction == EActionOption)
- {
- CalDavUtils::ScanAllowHeaderL(aTransaction, *iOptions);
- CalDavUtils::ScanDAVHeaderL(aTransaction, *iOptions);
- }
-
- GetEtagHeaderL(aTransaction);
-
- TBool cancelling = ETrue;
- if (resp.HasBody() && (iReturnCode >= OK) && (iReturnCode
- < MUTIPLECHOICES))
- cancelling = EFalse;
-
- if (cancelling)
- {
- aTransaction.Close();
- CActiveScheduler::Stop();
- }
- }
- break;
- case THTTPEvent::EGotResponseBodyData:
- {
- // Get the body data supplier
- MHTTPDataSupplier* body = aTransaction.Response().Body();
- TPtrC8 dataChunk;
- TBool isLast = body->GetNextDataPart(dataChunk);
- if (iBodyResponse)
- iBodyResponse->InsertL(iBodyResponse->Size(), dataChunk);
- // Done with that bit of body data
- body->ReleaseData();
- }
- break;
- case THTTPEvent::EResponseComplete:
- {
- // The transaction's response is complete
- }
- break;
- case THTTPEvent::ESucceeded:
- {
- aTransaction.Close();
- CActiveScheduler::Stop();
- }
- break;
- case THTTPEvent::EFailed:
- {
- aTransaction.Close();
- CActiveScheduler::Stop();
- }
- break;
- case THTTPEvent::ERedirectedPermanently:
- {
- }
- break;
- case THTTPEvent::ERedirectedTemporarily:
- {
- }
- break;
- default:
- {
- // close off the transaction if it's an error
- if (aEvent.iStatus < 0)
- {
- iReturnCode = aEvent.iStatus;
- aTransaction.Close();
- CActiveScheduler::Stop();
- }
- }
- break;
- }
- }
-
-/**
- * CHttpClient::MHFRunError
- * http stack erros
- */
-TInt CHttpClient::MHFRunError(TInt aError, RHTTPTransaction /*aTransaction*/,
- const THTTPEvent& /*aEvent*/)
- {
- iReturnCode = aError;
- return KErrNone;
- }
-
-/**
- * CHttpClient::SetUserL
- * set username for authentification
- */
-void CHttpClient::SetUserL(const TDesC8 &aUser)
- {
- if (iUser)
- delete iUser;
- iUser = aUser.Alloc();
- iSess.Close();
- OpenSessionL();
- }
-
-/**
- * CHttpClient::SetPasswordL
- * Set Password for authentification
- */
-void CHttpClient::SetPasswordL(const TDesC8 &aPassword)
- {
- if (iPassword)
- delete iPassword;
- iPassword = aPassword.Alloc();
- iSess.Close();
- OpenSessionL();
- }
-
-/**
- * CHttpClient::User
- * get username
- */
-TPtrC8 CHttpClient::User()
- {
- return iUser ? *iUser : KNullDesC8();
- }
-
-/**
- * CHttpClient::Password
- * get password
- */
-TPtrC8 CHttpClient::Password()
- {
- return iPassword ? *iPassword : KNullDesC8();
- }
-
-/**
- * CHttpClient::ReturnCode
- * get returned HTTP code
- */
-TInt CHttpClient::ReturnCode()
- {
- return iReturnCode;
- }
-
-/**
- * CHttpClient::ETag
- * get ETag
- */
-TPtrC8 CHttpClient::ETag()
- {
- return iEtag ? *iEtag : KNullDesC8();
- }
--- a/calendarengines/caldav/tsrc/CalDavTest.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,936 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Caldav Test Suite
-*
-*/
-
-#include "CalDavTest.h"
-#include <e32base.h>
-#include <e32std.h>
-#include <e32base.h>
-#include <calentry.h>
-#include <calentryview.h>
-#include <caleninterimutils2.h>
-#include <calcalendarinfo.h>
-#include <calsession.h>
-#include "caldavengine.h"
-#include "httpclient.h"
-#include <caldavsession.h>
-_LIT(KTextConsoleTitle, "Console");
-_LIT(KTextFailed, " failed, leave code = %d");
-_LIT(KTextPressAnyKey, " [press any key]\n");
-// Global Variables
-LOCAL_D CConsoleBase* console; // write all messages to this
-
-_LIT8(urlAries,"http://aries.demo.sun.com:3080/davserver/dav/home/modendahl@demo.sun.com/calendar/");
-_LIT8(urlAriesPrincipal,"http://aries.demo.sun.com:3080/davserver/dav/principals/modendahl/");
-_LIT8(urlAriesHome,"http://aries.demo.sun.com:3080/davserver/dav/home/modendahl@demo.sun.com/");
-_LIT8(urlWN,"http://whatsnew.demo.iplanet.com:3080/dav/home/modendahl/calendar/");
-_LIT8(userSUN,"modendahl");
-_LIT8(passwordSUN,"secret");
-_LIT8(urlGoogle,"https://www.google.com/calendar/dav/maximilian.odendahl@sun.com/events/");
-_LIT8(urlGooglePrincipal,"https://www.google.com/calendar/dav/maximilian.odendahl@sun.com/user/");
-_LIT8(userGoogle,"maximilian.odendahl@sun.com");
-_LIT8(passwordGoogle,"iplanetiplanet");
-_LIT8(urlChandler,"https://hub.chandlerproject.org/dav/mod/f16c9eb0-6373-11de-979e-cdd32d46e10a11111/");
-_LIT8(urlChandlerPrincipal,"https://hub.chandlerproject.org/dav/users/mod/");
-_LIT8(userChandler,"mod");
-_LIT8(passwordChandler,"modmod");
-_LIT8(urlBedework,"http://bedework.org:8585/ucaldav/user/testuser29/calendar/");
-_LIT8(urlBedeWorkPrincipal,"http://bedework.org:8585/ucaldav/principals/users/testuser29");
-_LIT8(userBedework,"testuser29");
-_LIT8(passwordbedework,"bedework");
-_LIT8(urlYahoo,"https://caldav.calendar.yahoo.com/dav/lkz633/Calendar/lkz633/");
-_LIT8(urlYahooPrincipal,"https://caldav.calendar.yahoo.com/principals/users/lkz633/");
-_LIT8(userYahoo,"lkz633");
-_LIT8(passwordYahoo,"iplanetiplanet");
-_LIT8(urlOracle,"http://kingsknight.sfbay.sun.com:7777/caldav/Sun/home/7B7B.65E6.user.6FCA54EE73AD4821811999F4D7679F6E000000000070%40email.invalid/calendars/MyCalendar");
-_LIT8(urlOraclePrincipal,"http://kingsknight.sfbay.sun.com:7777/caldav/Sun/principals/individuals/7B7B.65E6.user.6FCA54EE73AD4821811999F4D7679F6E000000000070%40email.invalid");
-_LIT8(userOracle,"symbian");
-_LIT8(passwordOracle,"Secret12");
-_LIT8(urlSogo,"http://sogo-demo.inverse.ca/SOGo/dav/sogo3/Calendar/personal/");
-_LIT8(userSogo,"sogo3");
-_LIT8(passwordSogo,"sogo3");
-_LIT8(urlDAV,"http://dhcp-usca15-127-168.red.iplanet.com/dav/calendar/");
-_LIT8(userDAV,"max");
-_LIT8(passwordDAV,"max");
-_LIT8(urlApple,"http://zeta.macosforge.org:8008/calendars/__uids__/1E872019-0078-412D-8EE0-85A5680365C2/calendar/");
-_LIT8(principalAplle,"http://zeta.macosforge.org:8008/calendars/__uids__/1E872019-0078-412D-8EE0-85A5680365C2/calendar/");
-_LIT8(userApple,"trial1");
-_LIT8(passwordApple,"lompywickets");
-_LIT8(urlKerio,"http://iop.test.kerio.com/calendars/iop.test.kerio.com/user1/Calendar");
-_LIT8(principalKerio,"http://iop.test.kerio.com/caldav/iop.test.kerio.com/user1/");
-_LIT8(userKerio,"user1");
-_LIT8(passwordkerio,"x");
-_LIT8(urlDaviCal,"http://dev.davical.org:8008/caldav.php/user1/home/");
-_LIT8(principalDaviCal,"http://dev.davical.org:8008/caldav.php/user1/");
-_LIT8(userDaviCal,"user1");
-_LIT8(passwordDaviCal,"user1");
-_LIT8(urlblabla,"http://www.blablabalbalabal.com/calendar/");
-_LIT8(passwordblabla,"bla");
-_LIT8(userblabla,"blabla");
-_LIT(calendar, "c:calendar12345");
-_LIT8(KFixedUIDics,"123456.ics");
-
-#define TWOSECONDS TTimeIntervalMicroSeconds32(2000000)
-
-void CreateCalFileL()
- {
- CCalSession* session = CCalSession::NewL();
- CleanupStack::PushL(session);
- TRAPD(err, session->CreateCalFileL(calendar));
- if (err == KErrAlreadyExists)
- {
- session->DeleteCalFileL(calendar);
- session->CreateCalFileL(calendar);
- }
- CleanupStack::PopAndDestroy(session);
- }
-
-void DeleteCalFileL()
- {
- CCalSession* session = CCalSession::NewL();
- CleanupStack::PushL(session);
- session->DeleteCalFileL(calendar);
- CleanupStack::PopAndDestroy(session);
- }
-
-TBool GetBoolFromProperties2(CCalCalendarInfo* info, const TDesC8 &aKey)
- {
- TBool boolean;
- TPckgC<TBool> pckgboolean(boolean);
- pckgboolean.Set(info->PropertyValueL(aKey));
- return pckgboolean();
- }
-
-TCalTime GetTimeFromProperties2(CCalCalendarInfo* info, const TDesC8 &aKey)
- {
- TCalTime time;
- TPckgC<TCalTime> pckgtime(time);
- pckgtime.Set(info->PropertyValueL(aKey));
- return pckgtime();
- }
-
-void NewApptL(HBufC8* aUid, TBool aEvent, CCalEntryView* iCalEntryView)
- {
- CCalEntry* appt = CCalEntry::NewL(aEvent ? CCalEntry::EEvent
- : CCalEntry::ETodo, aUid, CCalEntry::EMethodNone, 0);
- CleanupStack::PushL(appt);
-
- //Some data
- TBuf16<100> summary;
- summary.Copy(*aUid);
- appt->SetSummaryL(summary);
- appt->SetLocationL(_L("Location2"));
- appt->SetDescriptionL(_L("Description3"));
-
- //Start / end date
- TTime start;
- start.UniversalTime();
- TTime end;
- end.UniversalTime();
- TCalTime startCalTime;
- startCalTime.SetTimeUtcL(start);
- TCalTime endCalTime;
- endCalTime.SetTimeUtcL(end);
-
- //Set it
- appt->SetStartAndEndTimeL(startCalTime, endCalTime);
-
- //Store this new Entry
-
- RPointerArray<CCalEntry> entryArray;
- CleanupClosePushL(entryArray);
- entryArray.AppendL(appt);
- TInt success(0);
- iCalEntryView->StoreL(entryArray, success);
- entryArray.Reset();
- CleanupStack::PopAndDestroy(&entryArray);
- CleanupStack::PopAndDestroy(appt);
- }
-
-CalDavTest::CalDavTest(CConsoleBase* console)
- {
- iConsole = console;
- TInt connect = iFileLogger.Connect();
- TTime home;
- home.UniversalTime();
- _LIT(KDateFormat,"%H%T%S");
- TBuf<20> StringTime;
- home.FormatL(StringTime, KDateFormat);
- StringTime.Append(_L(".txt"));
- iFileLogger.CreateLog(_L("CalDav"),StringTime, EFileLoggingModeOverwrite);
- }
-
-CalDavTest::~CalDavTest()
- {
- iFileLogger.CloseLog();
- iFileLogger.Close();
- }
-
-void CalDavTest::Write(TBool aSuccess, const char* aMessage)
- {
- TBuf<500> buffer;
- TPtrC8 ptr(reinterpret_cast<const TUint8*> (aMessage));
- buffer.Copy(ptr);
-
- Write(aSuccess, buffer);
- }
-
-void CalDavTest::Write(TBool aSuccess, const TDesC &aMessage)
- {
- // convert char* into tbug
- TBuf<500> buffer;
- buffer.Append(aMessage);
-
- if (aSuccess)
- buffer.Append(_L("....PASSED\n"));
- else
- buffer.Append(_L("....FAILED\n"));
-
- // write to console and file
- Write(buffer);
- }
-
-void CalDavTest::TestClientServerL(TInt aSucces, const TDesC8 &aUrl,
- const TDesC8 &aUser, const TDesC8 &aPassword)
- {
- TBuf16<500> url;
- url.Copy(aUrl);
- Write(_L("\n\nStarting CalDav client-server test..."));
- Write(url);
-
- CreateCalFileL();
-
- CCalDavSession *server = CCalDavSession::NewLC();
- iSession = server;
-
- if (ConfigureSessionL(aSucces, aUrl, aUser, aPassword) == KErrNone)
- {
- OptionSession();
- }
-
- CleanupStack::PopAndDestroy(server);
- iSession = NULL;
- DeleteCalFileL();
-
- Write(_L("\nFinished CalDav client-server test..."));
- Write(_L("\n\n"));
- }
-
-void CalDavTest::TestGeneralEngineL()
- {
- CreateCalFileL();
- CCalDavEngine* store = CCalDavEngine::NewLC(calendar);
- iEngine = store;
-
- CalendarInfoL();
- GetUIDByUrl();
- GetBaseUrl();
-
- CleanupStack::PopAndDestroy(store);
- iEngine = NULL;
- DeleteCalFileL();
- }
-
-void CalDavTest::TestEngineL(TInt aSucces, const TDesC8 &aUrl,
- const TDesC8 &aUser, const TDesC8 &aPassword, TBool aWebdavsync,
- TBool aCtag, TBool aEvent, TBool aTodo, TBool aFreeBusy, TBool aJournal)
- {
- Write(_L("\n\nStarting CalDav Engine test..."));
- TBuf16<500> url;
- url.Copy(aUrl);
- Write(url);
- Write(_L("\n"));
-
- CreateCalFileL();
-
- CCalDavEngine* store = CCalDavEngine::NewLC(calendar);
-
- iEngine = store;
- iWebdavSync = aWebdavsync;
- iCtag = aCtag;
-
- iVEVENT = aEvent;
- iVTODO = aTodo;
- iVFREEBUSY = aFreeBusy;
- iVJOURNAL = aJournal;
-
- Write(_L("\n\nStarting init and option tests...\n"));
-
- Enabled(EFalse);
- if (EnableL(aSucces, aUrl, aUser, aPassword) == KErrNone)
- {
- Enabled(ETrue);
- OptionsL();
- CTagL(ETrue);
- SynctokenL(ETrue);
-
- /******* Test events ******/
- Write(_L("\nStarting VEvent engine tests...\n\n"));
-
- HBufC8* newuid = iEngine->iCalIntermimUtils2->GlobalUidL();
- // need to save it, as it will be destroyed by CCalEntry::NewL
- TBuf8<100> uid;
- uid.Append(*newuid);
- // does entry exists locally
- DoesExistL(EFalse, uid);
- // add new local event with UID
- NewApptL(newuid, ETrue, iEngine->iCalEntryView);
- // does entry exists locally
- DoesExistL(ETrue, uid);
-
- // send to server using handle
- unsigned long local = iEngine->DoesEntryExistL(uid);
- // send existing event to server
- SendL(local);
- // available on server
- if (iEngine->iOptions.VEVENT)
- {
- HeadL(ETrue, uid);
- //download from server
- DownloadLGetL(local);
- DownloadLMultiGetL(local);
- // delete on server
- DeleteServerL(local);
- // available on server
- HeadL(EFalse, uid);
- }
- else
- HeadL(EFalse, uid);
-
- // delete locally
- DeleteClientL(uid);
- // should be gone now
- DoesExistL(EFalse, uid);
- /**************************/
-
- CTagL(!iEngine->iOptions.VEVENT);
- SynctokenL(!iEngine->iOptions.VEVENT);
-
- User::After(TWOSECONDS);
- SyncL();
-
- CTagL(ETrue);
- SynctokenL(ETrue);
-
- // test synchronization method, put/delete on server using http calls
- if (iEngine->iOptions.VEVENT)
- {
- Write(_L("\nStarting VEvent http and sync tests...\n\n"));
- // create directly on server using only http calls
- SendL(ETrue);
- // we should not have this yet
- DoesExistL(EFalse, KFixedUIDics);
- User::After(TWOSECONDS);
- SyncL();
- // now we should
- DoesExistL(ETrue, KFixedUIDics);
- // delete directly on server
- DeleteServerL();
- // we should still have it
- DoesExistL(ETrue, KFixedUIDics);
- User::After(TWOSECONDS);
- SyncL();
- // now it should be gone locally
- DoesExistL(EFalse, KFixedUIDics);
- }
-
- /******* Test VTodo ******/
-
- Write(_L("\n\nStarting VTodo tests...\n\n"));
-
- HBufC8* newuid2 = iEngine->iCalIntermimUtils2->GlobalUidL();
- // need to save it, as it will be destroyed by CCalEntry::NewL
- TBuf8<100> uid2;
- uid2.Append(*newuid2);
- // does entry exists locally
- DoesExistL(EFalse, uid2);
- // add new local event with UID
- NewApptL(newuid2, EFalse, iEngine->iCalEntryView);
- // does entry exists locally
- DoesExistL(ETrue, uid2);
-
- // send to server using handle
- unsigned long local2 = iEngine->DoesEntryExistL(uid2);
- // send existing event to server
- SendL(local2);
-
- if (iEngine->iOptions.VTODO)
- {
- // available on server
- HeadL(ETrue, uid2);
- //download from server
- DownloadLGetL(local2);
- DownloadLMultiGetL(local2);
- // delete on server
- DeleteServerL(local2);
- // available on server
- HeadL(EFalse, uid2);
- }
- else
- HeadL(EFalse, uid2);
- // delete locally
- DeleteClientL(uid2);
- // should be gone now
- DoesExistL(EFalse, uid2);
- /**************************/
-
- CTagL(!iEngine->iOptions.VTODO);
- SynctokenL(!iEngine->iOptions.VTODO);
-
- // test synchronization method, put/delete on server using http calls
- if (iEngine->iOptions.VTODO)
- {
- Write(_L("\nStarting VTodo http and sync tests...\n\n"));
- // create directly on server using only http calls
- SendL(EFalse);
- // we should not have this yet
- DoesExistL(EFalse, KFixedUIDics);
- User::After(TWOSECONDS);
- SyncL();
- // now we should
- DoesExistL(ETrue, KFixedUIDics);
- // delete directly on server
- DeleteServerL();
- // we should still have it
- DoesExistL(ETrue, KFixedUIDics);
- User::After(TWOSECONDS);
- SyncL();
- // now it should be gone locally as well
- DoesExistL(EFalse, KFixedUIDics);
- }
-
- /**** Test Calendar ******/
- /*
- // creating calendars under home calendar should not be allowed
- if (iEngine->iOptions.MKCALENDAR)
- {
- Write(_L("\n\nStarting Calendar tests...\n\n"));
- _LIT8(howareyou, "howareyoudoingtoday");
- MkCalendarL(KErrNone, howareyou);
- MkCalendarL(KErrArgument, howareyou);
- DeleteCalendarL(howareyou);
- }
- */
- /**************************/
- iEngine->DisableL();
- }
-
- CleanupStack::PopAndDestroy(store);
- iEngine = NULL;
- DeleteCalFileL();
-
- Write(_L("\n\nFinished CalDav Engine test..."));
- Write(_L("\n\n"));
- }
-
-void CalDavTest::Write(const TDesC &aMessage)
- {
- iConsole->Write(aMessage);
- iFileLogger.Write(aMessage);
- }
-
-void CalDavTest::Enabled(TBool aEnabled)
- {
- Write(iEngine->EnabledSync() == aEnabled, __FUNCTION__);
- }
-
-void CalDavTest::DoesExistL(TBool aExists, const unsigned long localuid)
- {
- CCalEntry* entry = iEngine->iCalEntryView->FetchL(localuid);
- CleanupStack::PushL(entry);
- unsigned long uid = iEngine->DoesEntryExistL(entry->UidL());
- Write(aExists ? uid > 0 : uid == 0, __FUNCTION__);
-
- CleanupStack::PopAndDestroy(entry);
- }
-
-void CalDavTest::DoesExistL(TBool aExists, const TDesC8 &aUID)
- {
- unsigned long uid = iEngine->DoesEntryExistL(aUID);
- Write(aExists ? uid > 0 : uid == 0, __FUNCTION__);
- }
-
-void CalDavTest::HeadL(TBool aExists, const TDesC8 &aUid)
- {
- TBool del = iEngine->HeadL(aUid) == OK;
- Write(aExists == del, __FUNCTION__);
- }
-
-void CalDavTest::MkCalendarL(TInt aSuccess, const TDesC8 &aName)
- {
- TInt ret = iEngine->MkcalendarL(aName);
- Write(ret == aSuccess, __FUNCTION__);
- }
-
-void CalDavTest::DeleteCalendarL(const TDesC8 &aName)
- {
- Write(iEngine->DeleteCalendarL(aName) == KErrNone, __FUNCTION__);
- }
-
-void CalDavTest::OptionsL()
- {
- TBuf<500> message;
- message.Append(_L("Options Displayname "));
- CCalCalendarInfo* info = iEngine->iCalSession->CalendarInfoL();
- TBuf<500> display;
- display.Copy(info->NameL());
- message.Append(display);
- delete info;
- Write(display != KNullDesC, message);
- Write(iEngine->iOptions.sync_collection == iWebdavSync, _L("Options Webdav Sync"));
- Write(iEngine->iOptions.sync_ctag == iCtag, _L("Options Ctag"));
- Write(iEngine->iOptions.VEVENT == iVEVENT, _L("Options VEVENT"));
- Write(iEngine->iOptions.VTODO == iVTODO, _L("Options VTODO"));
- Write(iEngine->iOptions.VFREEBUSY == iVFREEBUSY, _L("FREEBUSY"));
- Write(iEngine->iOptions.VJOURNAL == iVJOURNAL, _L("VJOURNAL"));
- }
-
-void CalDavTest::CalendarInfoL()
- {
- _LIT8(user,"user");
- _LIT8(password,"pass");
- _LIT8(url,"http://neindanke/");
- iEngine->SetUserL(user);
- iEngine->SetUrlL(url);
- iEngine->SetPasswordL(password);
- iEngine->SetSyncIntervalL(TTimeIntervalMinutes(5));
- iEngine->SetPastDaysL(TTimeIntervalDays(10));
- iEngine->SetKeepServerEntryL(EFalse);
- iEngine->SetImmediateSyncL(ETrue);
- iEngine->EnableL();
-
- iEngine->iCalSession = CCalSession::NewL();
- iEngine->iCalSession->OpenL(calendar);
-
- CCalCalendarInfo* calendarInfo = iEngine->iCalSession->CalendarInfoL();
- CleanupStack::PushL(calendarInfo);
-
- Write(!GetBoolFromProperties2(calendarInfo, KCaldavEnabled), _L("CalendarInfo: enabled"));
- Write(!GetBoolFromProperties2(calendarInfo, KCaldavKeepServer), _L("CalendarInfo: Keepserver"));
- Write(GetBoolFromProperties2(calendarInfo, KCaldavImmediateSync), _L("CalendarInfo: ImmediateSync"));
- Write(calendarInfo->PropertyValueL(KCaldavUrl) == url, _L("CalendarInfo: url"));
- Write(calendarInfo->PropertyValueL(KCaldavUser) == user, _L("CalendarInfo: user"));
- Write(calendarInfo->PropertyValueL(KCaldavPassword) == password, _L("CalendarInfo: password"));
-
- TTimeIntervalDays pastday;
- TPckgC<TTimeIntervalDays> pastdays(pastday);
- pastdays.Set(calendarInfo->PropertyValueL(KCaldavPastDays));
- Write(TTimeIntervalDays(10) == pastdays(), _L("CalendarInfo: pastdays"));
-
- TTimeIntervalMinutes syncintervals;
- TPckgC<TTimeIntervalMinutes> syncinterval(syncintervals);
- syncinterval.Set(calendarInfo->PropertyValueL(KCaldavSyncInterval));
- Write(TTimeIntervalMinutes(5) == syncinterval(), _L("CalendarInfo: syncinterval"));
-
- /*
- Write(calendarInfo->PropertyValueL(KCaldavSynctoken) ==KNullDesC8, _L("CalendarInfo: SyncToken"));
- Write(calendarInfo->PropertyValueL(KCaldavCtag) == KNullDesC8, _L("CalendarInfo: CTag"));
- Write(GetTimeFromProperties2(calendarInfo,KCaldavTime).TimeUtcL()== TCalTime().TimeUtcL(), _L("CalendarInfo: LastTime"));
- */
-
- // access point
- CleanupStack::PopAndDestroy(calendarInfo);
-
- delete iEngine->iCalSession;
- iEngine->iCalSession = NULL;
- }
-
-void CalDavTest::GetUIDByUrl()
- {
- _LIT8(url,"1234");
- _LIT8(url1,"/hi/1234.ics");
- _LIT8(url2,"/1234.ics");
- _LIT8(url3,"1234.ics");
- _LIT8(url4,"1234");
-
- Write(iEngine->GetUIDByUrl(url1) == url, __FUNCTION__);
- Write(iEngine->GetUIDByUrl(url2) == url, __FUNCTION__);
- Write(iEngine->GetUIDByUrl(url3) == url, __FUNCTION__);
- Write(iEngine->GetUIDByUrl(url4) == url, __FUNCTION__);
- }
-
-void CalDavTest::GetBaseUrl()
- {
- _LIT8(url1,"http://www.ok.de/1234.ics");
- _LIT8(url,"http://www.ok.de");
- _LIT8(url2,"https://www.ok.de:80/123444444.ics");
- _LIT8(urlport,"https://www.ok.de:80");
-
- iEngine->GetBaseUrl(url1);
- Write(*iEngine->iBaseUrl == url, __FUNCTION__);
-
- iEngine->GetBaseUrl(url2);
- Write(*iEngine->iBaseUrl == urlport, __FUNCTION__);
- }
-
-void CalDavTest::CTagL(TBool aEqual)
- {
- if (iEngine->iOptions.sync_ctag && !iEngine->iOptions.sync_collection)
- {
- HBufC8* tag = iEngine->GetCTagL();
- Write(aEqual ? *tag == *iEngine->iCTag : *tag != *iEngine->iCTag, _L("CTag"));
- if (aEqual && (*tag != *iEngine->iCTag))
- {
- TBuf<500> name;
- name.Append(_L("saved cTag: "));
- TBuf<100> one;
- one.Copy(*iEngine->iCTag);
- name.Append(one);
- name.Append(_L(" current server cTag: "));
- TBuf<100> two;
- two.Copy(*tag);
- name.Append(two);
- Write(ETrue, name);
- }
- delete tag;
- }
- }
-
-void CalDavTest::SynctokenL(TBool aEqual)
- {
- if (iEngine->iOptions.sync_collection)
- {
- HBufC8* tag = iEngine->GetSyncTokenL();
- Write(aEqual ? *tag == *iEngine->iSynctoken : *tag
- != *iEngine->iSynctoken, _L("SyncToken"));
- if (aEqual && (*tag != *iEngine->iSynctoken))
- {
- TBuf<500> name;
- name.Append(_L("saved Syntoken: "));
- TBuf<100> one;
- one.Copy(*iEngine->iSynctoken);
- name.Append(one);
- name.Append(_L(" current server Synctoken: "));
- TBuf<100> two;
- two.Copy(*tag);
- name.Append(two);
- Write(ETrue, name);
- }
- delete tag;
- }
- }
-
-void CalDavTest::SendL(const unsigned long localuid)
- {
- Write(iEngine->UploadEntryL(localuid, MCalChangeCallBack2::EChangeAdd,
- MCalChangeCallBack2::EChangeEntryAll) == KErrNone, __FUNCTION__);
- }
-
-void CalDavTest::SendL(TBool aVEvent)
- {
- TBuf8<500> url;
- url.Append(*iEngine->iUrl);
- url.Append(KFixedUIDics);
- _LIT8(KEntry1, "BEGIN:VCALENDAR\r\n"
- "PRODID:Symbian\r\n"
- "VERSION:2.0\r\n"
- "BEGIN:VEVENT\r\n"
- "UID:123456\r\n"
- "SUMMARY:first entry\r\n"
- "DESCRIPTION:a description\r\n"
- "DTSTAMP:20100411T100000Z\r\n"
- "DTSTART:20100411T100000Z\r\n"
- "DTEND:20100412T120000Z\r\n"
- "END:VEVENT\r\n"
- "END:VCALENDAR\r\n");
- _LIT8(KEntry2, "BEGIN:VCALENDAR\r\n"
- "PRODID:Symbian\r\n"
- "VERSION:2.0\r\n"
- "BEGIN:VTODO\r\n"
- "DTSTAMP:20100205T235335Z\r\n"
- "DUE;VALUE=DATE:20110104\r\n"
- "SUMMARY:Task #1\r\n"
- "UID:123456\r\n"
- "END:VTODO\r\n"
- "END:VCALENDAR\r\n");
-
- CBufFlat* response = CBufFlat::NewL(500);
- CleanupStack::PushL(response);
- TInt Ret = iEngine->iHttp->PutL(url, aVEvent ? KEntry1() : KEntry2(),
- response);
- CleanupStack::PopAndDestroy(response);
-
- if (Ret==PRECONDFAILED)
- {
- //might be still there from an older run
- TBuf8<500> url;
- url.Append(*iEngine->iUrl);
- url.Append(KFixedUIDics);
- iEngine->iHttp->DeleteL(url);
-
- CBufFlat* response = CBufFlat::NewL(500);
- CleanupStack::PushL(response);
- Ret = iEngine->iHttp->PutL(url, aVEvent ? KEntry1() : KEntry2(),
- response);
- CleanupStack::PopAndDestroy(response);
-
- // locally as well maybe:
- iEngine->DeleteLocalEntryL(KFixedUIDics);
- }
- Write((Ret == CREATED) || (Ret == NOCONTENT) || (Ret == OK), __FUNCTION__);
- }
-
-void CalDavTest::SyncL()
- {
- Write(iEngine->SyncL(), __FUNCTION__);
- }
-
-void CalDavTest::DownloadLGetL(const unsigned long localuid)
- {
- TInt aPos = iEngine->iLocalUidArray.Find(localuid);
- if (aPos != KErrNotFound)
- Write(iEngine->DownloadEntryL(iEngine->iGlobalUidArray[aPos])
- == KErrNone, __FUNCTION__);
- else
- Write(EFalse, __FUNCTION__);
- }
-void CalDavTest::DownloadLMultiGetL(const unsigned long localuid)
- {
- if (iEngine->iOptions.MULTIGET)
- {
- TInt aPos = iEngine->iLocalUidArray.Find(localuid);
- if (aPos != KErrNotFound)
- {
- TBuf8<500> url;
- url.Append(iEngine->iUrl->Mid(iEngine->iBaseUrl->Length()));
- url.Append(iEngine->iGlobalUidArray[aPos]);
- url.Append(KIcs);
- CDesC8ArrayFlat *multiget = new (ELeave) CDesC8ArrayFlat(4);
- CleanupStack::PushL(multiget);
- multiget->AppendL(url);
- multiget->AppendL(url);
- Write(iEngine->DownloadEntryL(multiget) == KErrNone, __FUNCTION__);
- multiget->Reset();
- CleanupStack::PopAndDestroy(multiget);
- }
- else
- Write(EFalse, __FUNCTION__);
- }
- }
-
-TInt CalDavTest::ConfigureSessionL(TInt aSucces, const TDesC8 &aUrl,
- const TDesC8 &aUser, const TDesC8 &aPassword)
- {
- iSession->SetUrl(calendar, aUrl);
- iSession->SetUsername(calendar, aUser);
- iSession->SetPassword(calendar, aPassword);
- TInt ret = iSession->Enable(calendar);
- Write(ret == aSucces, __FUNCTION__);
- return ret;
- }
-
-void CalDavTest::OptionSession()
- {
- TTimeIntervalDays pastdays = 0;
- TTimeIntervalMinutes syncinterval = 0;
- TBool immediatesync = EFalse;
- TBool keepserverentry = EFalse;
- TBuf8<500> url, username, password;
-
- // retreive standard values
- iSession->PastDays(calendar, pastdays);
- iSession->SyncInterval(calendar, syncinterval);
- iSession->ImmediateSync(calendar, immediatesync);
- iSession->KeepServerEntry(calendar, keepserverentry);
- iSession->Url(calendar, url);
- iSession->Username(calendar, username);
- iSession->Password(calendar, password);
-
- Write(pastdays.Int() == DEFAULT_PAST_DAYS, __FUNCTION__);
- Write(syncinterval.Int() == DEFAULT_SYNC_MINUTES, __FUNCTION__);
- Write(immediatesync, __FUNCTION__);
- Write(keepserverentry, __FUNCTION__);
- Write(url == urlAries, __FUNCTION__);
- Write(password == passwordSUN, __FUNCTION__);
- Write(username == userSUN, __FUNCTION__);
-
- // set new values
- pastdays = TTimeIntervalDays(100);
- syncinterval = TTimeIntervalMinutes(4);
- immediatesync = EFalse;
- keepserverentry = EFalse;
- iSession->SetPastDays(calendar, pastdays);
- iSession->SetSyncInterval(calendar, syncinterval);
- iSession->SetImmediateSync(calendar, immediatesync);
- iSession->SetKeepServerEntry(calendar, keepserverentry);
- iSession->SetUrl(calendar, urlGooglePrincipal);
- iSession->SetUsername(calendar, userGoogle);
- iSession->SetPassword(calendar, passwordGoogle);
-
- // check if new values are set correctly
- TTimeIntervalDays pastdays1(10000);
- TTimeIntervalMinutes syncinterval1(4000);
- TBool immediatesync1 = ETrue;
- TBool keepserverentry1 = ETrue;
- TBuf8<500> url1, username1, password1;
-
- iSession->PastDays(calendar, pastdays1);
- iSession->SyncInterval(calendar, syncinterval1);
- iSession->ImmediateSync(calendar, immediatesync1);
- iSession->KeepServerEntry(calendar, keepserverentry1);
- iSession->Url(calendar, url1);
- iSession->Username(calendar, username1);
- iSession->Password(calendar, password1);
-
- Write(pastdays1.Int() == 100, __FUNCTION__);
- Write(syncinterval1.Int() == 4, __FUNCTION__);
- Write(!immediatesync1, __FUNCTION__);
- Write(!keepserverentry1, __FUNCTION__);
- Write(url1 == urlGooglePrincipal, __FUNCTION__);
- Write(username1 == userGoogle, __FUNCTION__);
- Write(password1 == passwordGoogle, __FUNCTION__);
- }
-
-TInt CalDavTest::EnableL(TInt aSucces, const TDesC8 &aUrl, const TDesC8 &aUser,
- const TDesC8 &aPassword)
- {
- iEngine->SetUrlL(aUrl);
- iEngine->SetUserL(aUser);
- iEngine->SetPasswordL(aPassword);
- TInt ret = iEngine->EnableL();
- Write(ret == aSucces, __FUNCTION__);
- return ret;
- }
-
-void CalDavTest::DeleteServerL(const unsigned long localuid)
- {
- Write(iEngine->DeleteEntryL(localuid) == KErrNone, __FUNCTION__);
- }
-
-void CalDavTest::DeleteServerL()
- {
- TBuf8<500> url;
- url.Append(*iEngine->iUrl);
- url.Append(KFixedUIDics);
- TInt Return = iEngine->iHttp->DeleteL(url);
- Write((Return == NOCONTENT) || (Return == OK), __FUNCTION__);
- }
-
-void CalDavTest::DeleteClientL(const TDesC8 &aUid)
- {
- Write(iEngine->DeleteLocalEntryL(aUid) == KErrNone, __FUNCTION__);
- }
-
-LOCAL_C void DoStartL()
- {
-
- CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
- CleanupStack::PushL(scheduler);
- CActiveScheduler::Install(scheduler);
-
- for (TInt i = 0; i <= 10; i++)
- {
- CalDavTest* aTest = new (ELeave) CalDavTest(console);
-
- aTest->TestClientServerL(KErrNone, urlAries, userSUN, passwordSUN);
- aTest->TestClientServerL(KErrArgument, urlblabla, userblabla,
- passwordblabla);
-
- aTest->TestGeneralEngineL();
-
- //Test syntax: (url, username,password,webdav sync,ctag, aEvent, aTodo, aFreeBusy, aJournal)
-
- aTest->TestEngineL(KErrNone, urlWN, userSUN, passwordSUN, ETrue, ETrue,
- ETrue, ETrue, ETrue, EFalse);
-
- aTest->TestEngineL(KErrNone, urlAriesHome, userSUN, passwordSUN, ETrue,
- ETrue, ETrue, ETrue, ETrue, EFalse);
- aTest->TestEngineL(KErrNone, urlAries, userSUN, passwordSUN, ETrue,
- ETrue, ETrue, ETrue, ETrue, EFalse);
- aTest->TestEngineL(KErrNone, urlAriesPrincipal, userSUN, passwordSUN,
- ETrue, ETrue, ETrue, ETrue, ETrue, EFalse);
-
- aTest->TestEngineL(KErrNone, urlApple, userApple, passwordApple,
- EFalse, ETrue, ETrue, ETrue, ETrue, ETrue);
- aTest->TestEngineL(KErrNone, principalAplle, userApple, passwordApple,
- EFalse, ETrue, ETrue, ETrue, ETrue, ETrue);
-
- aTest->TestEngineL(KErrNone, urlGoogle, userGoogle, passwordGoogle,
- EFalse, ETrue, ETrue, EFalse, EFalse, EFalse);
- aTest->TestEngineL(KErrNone, urlGooglePrincipal, userGoogle,
- passwordGoogle, EFalse, ETrue, ETrue, EFalse, EFalse, EFalse);
-
- aTest->TestEngineL(KErrNone, urlChandler, userChandler,
- passwordChandler, EFalse, ETrue, ETrue, ETrue, ETrue, ETrue);
- aTest->TestEngineL(KErrNone, urlChandlerPrincipal, userChandler,
- passwordChandler, EFalse, ETrue, ETrue, ETrue, ETrue, ETrue);
-
- aTest->TestEngineL(KErrNone, urlOracle, userOracle, passwordOracle,
- EFalse, ETrue, ETrue, ETrue, EFalse, EFalse);
- aTest->TestEngineL(KErrNone, urlOraclePrincipal, userOracle,
- passwordOracle, EFalse, ETrue, ETrue, ETrue, EFalse, EFalse);
-
- aTest->TestEngineL(KErrNone, urlSogo, userSogo, passwordSogo, EFalse,
- ETrue, ETrue, ETrue, EFalse, EFalse);
- aTest->TestEngineL(KErrNone, urlDAV, userDAV, passwordDAV, EFalse,
- EFalse, ETrue, ETrue, EFalse, EFalse);
-
- aTest->TestEngineL(KErrNone, urlYahoo, userYahoo, passwordYahoo,
- EFalse, ETrue, ETrue, EFalse, ETrue, EFalse);
- aTest->TestEngineL(KErrNone, urlYahooPrincipal, userYahoo,
- passwordYahoo, EFalse, ETrue, ETrue, EFalse, ETrue, EFalse);
-
- aTest->TestEngineL(KErrNone, urlDaviCal, userDaviCal, passwordDaviCal,
- EFalse, ETrue, ETrue, ETrue, ETrue, ETrue);
- aTest->TestEngineL(KErrNone, principalDaviCal, userDaviCal,
- passwordDaviCal, EFalse, ETrue, ETrue, ETrue, ETrue, ETrue);
-
- aTest->TestEngineL(KErrNone, urlKerio, userKerio, passwordkerio,
- EFalse, ETrue, ETrue, ETrue, ETrue, EFalse);
- aTest->TestEngineL(KErrNone, principalKerio, userKerio, passwordkerio,
- EFalse, ETrue, ETrue, ETrue, ETrue, EFalse);
-
- aTest->TestEngineL(KErrNone, urlBedework, userBedework,
- passwordbedework, EFalse, ETrue, ETrue, ETrue,
- EFalse, EFalse);
- aTest->TestEngineL(KErrNone, urlBedeWorkPrincipal, userBedework,
- passwordbedework, EFalse, ETrue, ETrue, ETrue,
- EFalse, EFalse);
-
- aTest->TestEngineL(KErrArgument, urlAries, userSUN, passwordblabla,
- ETrue, ETrue, ETrue, ETrue, ETrue, EFalse);
-
- aTest->TestEngineL(KErrArgument, urlblabla, userblabla, passwordblabla,
- EFalse, EFalse, ETrue, ETrue, EFalse, EFalse);
-
- delete aTest;
- }
-
- // Delete active scheduler
- CleanupStack::PopAndDestroy(scheduler);
- }
-
-// Global Functions
-GLDEF_C TInt E32Main()
- {
- __UHEAP_MARK;
- CTrapCleanup* cleanup = CTrapCleanup::New();
- TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(
- KConsFullScreen, KConsFullScreen)));
- if (createError)
- return createError;
- TRAPD(mainError, DoStartL());
- if (mainError)
- console->Printf(KTextFailed, mainError);
- console->Printf(KTextPressAnyKey);
- console->Getch();
-
- delete console;
- delete cleanup;
- __UHEAP_MARKEND;
- return KErrNone;
- }
-
--- a/calendarengines/group/bld.inf Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarengines/group/bld.inf Wed Oct 13 14:30:35 2010 +0300
@@ -28,9 +28,6 @@
#include "../calenimp/group/bld.inf"
#include "../calenlauncher/group/bld.inf"
-#ifdef FF_CALDAV_SUPPORT
-#include "../caldav/group/bld.inf"
-#endif //FF_CALDAV_SUPPORT
PRJ_TESTMMPFILES
--- a/calendarui/caldav/data/2002B503.rss Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: registration file for Caldav ECOM plugin
-*
-*/
-
-#ifndef CALENCALDAVPLUGINREG_H
-#define CALENCALDAVPLUGINREG_H
-
-
-#include "CalDavUids.h"
-#include "caldav.loc"
-
-#include <ecom/registryinfo.rh>
-#include <calendar.loc>
-
-RESOURCE REGISTRY_INFO registry_info
- {
- dll_uid = CALENCALDAVPLUGIN_DLL_UID;
- interfaces =
- {
- INTERFACE_INFO
- {
- interface_uid = CALENUIPLUGININTERFACE_ECOM_INTERFACE_UID;
- implementations =
- {
- IMPLEMENTATION_INFO
- {
- implementation_uid = CALEN_CALDAV_IMPLEMENTATION_UID;
- version_no = 1;
- display_name = qtn_caldav;
- default_data = "language(*)";
- opaque_data = "";
- }
- };
- }
- };
- }
-
-#endif
-// End of file
--- a/calendarui/caldav/data/caldav.loc Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: caldav user interface strings
-*
-*/
-
-#define qtn_caldav "CalDAV Synchronisation"
-
-#define qtn_caldav_query_disconnect "This change will disable synchronisation. Do you want to continue?"
-#define qtn_caldav_query_fail "Synchronization could not be enabled. Please check url, username and password"
-#define qtn_caldav_query_success "Synchronization was enabled successfully."
-
-#define qtn_caldav_access_point "Access Point"
-
-#define qtn_caldav_username "Username"
-#define qtn_caldav_url "Url"
-#define qtn_caldav_password "Password"
-#define qtn_caldav_syncinterval "Sync Interval"
-
-#define qtn_caldav_conflictaction "Conflict resolution"
-#define qtn_caldav_keep_server "Keep server"
-#define qtn_caldav_keep_device "Keep device"
-
-#define qtn_caldav_immediatesync "New entries"
-#define qtn_caldav_immediatesync_yes "Sync immediatly"
-#define qtn_caldav_immediatesync_no "Wait until next sync"
-
-#define qtn_caldav_enable "Enabled synchronization"
-#define qtn_caldav_yes "Yes"
-#define qtn_caldav_no "No"
-
-#define qtn_caldav_range "Time range"
-#define qtn_caldav_range_two "2 weeks back"
-#define qtn_caldav_range_three "3 month back"
-#define qtn_caldav_range_six "6 month back"
-#define qtn_caldav_range_all "all events"
-
-#define qtn_caldav_time "Sync interval"
-
-#define qtn_caldav_time_always "Always on"
-#define qtn_caldav_time_one "One minute"
-#define qtn_caldav_time_five "Five minutes"
-#define qtn_caldav_time_fifteen "Fifteen minutes"
-#define qtn_caldav_time_thirty "Thirty minutes"
--- a/calendarui/caldav/data/calencaldavpluginData.rss Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,351 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Caldav ECOM plugin resource file
-*
-*/
-
-#include <eikon.rh>
-#include <avkon.hrh>
-#include <avkon.rh>
-#include <avkon.rsg>
-
-#include <Calendar.loc>
-#include "caldav.loc"
-
-NAME CLU2
-
-RESOURCE RSS_SIGNATURE { }
-
-
-
-RESOURCE TBUF r_caldav
- {
- buf = qtn_caldav;
- }
-
-RESOURCE TBUF r_caldav_query_disconnect
- {
- buf = qtn_caldav_query_disconnect;
- }
-
-RESOURCE TBUF r_caldav_query_fail
- {
- buf = qtn_caldav_query_fail;
- }
-
-RESOURCE TBUF r_caldav_query_success
- {
- buf = qtn_caldav_query_success;
- }
-
-RESOURCE DIALOG r_query
- {
- flags = EGeneralQueryFlags;
- buttons = R_AVKON_SOFTKEYS_YES_NO;
- title = qtn_caldav;
- items =
- {
- DLG_LINE
- {
- type = EAknCtQuery;
- id = EGeneralQuery;
- control = AVKON_CONFIRMATION_QUERY
- {
- layout = EConfirmationQueryLayout;
- animation = R_QGN_NOTE_INFO_ANIM;
- };
- }
- };
- }
-
-RESOURCE TBUF r_caldav_access_point
- {
- buf = qtn_caldav_access_point;
- }
-
-RESOURCE TBUF r_caldav_username
- {
- buf = qtn_caldav_username;
- }
-
-RESOURCE TBUF r_caldav_url
- {
- buf = qtn_caldav_url;
- }
-
-RESOURCE TBUF r_caldav_password
- {
- buf = qtn_caldav_password;
- }
-
-RESOURCE TBUF r_caldav_syncinterval
- {
- buf = qtn_caldav_syncinterval;
- }
-
-RESOURCE AVKON_SETTING_PAGE r_url_setting_page
-{
- type = EEikCtEdwin;
- editor_resource_id = r_url_editor_resource;
-}
-
-RESOURCE EDWIN r_url_editor_resource
- {
- maxlength = 255;
- default_case = EAknEditorTextCase;
- allowed_case_modes = EAknEditorAllCaseModes;
- numeric_keymap = EAknEditorStandardNumberModeKeymap;
- default_input_mode = EAknEditorTextInputMode;
- allowed_input_modes = EAknEditorTextInputMode
- | EAknEditorNumericInputMode
- | EAknEditorSecretAlphaInputMode
- | EAknEditorKatakanaInputMode
- | EAknEditorFullWidthTextInputMode
- | EAknEditorFullWidthNumericInputMode
- | EAknEditorFullWidthKatakanaInputMode
- | EAknEditorHiraganaKanjiInputMode
- | EAknEditorHalfWidthTextInputMode;
- special_character_table = R_AVKON_URL_SPECIAL_CHARACTER_TABLE_DIALOG;
- lines = 0;
- }
-
-RESOURCE AVKON_SETTING_PAGE r_username_setting_page
-{
- type = EEikCtEdwin;
- editor_resource_id = r_username_editor_resource;
-}
-
-RESOURCE EDWIN r_username_editor_resource
-{
- maxlength = 255;
- default_case = EAknEditorTextCase;
- allowed_case_modes = EAknEditorAllCaseModes;
- numeric_keymap = EAknEditorStandardNumberModeKeymap;
- default_input_mode = EAknEditorTextInputMode;
- allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode | EAknEditorSecretAlphaInputMode | EAknEditorKatakanaInputMode | EAknEditorFullWidthTextInputMode | EAknEditorFullWidthNumericInputMode | EAknEditorFullWidthKatakanaInputMode | EAknEditorHiraganaKanjiInputMode | EAknEditorHalfWidthTextInputMode;
- lines = 0;
-}
-
-RESOURCE AVKON_SETTING_PAGE r_password_setting_page
-{
- //type = EEikCtEdwin;
- //editor_resource_id = r_password_editor_resource;
- type = EEikCtSecretEd;
- editor_resource_id = r_settinglist_alpha_password;
-}
-
-RESOURCE EDWIN r_password_editor_resource
- {
- maxlength = 255;
- default_case = EAknEditorTextCase;
- allowed_case_modes = EAknEditorAllCaseModes;
- numeric_keymap = EAknEditorStandardNumberModeKeymap;
- default_input_mode = EAknEditorTextInputMode;
- allowed_input_modes = EAknEditorTextInputMode | EAknEditorNumericInputMode | EAknEditorSecretAlphaInputMode | EAknEditorKatakanaInputMode | EAknEditorFullWidthTextInputMode | EAknEditorFullWidthNumericInputMode | EAknEditorFullWidthKatakanaInputMode | EAknEditorHiraganaKanjiInputMode | EAknEditorHalfWidthTextInputMode;
- lines = 0;
- }
-
-RESOURCE SECRETED r_settinglist_alpha_password
- {
- num_letters = 100;
- }
-
-
-RESOURCE TBUF r_caldav_time
- {
- buf = qtn_caldav_time;
- }
-
-RESOURCE AVKON_SETTING_PAGE r_caldav_time_page
-
- {
- number = 1;
- type = EEikCtTimeOffsetEditor;
- editor_resource_id = r_caldav_time_editor;
- }
-
-RESOURCE TIME_OFFSET_EDITOR r_caldav_time_editor
- {
- minTimeOffset = TIME_OFFSET { seconds = 0; };
- maxTimeOffset = TIME_OFFSET { seconds = 43200; };
- flags = EEikTimeWithoutSecondsField | EEikTimeZoneOffsetFormat;
- }
-
-RESOURCE AVKON_SETTING_PAGE r_caldav_binary_page
-{
- label = "";
- type = EAknCtPopupSettingList;
- editor_resource_id = r_cl_setting_list_ed;
-}
-
-RESOURCE POPUP_SETTING_LIST r_cl_setting_list_ed
-{
- flags = 0;
-}
-
-RESOURCE TBUF r_caldav_conflictaction
- {
- buf = qtn_caldav_conflictaction;
- }
-
-RESOURCE AVKON_POPUP_SETTING_TEXTS r_caldav_conflictaction_texts
- {
- flags = 0;
- setting_texts_resource = r_caldav_conflictaction_setting_array;
- popped_up_texts_resource = r_caldav_conflictaction_popup_array;
- }
-
-RESOURCE ARRAY r_caldav_conflictaction_setting_array
- {
- items =
- {
- AVKON_ENUMERATED_TEXT { value = 1; text = qtn_caldav_keep_server; },
- AVKON_ENUMERATED_TEXT { value = 0; text = qtn_caldav_keep_device; }
- };
- }
-
-RESOURCE ARRAY r_caldav_conflictaction_popup_array
- {
- items =
- {
- LBUF { txt = qtn_caldav_keep_server; },
- LBUF { txt = qtn_caldav_keep_device; }
- };
- }
-
-RESOURCE TBUF r_caldav_immediatesync
- {
- buf = qtn_caldav_immediatesync;
- }
-
-RESOURCE AVKON_POPUP_SETTING_TEXTS r_caldav_immediatesync_texts
- {
- flags = 0;
- setting_texts_resource = r_caldav_immediatesync_setting_array;
- popped_up_texts_resource = r_caldav_immediatesync_popup_array;
- }
-
-RESOURCE ARRAY r_caldav_immediatesync_setting_array
- {
- items =
- {
- AVKON_ENUMERATED_TEXT { value = 1; text = qtn_caldav_immediatesync_yes; },
- AVKON_ENUMERATED_TEXT { value = 0; text = qtn_caldav_immediatesync_no; }
- };
- }
-
-RESOURCE ARRAY r_caldav_immediatesync_popup_array
- {
- items =
- {
- LBUF { txt = qtn_caldav_immediatesync_yes; },
- LBUF { txt = qtn_caldav_immediatesync_no; }
- };
- }
-
-RESOURCE TBUF r_caldav_enable
- {
- buf = qtn_caldav_enable;
- }
-
-RESOURCE AVKON_POPUP_SETTING_TEXTS r_caldav_enable_texts
- {
- flags = 0;
- setting_texts_resource = r_caldav_enable_setting_array;
- popped_up_texts_resource = r_caldav_enable_popup_array;
- }
-
-RESOURCE ARRAY r_caldav_enable_setting_array
- {
- items =
- {
- AVKON_ENUMERATED_TEXT { value = 1; text = qtn_caldav_yes; },
- AVKON_ENUMERATED_TEXT { value = 0; text = qtn_caldav_no; }
- };
- }
-
-RESOURCE ARRAY r_caldav_enable_popup_array
- {
- items =
- {
- LBUF { txt = qtn_caldav_yes; },
- LBUF { txt = qtn_caldav_no; }
- };
- }
-
-RESOURCE TBUF r_caldav_range
- {
- buf = qtn_caldav_range;
- }
-
-RESOURCE AVKON_POPUP_SETTING_TEXTS r_caldav_range_texts
- {
- flags = 0;
- setting_texts_resource = r_caldav_range_setting_array;
- popped_up_texts_resource = r_caldav_range_popup_array;
- }
-
-RESOURCE ARRAY r_caldav_range_setting_array
- {
- items =
- {
- AVKON_ENUMERATED_TEXT { value = 0; text = qtn_caldav_range_two; },
- AVKON_ENUMERATED_TEXT { value = 1; text = qtn_caldav_range_three; },
- AVKON_ENUMERATED_TEXT { value = 2; text = qtn_caldav_range_six; },
- AVKON_ENUMERATED_TEXT { value = 3; text = qtn_caldav_range_all; }
- };
- }
-
-RESOURCE ARRAY r_caldav_range_popup_array
- {
- items =
- {
- LBUF { txt = qtn_caldav_range_two; },
- LBUF { txt = qtn_caldav_range_three; },
- LBUF { txt = qtn_caldav_range_six; },
- LBUF { txt = qtn_caldav_range_all; }
-
- };
- }
-
-RESOURCE AVKON_POPUP_SETTING_TEXTS r_caldav_time_texts
- {
- flags = 0;
- setting_texts_resource = r_caldav_time_setting_array;
- popped_up_texts_resource = r_caldav_time_popup_array;
- }
-
-RESOURCE ARRAY r_caldav_time_setting_array
- {
- items =
- {
- AVKON_ENUMERATED_TEXT { value = 0; text = qtn_caldav_time_always; },
- AVKON_ENUMERATED_TEXT { value = 1; text = qtn_caldav_time_one; },
- AVKON_ENUMERATED_TEXT { value = 2; text = qtn_caldav_time_five; },
- AVKON_ENUMERATED_TEXT { value = 3; text = qtn_caldav_time_fifteen; },
- AVKON_ENUMERATED_TEXT { value = 4; text = qtn_caldav_time_thirty; }
- };
- }
-
-RESOURCE ARRAY r_caldav_time_popup_array
- {
- items =
- {
- LBUF { txt = qtn_caldav_time_always; },
- LBUF { txt = qtn_caldav_time_one; },
- LBUF { txt = qtn_caldav_time_five; },
- LBUF { txt = qtn_caldav_time_fifteen; },
- LBUF { txt = qtn_caldav_time_thirty; }
- };
- }
--- a/calendarui/caldav/group/bld.inf Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: provides the information required for building
-* caldav ecom plugin, integrates into calendar
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-
-PRJ_MMPFILES
-calencaldavplugin.mmp
-
-// End of File
--- a/calendarui/caldav/group/calencaldavplugin.mmp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: This is the project specification file for the
-* Caldav ECOM plugin, integrates into calendar app
-*/
-
-#include <platform_paths.hrh>
-#include <data_caging_paths.hrh>
-#include "../inc/CalDavUids.h"
-
-TARGET calencaldavplugin.dll
-TARGETTYPE PLUGIN
-UID SYMBIAN_ECOM_PLUGIN_UID CALENCALDAVPLUGIN_DLL_UID
-
-CAPABILITY CAP_APPLICATION NetworkControl
-
-//Includes
-USERINCLUDE ../inc
-USERINCLUDE ../../inc
-
-APP_LAYER_SYSTEMINCLUDE
-SYSTEMINCLUDE ../../../inc
-SYSTEMINCLUDE /epoc32/include/
-SYSTEMINCLUDE /epoc32/include/ecom
-
-SOURCEPATH ../src
-SOURCE calencaldavplugin.cpp
-SOURCE calencaldavpluginProxy.cpp
-SOURCE caldavsettingitems.cpp
-
-USERINCLUDE ../../settings/settingsui/inc
-SOURCEPATH ../../settings/settingsui/src
-SOURCE calennestedsettingitem.cpp
-SOURCE calennestedsettingdialog.cpp
-
-// Resources
-SOURCEPATH ../data
-START RESOURCE 2002B503.rss
- TARGET calencaldavplugin.rsc
-END
-
-START RESOURCE ../data/calencaldavplugindata.rss
-HEADER
-TARGETPATH RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END
-
-LIBRARY avkon.lib
-LIBRARY calinterimapi.lib
-LIBRARY cone.lib
-LIBRARY ecom.lib
-LIBRARY eikcoctl.lib
-LIBRARY eikcore.lib
-LIBRARY euser.lib
-LIBRARY bafl.lib
-LIBRARY CommonEngine.lib
-LIBRARY eikdlg.lib
-LIBRARY hlplch.lib
-LIBRARY FeatMgr.lib
-LIBRARY aknskins.lib
-LIBRARY aknicon.lib
-LIBRARY flogger.lib
-LIBRARY caldavclient.lib
-LIBRARY commdb.lib
-LIBRARY cmmanager.lib
-LIBRARY charconv.lib
-LIBRARY esock.lib calenglobaldata.lib
--- a/calendarui/caldav/inc/CalDavUids.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Caldav UIDs
-*
-*/
-
-#ifndef CALDAVUIDS_H_
-#define CALDAVUIDS_H_
-
-#define SYMBIAN_ECOM_PLUGIN_UID 0x10009D8D
-#define CALENUIPLUGININTERFACE_ECOM_INTERFACE_UID 0x1028336F
-
-#define CALENCALDAVPLUGIN_DLL_UID 0x2002B503
-#define CALEN_CALDAV_IMPLEMENTATION_UID 0x2002B81E
-
-#endif /* CALDAVUIDS_H_ */
--- a/calendarui/caldav/inc/caldavsettingitems.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,158 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Caldav setting items
-*
-*/
-
-#ifndef SETTINGITEMS_H
-#define SETTINGITEMS_H
-
-// INCLUDES
-#include <e32std.h>
-#include <e32base.h>
-
-#include <aknsettingitemlist.h>
-
-class CCalDavSession;
-
-class CCalDavTextSettingItem : public CAknTextSettingItem
- {
- public:
-
- static CCalDavTextSettingItem* NewL(TInt aId, CCalDavSession* aSession, const TDesC &aCalendar);
- static CCalDavTextSettingItem* NewLC(TInt aId,CCalDavSession* aSession, const TDesC &aCalendar);
- ~CCalDavTextSettingItem();
-
- void SetEnableSettingItem(CAknSettingItem* aItem);
-
- private:
- CCalDavTextSettingItem(TInt aId, CCalDavSession* aSession);
-
- void ConstructL(const TDesC &aCalendar);
-
- protected:// From base classes
- void EditItemL( TBool aCalledFromMenu );
- virtual void StoreL();
- virtual void LoadL();
-
- private:
- TBuf<500> iInternalValue;
- CCalDavSession* iSession;
- HBufC* iCalendar;
- CAknSettingItem* iEnableSettingItem; // not owned
- };
-
-class CCalDavPasswordSettingItem : public CAknPasswordSettingItem
- {
- public:
-
- static CCalDavPasswordSettingItem* NewL(TInt aId, CCalDavSession* aSession, const TDesC &aCalendar);
- static CCalDavPasswordSettingItem* NewLC(TInt aId, CCalDavSession* aSession, const TDesC &aCalendar);
- ~CCalDavPasswordSettingItem();
-
- void SetEnableSettingItem(CAknSettingItem* aItem);
-
- private:
- CCalDavPasswordSettingItem(TInt aId, CCalDavSession* aSession);
-
- void ConstructL(const TDesC &aCalendar);
-
- protected:// From base classes
- void EditItemL( TBool aCalledFromMenu );
- virtual void StoreL();
- virtual void LoadL();
-
- private:
- TBuf<500> iInternalValue;
- CCalDavSession* iSession;
- HBufC* iCalendar;
- CAknSettingItem* iEnableSettingItem; // not owned
- };
-
-class CCalDavBooleanSettingItem : public CAknBinaryPopupSettingItem
- {
- public:
-
- static CCalDavBooleanSettingItem* NewL(TInt aId, CCalDavSession* aSession, const TDesC &aCalendar);
- static CCalDavBooleanSettingItem* NewLC(TInt aId, CCalDavSession* aSession, const TDesC &aCalendar);
- ~CCalDavBooleanSettingItem();
-
- private:
- CCalDavBooleanSettingItem(TInt aId, CCalDavSession* aSession);
-
- void ConstructL(const TDesC &aCalendar);
-
- protected:// From base classes
- void EditItemL( TBool aCalledFromMenu );
- virtual void StoreL();
- virtual void LoadL();
-
- private:
- TBool iInternalValue;
- CCalDavSession* iSession;
- HBufC* iCalendar;
- };
-
-class CCalDavEnumeratedTextSettingItem : public CAknEnumeratedTextPopupSettingItem
- {
- public:
-
- static CCalDavEnumeratedTextSettingItem* NewL(TInt aId, CCalDavSession* aSession, const TDesC &aCalendar);
- static CCalDavEnumeratedTextSettingItem* NewLC(TInt aId, CCalDavSession* aSession, const TDesC &aCalendar);
- ~CCalDavEnumeratedTextSettingItem();
-
- private:
- CCalDavEnumeratedTextSettingItem(TInt aId, CCalDavSession* aSession);
-
- void ConstructL(const TDesC &aCalendar);
-
- protected:// From base classes
- void EditItemL( TBool aCalledFromMenu );
- virtual void StoreL();
- virtual void LoadL();
-
- private:
- TInt iInternalValue;
- CCalDavSession* iSession;
- HBufC* iCalendar;
- };
-
-class CCalDavAccessPointSettingItem : public CAknSettingItem
- {
- public:
- static CCalDavAccessPointSettingItem*
- CCalDavAccessPointSettingItem::NewL( TInt aSettingId, CCalDavSession* aSession, const TDesC &aCalendar);
- ~CCalDavAccessPointSettingItem();
- private:
- CCalDavAccessPointSettingItem ( TInt aSettingId, CCalDavSession* aSession);
- void ConstructL(const TDesC &aCalendar);
-
-
- protected: // from CAknSettingItem
- void EditItemL( TBool aCalledFromMenu );
- virtual void StoreL();
- virtual void LoadL();
-
- const TDesC& SettingTextL();
-
- private:
- TBool EditAccessPointItemL();
-
- private:
- HBufC* iSettingText;
- CCalDavSession* iSession;
- };
-
-
-#endif // SETTINGITEMS_H
--- a/calendarui/caldav/inc/calencaldavplugin.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: CalDav ECOM plugin
-*
-*/
-
-#ifndef __CALENLUNARPLUGIN_H__
-#define __CALENLUNARPLUGIN_H__
-
-//SYSTEM INCLUDES
-#include <e32base.h>
-#include <ecom.h>
-
-//CALENDAR INCLUDES
-#include <calencommandhandler.h>
-#include <calennotificationhandler.h>
-#include "calencustomisation.h"
-#include "CalendarVariant.hrh"
-
-//FORWARD DECLARE
-class CEikonEnv;
-class CCalenLunarInfoProvider;
-class CEikLabel;
-class CCoeControl;
-class TRect;
-class CEikMenuPane;
-class CCalDavSession;
-
-enum TCalDavSettingItem
-{
- ECalDavSettingUrl = 0,
- ECalDavSettingUser,
- ECalDavSettingPassword,
- ECalDavSettingEnable,
- ECalDavSettingKeepServer,
- ECalDavSettingSyncImmediate,
- ECalDavSettingSyncInterval,
- ECalDavSettingSyncRange,
- ECalDavSettingAccess
-};
-
-//CLASS DECLARATION
-NONSHARABLE_CLASS(CCalenCalDavPlugin) : public CCalenCustomisation,
- public MCalenCommandHandler,
- public MCalenNotificationHandler
-
- {
- public:
-
- static CCalenCalDavPlugin* NewL( MCalenServices* aServices );
- virtual ~CCalenCalDavPlugin();
-
- private:
- CCalenCalDavPlugin( MCalenServices* aServices);
- void ConstructL();
-
- public: //From CCalenCustomisation
- void GetCustomViewsL( RPointerArray<CCalenView>& aCustomViewArray );
- void GetCustomSettingsL( RPointerArray<CAknSettingItem>& aCustomSettingArray );
- CCoeControl* InfobarL( const TRect& aRect );
- const TDesC& InfobarL();
- MCalenPreview* CustomPreviewPaneL( TRect& aRect );
- CCoeControl* PreviewPaneL( TRect& aRect );
- MCalenCommandHandler* CommandHandlerL( TInt aCommand );
- void RemoveViewsFromCycle( RArray<TInt>& aViews );
- TBool CustomiseMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
- TBool CanBeEnabledDisabled();
- TAny* CalenCustomisationExtensionL( TUid aExtensionUid );
-
- public:// From MCalenCommandHandler
- TBool HandleCommandL( const TCalenCommand& aCommand );
- TAny* CalenCommandHandlerExtensionL( TUid aExtensionUid );
-
- public://From MCalenNotificationHandler
- void HandleNotification( const TCalenNotification aNotification );
-
- private:
-
- MCalenServices* iServices;
-
- TInt iStart;
- TInt iEnd;
- TRect iRect;
- TInt iResourceFileOffset;
-
- CCalDavSession* iSession;
-
- };
-
-#endif //__CALENLUNARPLUGIN_H__
-
-
-
-
--- a/calendarui/caldav/sis/caldavplugin.pkg Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-
-
-; Languages
-&EN
-
-; Header
-#{"CalDAV plugin"}, (0x2002B775), 1, 0, 0
-
-; Localised Vendor name
-%{"Sun Microsystems"}
-
-; Unique Vendor name
-:"Sun Microsystems"
-
-;Platform Dependency
-[0x1028315f],0 ,0 ,0,{"S60ProductID"}
-
-; ------ files -----
-
-; caldav client-server
-"\epoc32\release\armv5\urel\!CalDavServer.exe "-"!:\sys\bin\!CalDavServer.exe"
-"\epoc32\release\armv5\urel\CalDavClient.dll "-"!:\sys\bin\CalDavClient.dll"
-
-;caldav calendarui ecom plugin
-"\epoc32\release\armv5\urel\calencaldavplugin.dll"-"!:\sys\Bin\calencaldavplugin.dll"
-"\epoc32\data\z\resource\calencaldavplugindata.rsc"-"!:\resource\plugins\calencaldavplugindata.rsc"
-"\epoc32\data\z\resource\calencaldavplugindata.r01" - "!:\resource\calencaldavplugindata.r01"
-"\epoc32\data\z\resource\plugins\calencaldavplugin.rsc"-"!:\resource\plugins\calencaldavplugin.rsc"
\ No newline at end of file
--- a/calendarui/caldav/src/caldavsettingitems.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,887 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: Caldav setting items
-*
-*/
-
-#include "caldavsettingitems.h"
-
-#include <StringLoader.h>
-#include <aknnotewrappers.h>
-#include <cmapplicationsettingsui.h>
-#include <CommDbConnPref.h>
-#include <UTF.H>
-
-#include <caldavsession.h>
-#include "calencaldavplugin.h"
-#include <calencaldavplugindata.rsg>
-
-#define KMAXSETTINGLENGTH 500
-
-#define KTIMETWOWEEKS 14
-#define KTIMETHREEMONTH 30*3
-#define KTIMESIXMONTH 30*6
-#define KTIMEALL 1000
-
-#define KTIMEALWAYSON 0
-#define KTIMEONEMINUTE 1
-#define KTIMEFIVEMINUTES 5
-#define KTIMEFIFTEENMINUTES 15
-#define KTIMETHIRTYMINUTES 30
-
-/**
- * show a global info note
- */
-void ShowNoteL(TInt aResource)
- {
- HBufC* text = StringLoader::LoadLC(aResource);
- CAknConfirmationNote* note = new (ELeave) CAknConfirmationNote();
- note->ExecuteLD(*text);
- CleanupStack::PopAndDestroy(text);
- }
-
-/**
- * CCalDavTextSettingItem::CCalDavTextSettingItem
- * default constructor
- */
-CCalDavTextSettingItem::CCalDavTextSettingItem(TInt aId,
- CCalDavSession* aSession) :
- CAknTextSettingItem(aId, iInternalValue), iSession(aSession)
- {
-
- }
-
-/**
- * CCalDavTextSettingItem::~CCalDavTextSettingItem
- * destructor
- */
-CCalDavTextSettingItem::~CCalDavTextSettingItem()
- {
- delete iCalendar;
- }
-
-/**
- * CCalDavTextSettingItem::NewLC
- * 1st-phase construction
- */
-CCalDavTextSettingItem* CCalDavTextSettingItem::NewLC(TInt aId,
- CCalDavSession* aSession, const TDesC &aCalendar)
- {
- CCalDavTextSettingItem* self = new (ELeave) CCalDavTextSettingItem(aId,
- aSession);
- CleanupStack::PushL(self);
- self->ConstructL(aCalendar);
- return self;
- }
-
-/**
- * CCalDavTextSettingItem::NewL
- * 1st-phase construction
- */
-CCalDavTextSettingItem* CCalDavTextSettingItem::NewL(TInt aId,
- CCalDavSession* aSession, const TDesC &aCalendar)
- {
- CCalDavTextSettingItem* self = CCalDavTextSettingItem::NewLC(aId, aSession,
- aCalendar);
- CleanupStack::Pop(); // self;
- return self;
- }
-
-/**
- * CCalDavTextSettingItem::ConstructL
- * 2nd-phase construction
- */
-void CCalDavTextSettingItem::ConstructL(const TDesC &aCalendar)
- {
- iCalendar = aCalendar.AllocL();
- HBufC* title = NULL;
- TInt page = 0;
- switch (Identifier())
- {
- case ECalDavSettingUrl:
- title = StringLoader::LoadLC(R_CALDAV_URL);
- page = R_URL_SETTING_PAGE;
- break;
- case ECalDavSettingUser:
- title = StringLoader::LoadLC(R_CALDAV_USERNAME);
- page = R_USERNAME_SETTING_PAGE;
- break;
- case ECalDavSettingPassword:
- title = StringLoader::LoadLC(R_CALDAV_PASSWORD);
- page = R_PASSWORD_SETTING_PAGE;
- break;
- }
- SetEmptyItemTextL(KNullDesC);
- CAknTextSettingItem::ConstructL(EFalse, 0, *title, NULL,page, -1);
- CleanupStack::PopAndDestroy(title);
- }
-
-/**
- * CCalDavTextSettingItem::EditItemL
- * Edits the item
- */
-void CCalDavTextSettingItem::EditItemL(TBool aCalledFromMenu)
- {
- TBool enabled;
- iSession->EnabledSync(*iCalendar, enabled);
- if (enabled)
- {
- HBufC* text = StringLoader::LoadLC(R_CALDAV_QUERY_DISCONNECT);
- CAknQueryDialog* dlg = CAknQueryDialog::NewL();
- if (dlg->ExecuteLD(R_QUERY, *text))
- {
- CAknTextSettingItem::EditItemL(aCalledFromMenu);
- // TODO: disable Enabled-Setting-Item
- }
- CleanupStack::PopAndDestroy(text);
- }
- else
- CAknTextSettingItem::EditItemL(aCalledFromMenu);
- }
-
-/**
- * CCalDavTextSettingItem::StoreL
- * Stores the item
- */
-void CCalDavTextSettingItem::StoreL()
- {
- CAknTextSettingItem::StoreL();
-
- HBufC8* text = CnvUtfConverter::ConvertFromUnicodeToUtf8L(iInternalValue);
- CleanupStack::PushL(text);
-
- switch (Identifier())
- {
- case ECalDavSettingUrl:
- iSession->SetUrl(*iCalendar, *text);
- break;
- case ECalDavSettingUser:
- iSession->SetUsername(*iCalendar, *text);
- break;
- case ECalDavSettingPassword:
- iSession->SetPassword(*iCalendar, *text);
- break;
- }
- CleanupStack::PopAndDestroy(text);
-
- if (iEnableSettingItem)
- {
- iEnableSettingItem->LoadL();
- iEnableSettingItem->UpdateListBoxTextL();
- }
- }
-
-/**
- * CCalDavTextSettingItem::LoadL
- * loades the item
- */
-void CCalDavTextSettingItem::LoadL()
- {
- HBufC8* buf = HBufC8::NewL(KMAXSETTINGLENGTH);
- TPtr8 ptr(buf->Des());
- switch (Identifier())
- {
- case ECalDavSettingUrl:
- iSession->Url(*iCalendar, ptr);
- break;
- case ECalDavSettingUser:
- iSession->Username(*iCalendar, ptr);
- break;
- case ECalDavSettingPassword:
- iSession->Password(*iCalendar, ptr);
- break;
- }
- CnvUtfConverter::ConvertToUnicodeFromUtf8(iInternalValue, ptr);
- delete buf;
- CAknTextSettingItem::LoadL();
- }
-
-/**
- * CCalDavTextSettingItem::StoreL
- * Save a pointer to the Enable Item, this is used to set current
- * enable/disable state
- */
-void CCalDavTextSettingItem::SetEnableSettingItem(CAknSettingItem* aItem)
- {
- iEnableSettingItem = aItem;
- }
-
-/**
- * CCalDavPasswordSettingItem::CCalDavPasswordSettingItem
- * default constructor
- */
-CCalDavPasswordSettingItem::CCalDavPasswordSettingItem(TInt aId,
- CCalDavSession* aSession) :
- CAknPasswordSettingItem(aId, CAknPasswordSettingItem::EAlpha,
- iInternalValue), iSession(aSession)
- {
-
- }
-
-/**
- * CCalDavPasswordSettingItem::~CCalDavPasswordSettingItem
- * default destructor
- */
-CCalDavPasswordSettingItem::~CCalDavPasswordSettingItem()
- {
- delete iCalendar;
- }
-
-/**
- * CCalDavPasswordSettingItem::NewLC
- * first phase construction
- */
-CCalDavPasswordSettingItem* CCalDavPasswordSettingItem::NewLC(TInt aId,
- CCalDavSession* aSession, const TDesC &aCalendar)
- {
- CCalDavPasswordSettingItem* self = new (ELeave) CCalDavPasswordSettingItem(
- aId, aSession);
- CleanupStack::PushL(self);
- self->ConstructL(aCalendar);
- return self;
- }
-
-/**
- * CCalDavPasswordSettingItem::NewL
- * first phase construction
- */
-CCalDavPasswordSettingItem* CCalDavPasswordSettingItem::NewL(TInt aId,
- CCalDavSession* aSession, const TDesC &aCalendar)
- {
- CCalDavPasswordSettingItem* self = CCalDavPasswordSettingItem::NewLC(aId,
- aSession, aCalendar);
- CleanupStack::Pop(); // self;
- return self;
- }
-
-/**
- * CCalDavPasswordSettingItem::SetEnableSettingItem
- * Save a pointer to the Enable Item, this is used to set current
- * enable/disable state
- */
-void CCalDavPasswordSettingItem::SetEnableSettingItem(CAknSettingItem* aItem)
- {
- iEnableSettingItem = aItem;
- }
-
-/**
- * CCalDavPasswordSettingItem::ConstructL
- * second phase construction
- */
-void CCalDavPasswordSettingItem::ConstructL(const TDesC &aCalendar)
- {
- iCalendar = aCalendar.AllocL();
- HBufC* title = NULL;
- TInt page = 0;
- switch (Identifier())
- {
- case ECalDavSettingPassword:
- title = StringLoader::LoadLC(R_CALDAV_PASSWORD);
- page = R_PASSWORD_SETTING_PAGE;
- break;
- }
- SetEmptyItemTextL(KNullDesC);
- CAknPasswordSettingItem::ConstructL(EFalse, 0, *title, NULL,page, -1);
- CleanupStack::PopAndDestroy(title);
- }
-
-/**
- * CCalDavPasswordSettingItem::EditItemL
- * edits the item
- */
-void CCalDavPasswordSettingItem::EditItemL(TBool aCalledFromMenu)
- {
- TBool enabled;
- iSession->EnabledSync(*iCalendar, enabled);
- if (enabled)
- {
- HBufC* text = StringLoader::LoadLC(R_CALDAV_QUERY_DISCONNECT);
- CAknQueryDialog* dlg = CAknQueryDialog::NewL();
- if (dlg->ExecuteLD(R_QUERY, *text))
- CAknPasswordSettingItem::EditItemL(aCalledFromMenu);
- CleanupStack::PopAndDestroy(text);
- }
- else
- CAknPasswordSettingItem::EditItemL(aCalledFromMenu);
- CAknSettingItem::UpdateListBoxTextL();
- }
-
-/**
- * CCalDavPasswordSettingItem::StoreL
- * stores the item
- */
-void CCalDavPasswordSettingItem::StoreL()
- {
- CAknPasswordSettingItem::StoreL();
-
- HBufC8* text = CnvUtfConverter::ConvertFromUnicodeToUtf8L(iInternalValue);
- CleanupStack::PushL(text);
-
- switch (Identifier())
- {
- case ECalDavSettingPassword:
- iSession->SetPassword(*iCalendar, *text);
- break;
- }
- CleanupStack::PopAndDestroy(text);
- }
-
-/**
- * CCalDavPasswordSettingItem::LoadL
- * loads the item
- */
-void CCalDavPasswordSettingItem::LoadL()
- {
- HBufC8* buf = HBufC8::NewL(KMAXSETTINGLENGTH);
- TPtr8 ptr(buf->Des());
- switch (Identifier())
- {
- case ECalDavSettingPassword:
- iSession->Password(*iCalendar, ptr);
- break;
- }
- CnvUtfConverter::ConvertToUnicodeFromUtf8(iInternalValue, ptr);
- delete buf;
- CAknPasswordSettingItem::LoadL();
- }
-
-/**
- * CCalDavBooleanSettingItem::CCalDavBooleanSettingItem
- * default constructor
- */
-CCalDavBooleanSettingItem::CCalDavBooleanSettingItem(TInt aId,
- CCalDavSession* aSession) :
- CAknBinaryPopupSettingItem(aId, iInternalValue), iSession(aSession)
- {
-
- }
-
-/**
- * CCalDavBooleanSettingItem::~CCalDavBooleanSettingItem
- * default destructor
- */
-CCalDavBooleanSettingItem::~CCalDavBooleanSettingItem()
- {
- delete iCalendar;
- }
-
-/**
- * CCalDavBooleanSettingItem::NewLC
- * first phase construction
- */
-CCalDavBooleanSettingItem* CCalDavBooleanSettingItem::NewLC(TInt aId,
- CCalDavSession* aSession, const TDesC &aCalendar)
- {
- CCalDavBooleanSettingItem* self = new (ELeave) CCalDavBooleanSettingItem(
- aId, aSession);
- CleanupStack::PushL(self);
- self->ConstructL(aCalendar);
- return self;
- }
-
-/**
- * CCalDavBooleanSettingItem::NewLC
- * first phase construction
- */
-CCalDavBooleanSettingItem* CCalDavBooleanSettingItem::NewL(TInt aId,
- CCalDavSession* aSession, const TDesC &aCalendar)
- {
- CCalDavBooleanSettingItem* self = CCalDavBooleanSettingItem::NewLC(aId,
- aSession, aCalendar);
- CleanupStack::Pop(); // self;
- return self;
- }
-
-/**
- * CCalDavBooleanSettingItem::ConstructL
- * second phase construction
- */
-void CCalDavBooleanSettingItem::ConstructL(const TDesC &aCalendar)
- {
- iCalendar = aCalendar.AllocL();
- HBufC* title = NULL;
- TInt text = 0;
- TInt page = R_CALDAV_BINARY_PAGE;
- switch (Identifier())
- {
- case ECalDavSettingKeepServer:
- title = StringLoader::LoadLC(R_CALDAV_CONFLICTACTION);
- text = R_CALDAV_CONFLICTACTION_TEXTS;
- break;
- case ECalDavSettingSyncImmediate:
- title = StringLoader::LoadLC(R_CALDAV_IMMEDIATESYNC);
- text = R_CALDAV_IMMEDIATESYNC_TEXTS;
- break;
- case ECalDavSettingEnable:
- title = StringLoader::LoadLC(R_CALDAV_ENABLE);
- text = R_CALDAV_ENABLE_TEXTS;
- break;
- }
- SetEmptyItemTextL(KNullDesC);
- CAknBinaryPopupSettingItem::ConstructL(EFalse, 0, *title, NULL,page,
- EAknCtPopupSettingList, NULL, text);
- CleanupStack::PopAndDestroy(title);
- }
-
-/**
- * CCalDavBooleanSettingItem::EditItemL
- * edits the item
- */
-void CCalDavBooleanSettingItem::EditItemL(TBool aCalledFromMenu)
- {
- if (Identifier() == ECalDavSettingEnable)
- {
- TBool enabled_old;
- iSession->EnabledSync(*iCalendar, enabled_old);
- if (enabled_old)
- {
- HBufC* text = StringLoader::LoadLC(R_CALDAV_QUERY_DISCONNECT);
- CAknQueryDialog* dlg = CAknQueryDialog::NewL();
- if (dlg->ExecuteLD(R_QUERY, *text))
- {
- iSession->Disable(*iCalendar);
- CAknBinaryPopupSettingItem::EditItemL(aCalledFromMenu);
- }
- CleanupStack::PopAndDestroy(text);
- }
- else
- {
- iSession->Enable(*iCalendar);
- // TODO: progressbar
- TBool enabled_new;
- iSession->EnabledSync(*iCalendar, enabled_new);
- if (!enabled_new)
- {
- ShowNoteL(R_CALDAV_QUERY_FAIL);
- }
- else
- {
- ShowNoteL(R_CALDAV_QUERY_SUCCESS);
- CAknBinaryPopupSettingItem::EditItemL(aCalledFromMenu);
- }
- }
- }
- else
- CAknBinaryPopupSettingItem::EditItemL(aCalledFromMenu);
- }
-
-/**
- * CCalDavBooleanSettingItem::StoreL
- * stores the item
- */
-void CCalDavBooleanSettingItem::StoreL()
- {
- CAknBinaryPopupSettingItem::StoreL();
-
- switch (Identifier())
- {
- case ECalDavSettingKeepServer:
- iSession->SetKeepServerEntry(*iCalendar, iInternalValue);
- break;
- case ECalDavSettingSyncImmediate:
- iSession->SetImmediateSync(*iCalendar, iInternalValue);
- break;
- }
- }
-
-/**
- * CCalDavBooleanSettingItem::LoadL
- * loads the item
- */
-void CCalDavBooleanSettingItem::LoadL()
- {
- switch (Identifier())
- {
- case ECalDavSettingKeepServer:
- iSession->KeepServerEntry(*iCalendar, iInternalValue);
- break;
- case ECalDavSettingSyncImmediate:
- iSession->ImmediateSync(*iCalendar, iInternalValue);
- break;
- case ECalDavSettingEnable:
- iSession->EnabledSync(*iCalendar, iInternalValue);
- break;
- }
- CAknBinaryPopupSettingItem::LoadL();
- }
-
-/**
- * CCalDavEnumeratedTextSettingItem::CCalDavEnumeratedTextSettingItem
- * default constructor
- */
-CCalDavEnumeratedTextSettingItem::CCalDavEnumeratedTextSettingItem(TInt aId,
- CCalDavSession* aSession) :
- CAknEnumeratedTextPopupSettingItem(aId, iInternalValue), iSession(aSession)
- {
-
- }
-
-/**
- * CCalDavEnumeratedTextSettingItem::~CCalDavEnumeratedTextSettingItem
- * default destructor
- */
-CCalDavEnumeratedTextSettingItem::~CCalDavEnumeratedTextSettingItem()
- {
- delete iCalendar;
- }
-
-/**
- * CCalDavEnumeratedTextSettingItem::NewLC
- * first phase construction
- */
-CCalDavEnumeratedTextSettingItem* CCalDavEnumeratedTextSettingItem::NewLC(
- TInt aId, CCalDavSession* aSession, const TDesC &aCalendar)
- {
- CCalDavEnumeratedTextSettingItem* self =
- new (ELeave) CCalDavEnumeratedTextSettingItem(aId, aSession);
- CleanupStack::PushL(self);
- self->ConstructL(aCalendar);
- return self;
- }
-
-/**
- * CCalDavEnumeratedTextSettingItem::NewL
- * first phase construction
- */
-CCalDavEnumeratedTextSettingItem* CCalDavEnumeratedTextSettingItem::NewL(
- TInt aId, CCalDavSession* aSession, const TDesC &aCalendar)
- {
- CCalDavEnumeratedTextSettingItem* self =
- CCalDavEnumeratedTextSettingItem::NewLC(aId, aSession, aCalendar);
- CleanupStack::Pop(); // self;
- return self;
- }
-
-/**
- * CCalDavEnumeratedTextSettingItem::ConstructL
- * second phase construction
- */
-void CCalDavEnumeratedTextSettingItem::ConstructL(const TDesC &aCalendar)
- {
- iCalendar = aCalendar.AllocL();
- HBufC* title = NULL;
- TInt text = 0;
- TInt page = R_CALDAV_BINARY_PAGE;
- switch (Identifier())
- {
- case ECalDavSettingSyncRange:
- title = StringLoader::LoadLC(R_CALDAV_RANGE);
- text = R_CALDAV_RANGE_TEXTS;
- break;
- case ECalDavSettingSyncInterval:
- title = StringLoader::LoadLC(R_CALDAV_TIME);
- text = R_CALDAV_TIME_TEXTS;
- break;
-
- }
- SetEmptyItemTextL(KNullDesC);
- CAknEnumeratedTextSettingItem::ConstructL(EFalse, 0, *title, NULL,page,
- EAknCtPopupSettingList, NULL, text);
- CleanupStack::PopAndDestroy(title);
- }
-
-/**
- * CCalDavEnumeratedTextSettingItem::EditItemL
- * edits the item
- */
-void CCalDavEnumeratedTextSettingItem::EditItemL(TBool aCalledFromMenu)
- {
- CAknEnumeratedTextPopupSettingItem::EditItemL(aCalledFromMenu);
- }
-
-/**
- * CCalDavEnumeratedTextSettingItem::StoreL
- * stores the item
- */
-void CCalDavEnumeratedTextSettingItem::StoreL()
- {
- CAknEnumeratedTextPopupSettingItem::StoreL();
-
- switch (iInternalValue)
- {
- case 0:
- {
- if (Identifier() == ECalDavSettingSyncRange)
- iSession->SetPastDays(*iCalendar, TTimeIntervalDays(
- KTIMETWOWEEKS));
- else
- iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
- KTIMEALWAYSON));
- break;
- }
- case 1:
- {
- if (Identifier() == ECalDavSettingSyncRange)
- iSession->SetPastDays(*iCalendar, TTimeIntervalDays(
- KTIMETHREEMONTH));
- else
- iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
- KTIMEONEMINUTE));
- break;
- }
- case 2:
- {
- if (Identifier() == ECalDavSettingSyncRange)
- iSession->SetPastDays(*iCalendar, TTimeIntervalDays(
- KTIMESIXMONTH));
- else
- iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
- KTIMEFIVEMINUTES));
- break;
- }
- case 3:
- {
- if (Identifier() == ECalDavSettingSyncRange)
- iSession->SetPastDays(*iCalendar, TTimeIntervalDays(KTIMEALL));
- else
- iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
- KTIMEFIFTEENMINUTES));
- break;
- }
- case 4:
- {
- if (Identifier() == ECalDavSettingSyncInterval)
- iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
- KTIMETHIRTYMINUTES));
- break;
- }
- default:
- if (Identifier() == ECalDavSettingSyncRange)
- iSession->SetPastDays(*iCalendar, TTimeIntervalDays(
- KTIMETWOWEEKS));
- else
- iSession->SetSyncInterval(*iCalendar, TTimeIntervalMinutes(
- KTIMEALWAYSON));
-
- break;
- }
- }
-
-/**
- * CCalDavEnumeratedTextSettingItem::LoadL
- * loads the item
- */
-void CCalDavEnumeratedTextSettingItem::LoadL()
- {
- switch (Identifier())
- {
- case ECalDavSettingSyncRange:
- {
- TTimeIntervalDays days;
- iSession->PastDays(*iCalendar, days);
- switch (days.Int())
- {
- case KTIMETWOWEEKS:
- {
- iInternalValue = 0;
- break;
- }
- case KTIMETHREEMONTH:
- {
- iInternalValue = 1;
- break;
- }
- case KTIMESIXMONTH:
- {
- iInternalValue = 2;
- break;
- }
- case KTIMEALL:
- {
- iInternalValue = 3;
- break;
- }
- default:
- iInternalValue = 0;
- break;
- }
- break;
- }
- case ECalDavSettingSyncInterval:
- {
- TTimeIntervalMinutes minutes;
- iSession->SyncInterval(*iCalendar, minutes);
- switch (minutes.Int())
- {
- case KTIMEALWAYSON:
- {
- iInternalValue = 0;
- break;
- }
- case KTIMEONEMINUTE:
- {
- iInternalValue = 1;
- break;
- }
- case KTIMEFIVEMINUTES:
- {
- iInternalValue = 2;
- break;
- }
- case KTIMEFIFTEENMINUTES:
- {
- iInternalValue = 3;
- break;
- }
- case KTIMETHIRTYMINUTES:
- {
- iInternalValue = 4;
- break;
- }
- default:
- iInternalValue = 0;
- break;
- }
- break;
- }
- }
- CAknEnumeratedTextPopupSettingItem::LoadL();
- }
-
-/**
- * CCalDavAccessPointSettingItem::NewL
- * first phase construction
- */
-CCalDavAccessPointSettingItem* CCalDavAccessPointSettingItem::NewL(
- TInt aSettingId, CCalDavSession* aSession, const TDesC &aCalendar)
- {
- CCalDavAccessPointSettingItem * item =
- new (ELeave) CCalDavAccessPointSettingItem(aSettingId, aSession);
- CleanupStack::PushL(item);
- item->ConstructL(aCalendar);
- CleanupStack::Pop(item);
- return item;
- }
-
-/**
- * CCalDavAccessPointSettingItem::CCalDavAccessPointSettingItem
- * default constructor
- */
-CCalDavAccessPointSettingItem::CCalDavAccessPointSettingItem(TInt aSettingId,
- CCalDavSession* aSession) :
- CAknSettingItem(aSettingId), iSession(aSession)
- {
- }
-
-/**
- * CCalDavAccessPointSettingItem::~CCalDavAccessPointSettingItem
- * default destructor
- */
-CCalDavAccessPointSettingItem::~CCalDavAccessPointSettingItem()
- {
- delete iSettingText;
- }
-
-/**
- * CCalDavAccessPointSettingItem::ConstructL
- * second phase construction
- */
-void CCalDavAccessPointSettingItem::ConstructL(const TDesC &/*aCalendar*/)
- {
- SetEmptyItemTextL(KNullDesC);
- HBufC* title = StringLoader::LoadLC(R_CALDAV_ACCESS_POINT);
- CAknSettingItem::ConstructL(EFalse, 0, *title, NULL,0, 0);
- CleanupStack::PopAndDestroy(title);
-
- _LIT(hi,"Default Connection");
- iSettingText = hi().Alloc();
- }
-
-/**
- * CCalDavAccessPointSettingItem::EditItemL
- * edits the item
- */
-void CCalDavAccessPointSettingItem::EditItemL(TBool /*aCalledFromMenu*/)
- {
- delete iSettingText;
- iSettingText = NULL;
-
- TCmSettingSelection userSelection;
- userSelection.iId = 0;
- userSelection.iResult = CMManager::EDefaultConnection;
-
- CCmApplicationSettingsUi* settings = CCmApplicationSettingsUi::NewL();
- CleanupStack::PushL(settings);
- TUint listedItems = CMManager::EShowDefaultConnection
- | CMManager::EShowDestinations | CMManager::EShowConnectionMethods;
- TBearerFilterArray filter;
- settings->RunApplicationSettingsL(userSelection, listedItems, filter);
- CleanupStack::PopAndDestroy(settings);
-
- switch (userSelection.iResult)
- {
- case CMManager::EDestination:
- {
- TConnSnapPref prefs;
- prefs.SetSnap(userSelection.iId);
- // iSettingText =
- // iConnection.Start( prefs, iStatus );
- break;
- }
- case CMManager::EConnectionMethod:
- {
- TCommDbConnPref prefs;
- prefs.SetIapId(userSelection.iId);
- prefs.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
-
- // iConnection.Start( prefs, iStatus );
- // iSettingText =
- break;
- }
- case CMManager::EDefaultConnection:
- {
- // iConnection.Start( iStatus );
- // iSettingText =
- break;
- }
- }
- UpdateListBoxTextL();
- }
-
-/**
- * CCalDavAccessPointSettingItem::SettingTextL
- * returns the setting text
- */
-const TDesC& CCalDavAccessPointSettingItem::SettingTextL()
- {
- if (!iSettingText)
- {
- return CAknSettingItem::SettingTextL();
- }
- else if (iSettingText->Length() == 0)
- {
- return CAknSettingItem::SettingTextL();
- }
-
- return *iSettingText;
- }
-
-/**
- * CCalDavAccessPointSettingItem::StoreL
- * stores the item
- */
-void CCalDavAccessPointSettingItem::StoreL()
- {
- CAknSettingItem::StoreL();
- }
-
-/**
- * CCalDavAccessPointSettingItem::LoadL
- * loads the item
- */
-void CCalDavAccessPointSettingItem::LoadL()
- {
- //CAknSettingItem::Load();
- }
-// End of File
--- a/calendarui/caldav/src/calencaldavplugin.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,343 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: CalDav ECOM plugin
-*
-*/
-
-#include <eikenv.h>
-#include <aknutils.h>
-#include <eiklabel.h>
-#include <avkon.hrh>
-#include <StringLoader.h>
-#include <AknMessageQueryDialog.h>
-#include <data_caging_path_literals.hrh>
-#include <bautils.h>
-#include <aknbiditextutils.h>
-#include <aknsettingitemlist.h>
-
-#include <caldavsession.h>
-#include <calcalendarinfo.h>
-#include <calenservices.h>
-#include <calendar.rsg>
-
-#include <CalenCaldavPluginData.rsg>
-#include <calencommands.hrh>
-#include "caldavsettingitems.h"
-#include "calennestedsettingitem.h"
-#include "calendarui_debug.h"
-#include "CalenCaldavPlugin.h"
-
-_LIT( KResourceCCalDavPluginFile, "calencaldavplugindata.rsc" );
-
-#define KResourcePath KDC_RESOURCE_FILES_DIR
-
-/**
- * CCalenCalDavPlugin::CCalenCalDavPlugin
- * default constructor
- */
-CCalenCalDavPlugin::CCalenCalDavPlugin(MCalenServices* aServices) :
- iServices(aServices), iResourceFileOffset(NULL)
-
- {
- TRACE_ENTRY_POINT;TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::NewL
- * first phase construction
- */
-CCalenCalDavPlugin* CCalenCalDavPlugin::NewL(MCalenServices* aServices)
- {
- TRACE_ENTRY_POINT;
- CCalenCalDavPlugin* self = new (ELeave) CCalenCalDavPlugin(aServices);
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop(self);TRACE_EXIT_POINT;
- return self;
- }
-
-/**
- * CCalenCalDavPlugin::~CCalenCalDavPlugin
- * default destructor
- */
-CCalenCalDavPlugin::~CCalenCalDavPlugin()
- {
- TRACE_ENTRY_POINT;
-
- delete iSession;
-
- if (iServices)
- {
- iServices->CancelNotifications(this);
- iServices->Release();
- }
-
- if (iResourceFileOffset)
- {
- CCoeEnv::Static()->DeleteResourceFile(iResourceFileOffset);
- }TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::ConstructL
- * second phase construction
- */
-void CCalenCalDavPlugin::ConstructL()
- {
- TRACE_ENTRY_POINT;
-
- TFileName dllName;
- // Get the complate path of the DLL from where it is currently loaded
- Dll::FileName(dllName);
-
- TFileName resourceFilename;
- resourceFilename.Append(dllName.Mid(0, 2));
- resourceFilename.Append(KResourcePath);
- resourceFilename.Append(KResourceCCalDavPluginFile);
- BaflUtils::NearestLanguageFile(CEikonEnv::Static()->FsSession(),
- resourceFilename);
- // Add the resource file.
- iResourceFileOffset = CEikonEnv::Static()->AddResourceFileL(
- resourceFilename);
-
- iServices->GetCommandRange(iStart, iEnd);
-
- iSession = CCalDavSession::NewL();
-
- TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::InfobarL
- * show an additional infobar
- */
-CCoeControl* CCalenCalDavPlugin::InfobarL(const TRect& /*aRect*/)
- {
- TRACE_ENTRY_POINT;
- return NULL;TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::InfobarL
- * show an additional infobar
- */
-const TDesC& CCalenCalDavPlugin::InfobarL()
- {
- TRACE_ENTRY_POINT;
- return KNullDesC;
- TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::PreviewPaneL
- * show an additional preview pabe
- */
-CCoeControl* CCalenCalDavPlugin::PreviewPaneL(TRect& /* aRect */)
- {
- TRACE_ENTRY_POINT;
- return NULL;
- TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::CustomPreviewPaneL
- * show an additional custom preview pane
- */
-MCalenPreview* CCalenCalDavPlugin::CustomPreviewPaneL(TRect& /* aRect */)
- {
- TRACE_ENTRY_POINT;
- return NULL;
- TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::CustomiseMenuPaneL
- * customize menu pane
- */
-TBool CCalenCalDavPlugin::CustomiseMenuPaneL(TInt /*aResourceId*/,
- CEikMenuPane* /*aMenuPane*/)
- {
- TRACE_ENTRY_POINT;
- return EFalse;
- TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::HandleCommandL
- * let this plugin handle its own commands
- */
-TBool CCalenCalDavPlugin::HandleCommandL(const TCalenCommand& /*aCommand*/)
- {
- TRACE_ENTRY_POINT;TRACE_EXIT_POINT;
- return EFalse;
- }
-
-/**
- * CCalenCalDavPlugin::CommandHandlerL
- * let this plugin handle its own commands
- */
-MCalenCommandHandler* CCalenCalDavPlugin::CommandHandlerL(TInt /*aCommand*/)
- {
- TRACE_ENTRY_POINT;
- MCalenCommandHandler* commandHandler = NULL;
- return commandHandler;TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::RemoveViewsFromCycle
- * remove added views from cycle
- */
-void CCalenCalDavPlugin::RemoveViewsFromCycle(RArray<TInt>& /*aViews*/)
- {
- TRACE_ENTRY_POINT;TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::GetCustomSettingsL
- * add custom settings to calendar setting pane
- * all CalDav settings are added here into UI
- */
-void CCalenCalDavPlugin::GetCustomSettingsL(
- RPointerArray<CAknSettingItem>& aCustomSettingArray)
- {
- TRACE_ENTRY_POINT
-
- RPointerArray<CCalCalendarInfo> calendarInfoList;
- iServices->GetAllCalendarInfoL(calendarInfoList);
- CleanupClosePushL(calendarInfoList);
-
- TInt count = calendarInfoList.Count();
- for (TInt i = 0; i < count; i++)
- {
- TPtrC calendar = calendarInfoList[i]->FileNameL();
-
- RPointerArray<CAknSettingItem> settings;
-
- CCalDavBooleanSettingItem * enable = CCalDavBooleanSettingItem::NewL(
- ECalDavSettingEnable, iSession, calendar);
-
- CCalDavTextSettingItem* url = CCalDavTextSettingItem::NewL(
- ECalDavSettingUrl, iSession, calendar);
- url->SetEnableSettingItem(enable);
- settings.Append(url);
-
- CCalDavTextSettingItem* user = CCalDavTextSettingItem::NewL(
- ECalDavSettingUser, iSession, calendar);
- user->SetEnableSettingItem(enable);
- settings.Append(user);
-
- CCalDavPasswordSettingItem* password = CCalDavPasswordSettingItem::NewL(
- ECalDavSettingPassword, iSession, calendar);
- password->SetEnableSettingItem(enable);
- settings.Append(password);
-
- CCalDavBooleanSettingItem * keepserver =
- CCalDavBooleanSettingItem::NewL(ECalDavSettingKeepServer,
- iSession, calendar);
- settings.Append(keepserver);
-
- // CCalDavBooleanSettingItem * immediatesync = CCalDavBooleanSettingItem::NewL(ECalDavSettingSyncImmediate,iSession, calendar);
- // settings.Append(immediatesync);
-
- CCalDavEnumeratedTextSettingItem* range =
- CCalDavEnumeratedTextSettingItem::NewL(ECalDavSettingSyncRange,
- iSession, calendar);
- settings.Append(range);
-
- CCalDavEnumeratedTextSettingItem* time =
- CCalDavEnumeratedTextSettingItem::NewL(
- ECalDavSettingSyncInterval, iSession, calendar);
- settings.Append(time);
- settings.Append(enable);
-
- CCalenNestedSettingItem* item = new (ELeave) CCalenNestedSettingItem(0,
- settings, calendarInfoList[i]->NameL());
- CleanupStack::PushL(item);
-
- item->SetEmptyItemTextL(KNullDesC);
-
- if (count == 1)
- {
- HBufC16* name = StringLoader::LoadLC(R_CALDAV);
- item->ConstructL(EFalse, 0, *name, NULL,
- R_CALEN_EMPTY_SETTING_PAGE, EAknSetListBox, NULL,
- R_CALEN_EMPTY_POPUP_SETTING_TEXTS );
- CleanupStack::PopAndDestroy(name);
- }
- else
- {
- item->ConstructL(EFalse, 0, calendarInfoList[i]->NameL(), NULL,
- R_CALEN_EMPTY_SETTING_PAGE, EAknSetListBox, NULL,
- R_CALEN_EMPTY_POPUP_SETTING_TEXTS );
- }
- aCustomSettingArray.Append(item);
- CleanupStack::Pop(item);
- }
- CleanupStack::PopAndDestroy(&calendarInfoList);
-
- TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::GetCustomViewsL
- * add custom views
- */
-void CCalenCalDavPlugin::GetCustomViewsL(RPointerArray<CCalenView>&
-/*aCustomViewArray*/)
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::HandleNotification
- * handle received notifications in this plugin
- */
-void CCalenCalDavPlugin::HandleNotification(const TCalenNotification /*aNotification*/)
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-/**
- * CCalenCalDavPlugin::CanBeEnabledDisabled
- * can the plugin be disabled or enabled, called by customization manager
- */
-TBool CCalenCalDavPlugin::CanBeEnabledDisabled()
- {
- return EFalse;
- }
-
-/**
- * CCalenCalDavPlugin::CalenCustomisationExtensionL
- * add custom extensions
- */
-TAny* CCalenCalDavPlugin::CalenCustomisationExtensionL(TUid /*aExtensionUid*/)
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- return NULL;
- }
-
-/**
- * CCalenCalDavPlugin::CalenCommandHandlerExtensionL
- * CalenCommandHandlerExtensionL
- */
-TAny* CCalenCalDavPlugin::CalenCommandHandlerExtensionL(TUid /*aExtensionUid*/)
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- return NULL;
- }
-//EOF
--- a/calendarui/caldav/src/calencaldavpluginProxy.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,47 +0,0 @@
-/*
-* Copyright (c) 2010 Sun Microsystems, Inc. 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 Contributor:
-* Maximilian Odendahl
-*
-* Contributors:
-*
-* Description: calav ecom plugin proxy implementation
-*
-*/
-
-#include <implementationproxy.h>
-
-#include "CalDavUids.h"
-#include "calencaldavplugin.h"
-
-
-// ----------------------------------------------------------------------------
-// ImplementationTable
-// ----------------------------------------------------------------------------
-const TImplementationProxy ImplementationTable[] =
- {
- IMPLEMENTATION_PROXY_ENTRY( CALEN_CALDAV_IMPLEMENTATION_UID,
- CCalenCalDavPlugin::NewL )
-
- };
-
-
-// ----------------------------------------------------------------------------
-// ImplementationGroupProxy
-// ----------------------------------------------------------------------------
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
- {
- aTableCount = sizeof(ImplementationTable) / sizeof (TImplementationProxy);
- return ImplementationTable;
- }
-
-// ----------------------------------------------------------------------------
-// End of file
-// ----------------------------------------------------------------------------
-
--- a/calendarui/commonutils/bwins/calencommonutilsu.def Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/commonutils/bwins/calencommonutilsu.def Wed Oct 13 14:30:35 2010 +0300
@@ -138,12 +138,3 @@
?AttachmentOpen@CCalenAttachmentModel@@QAEXAAH@Z @ 137 NONAME ; void CCalenAttachmentModel::AttachmentOpen(int &)
?IsAttachmentOpen@CCalenAttachmentModel@@QAEHXZ @ 138 NONAME ; int CCalenAttachmentModel::IsAttachmentOpen(void)
?ShowNaviPaneL@CCalenStatusPaneUtils@@QAEPAVCAknNavigationDecorator@@ABVTDesC16@@VTRgb@@@Z @ 139 NONAME ; class CAknNavigationDecorator * CCalenStatusPaneUtils::ShowNaviPaneL(class TDesC16 const &, class TRgb)
- ?DateTimeToKoreanL@CKoreanCalConv@@QAEXABVTDateTime@@AAVTChineseDate@@@Z @ 140 NONAME ; void CKoreanCalConv::DateTimeToKoreanL(class TDateTime const &, class TChineseDate &)
- ?DateRange@CKoreanCalConv@@QAEXAAVTDateTime@@0@Z @ 141 NONAME ; void CKoreanCalConv::DateRange(class TDateTime &, class TDateTime &)
- ?CalendarType@CCalenEntryUtil@@QBE?AW4TLunarCalendarType@@XZ @ 142 NONAME ; enum TLunarCalendarType CCalenEntryUtil::CalendarType(void) const
- ?SetCalendarTypeL@CCalenEntryUtil@@QAEXW4TLunarCalendarType@@@Z @ 143 NONAME ; void CCalenEntryUtil::SetCalendarTypeL(enum TLunarCalendarType)
- ?DateRange@CKoreanCalConv@@QAEXAAVTChineseDate@@0@Z @ 144 NONAME ; void CKoreanCalConv::DateRange(class TChineseDate &, class TChineseDate &)
- ?KoreanToDateTimeL@CKoreanCalConv@@QAEXAAVTChineseDate@@AAVTDateTime@@@Z @ 145 NONAME ; void CKoreanCalConv::KoreanToDateTimeL(class TChineseDate &, class TDateTime &)
- ?NewL@CKoreanCalConv@@SAPAV1@XZ @ 146 NONAME ; class CKoreanCalConv * CKoreanCalConv::NewL(void)
- ?NewLC@CKoreanCalConv@@SAPAV1@XZ @ 147 NONAME ; class CKoreanCalConv * CKoreanCalConv::NewLC(void)
-
--- a/calendarui/commonutils/eabi/calencommonutilsu.def Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/commonutils/eabi/calencommonutilsu.def Wed Oct 13 14:30:35 2010 +0300
@@ -151,14 +151,4 @@
_ZN21CCalenAttachmentModel14AttachmentOpenERi @ 150 NONAME
_ZN21CCalenAttachmentModel16IsAttachmentOpenEv @ 151 NONAME
_ZN21CCalenStatusPaneUtils13ShowNaviPaneLERK7TDesC164TRgb @ 152 NONAME
- _ZN14CKoreanCalConv17DateTimeToKoreanLERK9TDateTimeR12TChineseDate @ 153 NONAME
- _ZN14CKoreanCalConv17KoreanToDateTimeLER12TChineseDateR9TDateTime @ 154 NONAME
- _ZN14CKoreanCalConv4NewLEv @ 155 NONAME
- _ZN14CKoreanCalConv5NewLCEv @ 156 NONAME
- _ZN14CKoreanCalConv9DateRangeER12TChineseDateS1_ @ 157 NONAME
- _ZN14CKoreanCalConv9DateRangeER9TDateTimeS1_ @ 158 NONAME
- _ZN15CCalenEntryUtil16SetCalendarTypeLE18TLunarCalendarType @ 159 NONAME
- _ZNK15CCalenEntryUtil12CalendarTypeEv @ 160 NONAME
- _ZTI14CKoreanCalConv @ 161 NONAME
- _ZTV14CKoreanCalConv @ 162 NONAME
--- a/calendarui/commonutils/group/bld.inf Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/commonutils/group/bld.inf Wed Oct 13 14:30:35 2010 +0300
@@ -22,11 +22,11 @@
PRJ_EXPORTS
../inc/calenentryutil.h |../../inc/calenentryutil.h
../inc/calennotedatautil.h |../../inc/calennotedatautil.h
+../inc/calenlocationutil.h |../../inc/calenlocationutil.h
../inc/calenattachmentutils.h |../../inc/calenattachmentutils.h
../inc/calenattachmentinfo.h |../../inc/calenattachmentinfo.h
../inc/calenattachmentmodel.h |../../inc/calenattachmentmodel.h
../inc/calentitlepane.h |../../inc/calentitlepane.h
-../inc/KoreanCalConv.h |../../inc/KoreanCalConv.h
PRJ_MMPFILES
commonutils.mmp
--- a/calendarui/commonutils/group/commonutils.mmp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/commonutils/group/commonutils.mmp Wed Oct 13 14:30:35 2010 +0300
@@ -57,8 +57,6 @@
SOURCE calenmulticalutil.cpp
SOURCE calencustomnavilabel.cpp
-SOURCE KoreanCalConv.cpp
-
LIBRARY caleninterimutils2.lib
LIBRARY avkon.lib
@@ -101,9 +99,6 @@
LIBRARY ws32.lib
LIBRARY aknlayout2scalable.lib
LIBRARY gdi.lib
-LIBRARY ccon.lib
-
-deffile calencommonutils.def
CAPABILITY CAP_GENERAL_DLL
--- a/calendarui/commonutils/inc/KoreanCalConv.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +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:
-*
-*/
-
-#ifndef __KOREANCALCONV_H__
-#define __KOREANCALCONV_H__
-
-#include <e32base.h>
-#include <CalendarConverter.h>
-
-typedef class TChineseDate TKoreanDate;
-
-
- enum TLunarCalendarType
- {
- ESolar = 0,
- ELunar,
- ELunarLeap
- };
-
-class CKoreanCalConv : public CBase
-{
- public: /* exported public methods */
- /* Construction methods */
- IMPORT_C static CKoreanCalConv* NewL();
- IMPORT_C static CKoreanCalConv* NewLC();
-
- /* Method converting gregorian date to korean lunar date,
- supported range is 1.1.1900 - 31.12.2099
- Leaves with KErrArgument if date is uncovertible.
- */
- IMPORT_C void DateTimeToKoreanL( const TDateTime& aDateTime, TKoreanDate& aKoreanDate );
-
- /* Method converting korean lunar date to gregorian date,
- supported range is 1.1.1900 - 31.12.2099
- Leaves with KErrArgument if date is uncovertible.
- */
- IMPORT_C void KoreanToDateTimeL( TKoreanDate& aKoreanDate, TDateTime& aDateTime );
-
- /* Method getting supported gregorian date range
- */
- IMPORT_C void DateRange( TDateTime& aLower, TDateTime& aUpper );
-
- /* Method getting supported korean lunar date range
- */
- IMPORT_C void DateRange( TKoreanDate& aLower, TKoreanDate& aUpper );
-
- public: /* public methods */
- /* Desctructor */
- virtual ~CKoreanCalConv();
-
- private: /* private methods */
- /* C++ constructor */
- CKoreanCalConv();
-
- /* Second phase constructor */
- void ConstructL();
-
- private: /* Own private data */
- CChineseCalendarConverter* chineseConv;
-
-};
-
-#endif /* __KOREANCALCONV_H__ */
--- a/calendarui/commonutils/inc/calencustomnavilabel.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/commonutils/inc/calencustomnavilabel.h Wed Oct 13 14:30:35 2010 +0300
@@ -44,7 +44,7 @@
* @param aName Calendar name
* @param aColor Calendar color
*/
- void SetCalendarNameAndColorL(const TDesC& aName, const TRgb aColor);
+ void SetCalendarNameAndColor(const TDesC& aName, const TRgb aColor);
private:
--- a/calendarui/commonutils/inc/calenentryutil.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/commonutils/inc/calenentryutil.h Wed Oct 13 14:30:35 2010 +0300
@@ -25,7 +25,6 @@
#include <caltime.h>
#include "calennotedatautil.h"
-#include "KoreanCalConv.h"
#include <calentry.h>
@@ -148,19 +147,6 @@
* @return RArray<TCalTime>
*/
IMPORT_C const RArray<TCalTime> GetRdatesL();
-
- /**
- * Return Lunar Calendar Type
- *
- * @return TLunarCalendarType
- */
- IMPORT_C TLunarCalendarType CalendarType() const;
-
- /**
- * @brief set Lunar Calendar Type
- * @param TLunarCalendarType
- */
- IMPORT_C void SetCalendarTypeL(TLunarCalendarType aCalendarType);
private:
CCalenEntryUtil( CCalEntry& aEntry );
@@ -270,14 +256,6 @@
CCalEntry& iEntry;
TInt iAttachmentCount;
-
- TLunarCalendarType iCalendarType;
-
- /**
- * True if FeatureManager is initialized.
- */
- TBool iFeatMgrInitialized;
-
};
#endif // CALENEDITORDATA_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarui/commonutils/inc/calenlocationutil.h Wed Oct 13 14:30:35 2010 +0300
@@ -0,0 +1,59 @@
+/*
+ * 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: Utility class to inform calendar components if any Nokia map
+ * providers are available. Its a static API.
+ *
+ */
+
+
+#ifndef CALENLOCATIONUTIL_H
+#define CALENLOCATIONUTIL_H
+
+// System includes
+#include <e32base.h>
+#include <mnprovider.h>
+
+class CCalenLocationUtil : public CBase
+ {
+
+public:
+
+ /**
+ * API to tell claendar modules if Nokia maps provider is available
+ * in the device or not.
+ *
+ * @return ETrue if Nokia maps is installed on the device else EFalse.
+ */
+ static TBool IsMapProviderAvailableL();
+
+ /**
+ * Utility function to display list query with three strings.
+ * This function will be used when user selects a map location
+ * when there is already some invalidated location for the event.
+ * First string will be a combination of lod text and newly
+ * selected map locaiton. Second string will be newly selected map location.
+ * Third strign will be old invalidated text.
+ *
+ * @params aStrings Array of three strings.
+ * @return 0 for first string, 1 for second and 2 for third string when user
+ * selects his choice. If cancelled, returns -1.
+ */
+ static TInt ShowLocationAppendOrReplaceL(
+ RPointerArray< HBufC >& aStrings );
+
+ };
+
+#endif // CALENLOCATIONUTIL_H
+
+// End of file --Don't remove this.
--- a/calendarui/commonutils/src/CalenStatusPaneUtilsImpl.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/commonutils/src/CalenStatusPaneUtilsImpl.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -162,7 +162,7 @@
{
CCoeControl* coeRes = iNaviLabel->DecoratedControl();
CCustomNaviControl *actualLabel = static_cast<CCustomNaviControl*>(coeRes);
- actualLabel->SetCalendarNameAndColorL(aName, aColor);
+ actualLabel->SetCalendarNameAndColor(aName, aColor);
actualLabel->DrawDeferred();
iNaviContainer->ReplaceL(*iNaviLabel, *iNaviLabel);
}
--- a/calendarui/commonutils/src/KoreanCalConv.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,528 +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: Implementation of View Utils
-*
-*/
-
-#include "KoreanCalConv.h"
-
-//debug
-#include "calendarui_debug.h"
-
-/* Leap month exceptions for fixing conversion result
- to match Korean lunar calendar:
-
- year cycle, year, Chinese leap month, Korean leap month
-*/
-typedef struct
-{
- TInt cycle;
- TInt year;
- TInt chineseLeapMonth;
- TInt koreanLeapMonth;
-} TLeapExceptions;
-
-//CONSTANTS
-const TLeapExceptions KLeapExceptions[] = { {78, 29, 4, 3},
- {78, 34, 6, 5},
- {79, 56, 2, 3} };
-
-const TInt KLeapExceptionCnt = (sizeof( KLeapExceptions ) / sizeof( TLeapExceptions ));
-
-/* Month length exceptions for fixing conversion result
- to match Korean lunar calendar. Corresponding months
- have 30 days in Korean lunar calendar and 29 days
- in Chinese lunar calendar. The next month always contains
- 30 days in Chinese lunar calendar and 29 days in Korean
- lunar calendar:
-
- year cycle, year, korean month, flag indicating leap month, flag indicating next month is leap
-*/
-typedef struct
-{
- TInt cycle;
- TInt year;
- TInt koreanMonth;
- TBool isLeapMonth;
- TBool nextIsLeapMonth;
-} TMonthExceptions;
-
-const TMonthExceptions KMonthExceptions[] = { {76, 43, 3, EFalse, EFalse },
- {76, 51, 5, EFalse, ETrue },
- {76, 51, 9, EFalse, EFalse },
- {76, 52, 12, EFalse, EFalse },
- {76, 55, 10, EFalse, EFalse },
- {76, 56, 7, EFalse, ETrue },
- {76, 56, 9, EFalse, EFalse },
- {76, 57, 9, EFalse, EFalse },
- {76, 60, 9, EFalse, EFalse },
- {77, 1, 1, EFalse, EFalse },
- {77, 2, 4, EFalse, ETrue },
- {77, 4, 9, EFalse, EFalse },
- {77, 5, 8, EFalse, EFalse },
- {77, 8, 3, EFalse, EFalse },
- {77, 11, 8, EFalse, EFalse },
- {77, 13, 5, EFalse, EFalse },
- {77, 19, 7, EFalse, EFalse },
- {77, 19, 9, EFalse, EFalse },
- {77, 20, 10, EFalse, EFalse },
- {77, 20, 12, EFalse, EFalse },
- {77, 26, 2, EFalse, EFalse },
- {77, 27, 1, EFalse, EFalse },
- {77, 27, 4, EFalse, EFalse },
- {77, 29, 6, EFalse, EFalse },
- {77, 30, 12, EFalse, EFalse },
- {77, 32, 1, EFalse, EFalse },
- {77, 34, 12, EFalse, EFalse },
- {77, 45, 3, EFalse, EFalse },
- {77, 47, 5, EFalse, EFalse },
- {77, 49, 11, EFalse, EFalse },
- {77, 50, 11, EFalse, EFalse },
- {77, 53, 9, EFalse, EFalse },
- {77, 55, 2, EFalse, EFalse },
- {77, 59, 9, EFalse, EFalse },
- {78, 4, 4, EFalse, EFalse },
- {78, 4, 12, EFalse, EFalse },
- {78, 6, 9, EFalse, EFalse },
- {78, 12, 6, EFalse, EFalse },
- {78, 12, 9, EFalse, EFalse },
- {78, 13, 12, EFalse, EFalse },
- {78, 15, 11, EFalse, EFalse },
- {78, 18, 3, EFalse, EFalse },
- {78, 22, 10, EFalse, EFalse },
- {78, 29, 4, EFalse, EFalse },
- {78, 29, 6, EFalse, EFalse },
- {78, 30, 4, EFalse, EFalse },
- {78, 36, 10, EFalse, EFalse },
- {78, 37, 1, EFalse, EFalse },
- {78, 40, 3, EFalse, EFalse },
- {78, 43, 8, EFalse, EFalse },
- {78, 43, 12, EFalse, EFalse },
- {78, 44, 12, EFalse, EFalse },
- {78, 46, 5, EFalse, EFalse },
- {78, 48, 1, EFalse, EFalse },
- {78, 52, 11, EFalse, EFalse },
- {78, 53, 10, EFalse, EFalse },
- {78, 57, 7, EFalse, EFalse },
- {78, 58, 1, EFalse, EFalse },
- {78, 59, 10, EFalse, EFalse },
- {79, 3, 4, EFalse, EFalse },
- {79, 5, 10, EFalse, EFalse },
- {79, 7, 1, EFalse, EFalse },
- {79, 8, 6, EFalse, EFalse },
- {79, 8, 9, EFalse, EFalse },
- {79, 9, 8, ETrue, EFalse },
- {79, 15, 5, EFalse, EFalse },
- {79, 16, 8, EFalse, EFalse },
- {79, 17, 8, EFalse, EFalse },
- {79, 17, 12, EFalse, EFalse },
- {79, 20, 3, EFalse, EFalse },
- {79, 25, 5, EFalse, EFalse },
- {79, 26, 1, EFalse, EFalse },
- {79, 27, 1, EFalse, EFalse },
- {79, 28, 2, EFalse, EFalse },
- {79, 31, 6, ETrue, EFalse },
- {79, 37, 9, EFalse, EFalse },
- {79, 38, 1, EFalse, EFalse },
- {79, 39, 6, EFalse, EFalse },
- {79, 45, 12, EFalse, EFalse },
- {79, 46, 7, EFalse, EFalse },
- {79, 51, 1, EFalse, EFalse },
- {79, 53, 7, EFalse, EFalse },
- {79, 54, 6, EFalse, EFalse },
- {79, 55, 7, EFalse, EFalse },
- {79, 55, 11, EFalse, EFalse },
- {79, 56, 3, EFalse, ETrue } };
-
-const TInt KMonthExceptionCnt = (sizeof( KMonthExceptions ) / sizeof( TMonthExceptions ));
-
-// -----------------------------------------------------------------------------
-// CKoreanCalConv::NewL
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CKoreanCalConv* CKoreanCalConv::NewL()
- {
- TRACE_ENTRY_POINT;
- CKoreanCalConv* self = CKoreanCalConv::NewLC();
- CleanupStack::Pop( self );
-
- TRACE_EXIT_POINT;
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CKoreanCalConv::NewLC
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C CKoreanCalConv* CKoreanCalConv::NewLC()
- {
- TRACE_ENTRY_POINT;
- CKoreanCalConv* self = new (ELeave) CKoreanCalConv();
- CleanupStack::PushL( self );
- self->ConstructL();
-
- TRACE_EXIT_POINT;
- return self;
- }
-
-// -----------------------------------------------------------------------------
-// CKoreanCalConv::CKoreanCalConv
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-CKoreanCalConv::CKoreanCalConv()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CKoreanCalConv::ConstructL
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CKoreanCalConv::ConstructL()
- {
- TRACE_ENTRY_POINT;
- chineseConv = CChineseCalendarConverter::NewL();
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CKoreanCalConv::~CKoreanCalConv
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-CKoreanCalConv::~CKoreanCalConv()
- {
- TRACE_ENTRY_POINT;
- delete chineseConv;
- TRACE_EXIT_POINT;
- }
-
-
-// -----------------------------------------------------------------------------
-// CKoreanCalConv::DateTimeToKoreanL
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CKoreanCalConv::DateTimeToKoreanL( const TDateTime& aDateTime, TKoreanDate& aKoreanDate )
- {
- TRACE_ENTRY_POINT;
- TInt i;
-
- /* Use the chinese converter for initial result */
- chineseConv->DateTimeToChineseL( aDateTime, aKoreanDate );
-
- /* Check if leap month fix is needed */
- for( i = 0 ; i < KLeapExceptionCnt ; i++ )
- {
- if( KLeapExceptions[i].cycle == aKoreanDate.iCycle &&
- KLeapExceptions[i].year == aKoreanDate.iYear )
- { /* Year contains an exception */
- if( KLeapExceptions[i].koreanLeapMonth < KLeapExceptions[i].chineseLeapMonth )
- {
- if( aKoreanDate.iLeapMonth )
- { /* Resulted month is leap month in Chinese but not in Korean,
- fix by unsetting the leap month flag */
- aKoreanDate.iLeapMonth = EFalse;
- }
- else
- {
- if( aKoreanDate.iMonth == (KLeapExceptions[i].koreanLeapMonth + 1) )
- { /* Resulted month is actually a leap month on Korean Calendar,
- fix by setting the leap month flag and decreasing month by one */
- aKoreanDate.iLeapMonth = ETrue;
- aKoreanDate.iMonth -= 1;
- }
-
- /* See if month needs an offset fix */
- if( aKoreanDate.iMonth > KLeapExceptions[i].koreanLeapMonth &&
- aKoreanDate.iMonth <= KLeapExceptions[i].chineseLeapMonth )
- { /* Between the leap months, fix by decreasing the month by one */
- aKoreanDate.iMonth -= 1;
- }
- }
- }
- else if( KLeapExceptions[i].koreanLeapMonth > KLeapExceptions[i].chineseLeapMonth )
- {
- if( aKoreanDate.iLeapMonth )
- { /* Resulted month is leap month in Chinese but not in Korean,
- fix by unsetting the leap month flag and increase the month by one */
- aKoreanDate.iLeapMonth = EFalse;
- aKoreanDate.iMonth += 1;
- }
- else
- {
- if( aKoreanDate.iMonth == KLeapExceptions[i].koreanLeapMonth )
- { /* Resulted month is actually a leap month on Korean Calendar,
- fix by setting the leap month flag */
- aKoreanDate.iLeapMonth = ETrue;
- }
-
- /* See if month needs an offset fix */
- if( aKoreanDate.iMonth > KLeapExceptions[i].chineseLeapMonth &&
- aKoreanDate.iMonth < KLeapExceptions[i].koreanLeapMonth )
- { /* Between the leap months, fix by increasing the month by one */
- aKoreanDate.iMonth += 1;
- }
- }
- }
- break;
- }
- }
-
- /* Check if month length fix is needed */
- for( i = 0 ; i < KMonthExceptionCnt ; i++ )
- {
- if( (KMonthExceptions[i].cycle == aKoreanDate.iCycle &&
- KMonthExceptions[i].year == aKoreanDate.iYear &&
- KMonthExceptions[i].koreanMonth != 12 &&
- aKoreanDate.iMonth != 1) ||
- (KMonthExceptions[i].koreanMonth == 12 && aKoreanDate.iMonth == 1 &&
- (KMonthExceptions[i].year == (aKoreanDate.iYear - 1) &&
- KMonthExceptions[i].cycle == aKoreanDate.iCycle) ||
- (KMonthExceptions[i].year == 60 && aKoreanDate.iYear == 1 &&
- KMonthExceptions[i].cycle == (aKoreanDate.iCycle - 1))) )
- { /* Year may contain an exception */
- if( (KMonthExceptions[i].koreanMonth == (aKoreanDate.iMonth - 1) &&
- !(KMonthExceptions[i].nextIsLeapMonth || aKoreanDate.iLeapMonth)) ||
- (KMonthExceptions[i].koreanMonth == 12 && aKoreanDate.iMonth == 1) ||
- (KMonthExceptions[i].koreanMonth == aKoreanDate.iMonth &&
- KMonthExceptions[i].nextIsLeapMonth && aKoreanDate.iLeapMonth) )
- { /* Month contains an exception, decrease the day by one */
- if( aKoreanDate.iDay == 1 )
- {
- aKoreanDate.iDay = 30;
- if( aKoreanDate.iMonth == 1 )
- {
- aKoreanDate.iMonth = 12;
- if( aKoreanDate.iYear == 1 )
- {
- aKoreanDate.iYear = 60;
- aKoreanDate.iCycle -= 1;
- }
- else
- {
- aKoreanDate.iYear -= 1;
- }
- }
- else
- {
- if( !aKoreanDate.iLeapMonth )
- { /* Leap months don't need month decreasing */
- aKoreanDate.iMonth -= 1;
- }
- if( KMonthExceptions[i].isLeapMonth )
- {
- aKoreanDate.iLeapMonth = ETrue;
- }
- else
- {
- aKoreanDate.iLeapMonth = EFalse;
- }
- }
- }
- else
- {
- aKoreanDate.iDay -= 1;
- }
- break;
- }
- }
- }
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CKoreanCalConv::KoreanToDateTimeL
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CKoreanCalConv::KoreanToDateTimeL( TKoreanDate& aKoreanDate, TDateTime& aDateTime )
- {
- TRACE_ENTRY_POINT;
- TInt i;
- TKoreanDate fixDate = aKoreanDate;
-
- /* Check if month length fix is needed */
- for( i = 0 ; i < KMonthExceptionCnt ; i++ )
- {
- if( (KMonthExceptions[i].cycle == fixDate.iCycle &&
- KMonthExceptions[i].year == fixDate.iYear &&
- fixDate.iMonth != 1) ||
- (fixDate.iMonth == 1 &&
- (KMonthExceptions[i].year == (fixDate.iYear - 1) &&
- KMonthExceptions[i].cycle == fixDate.iCycle) ||
- (KMonthExceptions[i].year == 60 && fixDate.iYear == 1 &&
- KMonthExceptions[i].cycle == (fixDate.iCycle - 1))) )
- { /* Year may contain an exception */
- if( (KMonthExceptions[i].koreanMonth == fixDate.iMonth &&
- KMonthExceptions[i].isLeapMonth == fixDate.iLeapMonth) )
- { /* Month contains an exception */
- if( fixDate.iDay == 30 )
- { /* Fix the last day to be the first day of next month */
- fixDate.iDay = 1;
- if( fixDate.iMonth == 12 )
- {
- fixDate.iMonth = 1;
- if( fixDate.iYear == 60 )
- {
- fixDate.iYear = 1;
- fixDate.iCycle += 1;
- }
- else
- {
- fixDate.iYear += 1;
- }
- }
- else
- {
- if( KMonthExceptions[i].nextIsLeapMonth )
- { /* Leap months don't need increasing,
- just set the flag */
- fixDate.iLeapMonth = ETrue;
- }
- else
- {
- fixDate.iLeapMonth = EFalse;
- fixDate.iMonth += 1;
- }
- }
- }
- break;
- }
- else if( (KMonthExceptions[i].koreanMonth == (fixDate.iMonth - 1) &&
- !(KMonthExceptions[i].nextIsLeapMonth || fixDate.iLeapMonth)) ||
- (KMonthExceptions[i].koreanMonth == 12 && fixDate.iMonth == 1) ||
- (KMonthExceptions[i].koreanMonth == fixDate.iMonth &&
- KMonthExceptions[i].nextIsLeapMonth && fixDate.iLeapMonth) )
- { /* It is the month following the exception, increase the day by one */
- if( fixDate.iDay == 30 )
- { /* Invalid day, Korean Lunar calendar has always only 29 days
- after the exception month */
- User::Leave( KErrArgument );
- }
- else
- {
- fixDate.iDay += 1;
- }
- break;
- }
- }
- }
-
- /* Check if leap month fix is needed */
- for( i = 0 ; i < KLeapExceptionCnt ; i++ )
- {
- if( KLeapExceptions[i].cycle == fixDate.iCycle &&
- KLeapExceptions[i].year == fixDate.iYear )
- { /* Year contains an exception */
- if( KLeapExceptions[i].koreanLeapMonth != fixDate.iMonth &&
- fixDate.iLeapMonth )
- { /* This year does not have the requested leap month in
- Korean lunar calendar, leave with error */
- User::Leave( KErrArgument );
- }
-
- if( fixDate.iMonth == KLeapExceptions[i].koreanLeapMonth &&
- fixDate.iLeapMonth )
- { /* Leap month in Korean lunar calendar, but not in Chinese
- lunar calendar, fix by clearing the leap indicator*/
- fixDate.iLeapMonth = EFalse;
- if( KLeapExceptions[i].koreanLeapMonth < KLeapExceptions[i].chineseLeapMonth )
- { /* Also month needs to be increased */
- fixDate.iMonth += 1;
- }
- }
- else if( fixDate.iMonth > KLeapExceptions[i].koreanLeapMonth &&
- fixDate.iMonth < KLeapExceptions[i].chineseLeapMonth )
- { /* Month between the leap month */
- if( KLeapExceptions[i].koreanLeapMonth < KLeapExceptions[i].chineseLeapMonth )
- {
- fixDate.iMonth += 1;
- }
- else
- {
- fixDate.iMonth -= 1;
- }
- }
- else if( fixDate.iMonth == (KLeapExceptions[i].chineseLeapMonth + 1) &&
- !fixDate.iLeapMonth )
- { /* Leap month in Chinese lunar calendar, fix by decreasing
- the monrth by one and setting the leap indicator */
- fixDate.iMonth -= 1;
- fixDate.iLeapMonth = ETrue;
- }
- chineseConv->ChineseToDateTimeL( fixDate, aDateTime );
-
- TRACE_EXIT_POINT;
- return;
- }
- }
- /* Use the chinese converter for result */
- chineseConv->ChineseToDateTimeL( fixDate, aDateTime );
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CKoreanCalConv::DateRange
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CKoreanCalConv::DateRange( TDateTime& aLower, TDateTime& aUpper )
- {
- TRACE_ENTRY_POINT;
- aLower.SetYear( 1900 );
- aLower.SetMonth( EJanuary );
- aLower.SetDay( 1 );
- aUpper.SetYear( 2099 );
- aUpper.SetMonth( EDecember );
- aUpper.SetDay( 31 );
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CKoreanCalConv::DateRange
-// ?implementation_description
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-EXPORT_C void CKoreanCalConv::DateRange( TKoreanDate& aLower, TKoreanDate& aUpper )
- {
- TRACE_ENTRY_POINT;
- aLower.iCycle = 76;
- aLower.iYear = 36;
- aLower.iMonth = 12;
- aLower.iDay = 1;
- aLower.iLeapMonth = EFalse;
- aUpper.iCycle = 79;
- aUpper.iYear = 56;
- aUpper.iMonth = 11;
- aUpper.iDay = 20;
- aUpper.iLeapMonth = EFalse;
- TRACE_EXIT_POINT;
- }
-
-// End of file
--- a/calendarui/commonutils/src/calencustomnavilabel.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/commonutils/src/calencustomnavilabel.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -72,7 +72,7 @@
// CCustomNaviControl::SetCalendarNameAndColor
// Sets the Calendar name and Color.
// ----------------------------------------------------------------------------
-void CCustomNaviControl::SetCalendarNameAndColorL(const TDesC& aName, const TRgb aColor)
+void CCustomNaviControl::SetCalendarNameAndColor(const TDesC& aName, const TRgb aColor)
{
TRACE_ENTRY_POINT;
delete iCalendarName;
--- a/calendarui/commonutils/src/calenentryutil.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/commonutils/src/calenentryutil.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -30,8 +30,6 @@
#include <calentry.h>
#include <calrrule.h>
#include <calattachment.h>
-#include <bldvariant.hrh> // for feature definitions
-#include <featmgr.h>
// Utility functions
@@ -141,15 +139,6 @@
delete iSummary;
delete iLocation;
delete iDescription;
-
- // Do not call UnInitializeLib() if InitalizeLib() leaves.
- if ( iFeatMgrInitialized )
- {
- // Frees the TLS. Must be done after FeatureManager is used.
- FeatureManager::UnInitializeLib();
- }
-
-
TRACE_EXIT_POINT;
}
@@ -703,12 +692,6 @@
const TCalTime& aInstanceDateTime )
{
TRACE_ENTRY_POINT;
- // Sets up TLS, must be done before FeatureManager is used.
- FeatureManager::InitializeLibL();
- // Used in destructor.
- iFeatMgrInitialized = ETrue;
-
-
iEntryType = aEntry.EntryTypeL();
iEntryStatus = aEntry.StatusL();
CopyDataFromEntryL( aEntry, aInstanceDateTime );
@@ -769,10 +752,6 @@
{
TTime event = aInstanceDateTime.TimeLocalL();
SetEventDateL( event );
- if ( FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- SetCalendarTypeL( ( TLunarCalendarType )aEntry.UserInt32L() );
- }
}
break;
@@ -937,25 +916,13 @@
{
// If the instance matches one of the RDates
if( (aInstanceDateTime.TimeLocalL()) == (rdates[ index ].TimeLocalL()) )
- {
- // instanceAlarmDay = actualAlarmDay + (alarmOffsetStart - alarmOffsetInstance)
- deltaDays = alarmDateTime.DaysFrom( aEntry.StartTimeL().TimeLocalL() ).Int()
- - alarmDateTime.DaysFrom( aInstanceDateTime.TimeLocalL() ).Int();
- alarmDateTime += deltaDays;
- if ( FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- if ( aEntry.EntryTypeL() == CCalEntry::EAnniv && CalendarType() != ESolar )
- {
- alarmDateTime = aEntry.StartTimeL().TimeLocalL();
- CCalAlarm* alarm = aEntry.AlarmL();
- if(alarm)
- {
- alarmDateTime = aInstanceDateTime.TimeLocalL() - alarm->TimeOffset();
- }
- }
- }
- break;
- }
+ {
+ // instanceAlarmDay = actualAlarmDay + (alarmOffsetStart - alarmOffsetInstance)
+ deltaDays = alarmDateTime.DaysFrom( aEntry.StartTimeL().TimeLocalL() ).Int()
+ - alarmDateTime.DaysFrom( aInstanceDateTime.TimeLocalL() ).Int();
+ alarmDateTime += deltaDays;
+ break;
+ }
}
}
SetAlarmOnL( alarmDateTime );
@@ -1073,31 +1040,4 @@
TRACE_EXIT_POINT;
}
-// ---------------------------------------------------------------------------
-// CalenViewUtils::CalendarType
-// (other items were commented in a header)
-// ---------------------------------------------------------------------------
-//
-EXPORT_C TLunarCalendarType CCalenEntryUtil::CalendarType() const
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
-
- return iCalendarType;
- }
-
-// ---------------------------------------------------------------------------
-// CalenViewUtils::SetCalendarTypeL
-// (other items were commented in a header)
-// ---------------------------------------------------------------------------
-//
-EXPORT_C void CCalenEntryUtil::SetCalendarTypeL(TLunarCalendarType aCalendarType)
- {
- TRACE_ENTRY_POINT;
-
- iCalendarType = aCalendarType;
- TRACE_EXIT_POINT;
-
- }
-
// End of file
--- a/calendarui/commonutils/src/calenlocationutil.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/commonutils/src/calenlocationutil.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -15,7 +15,7 @@
*
*/
-#include <calenlocationutil.h>
+#include "calenlocationutil.h"
#include <mnproviderfinder.h>
#include <aknPopup.h>
#include <eikenv.h>
--- a/calendarui/controller/inc/calenattachmentui.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/inc/calenattachmentui.h Wed Oct 13 14:30:35 2010 +0300
@@ -76,7 +76,7 @@
*/
void ConstructL();
- void CheckDRMStatusL(const TDesC& aFileName,TBool& aProtection);
+ void CheckDRMStatus(const TDesC& aFileName,TBool& aProtection);
public:
@@ -229,12 +229,12 @@
/**
* Compares the binary data for the text files.
*/
- TBool CompareContentOfTextFilesL(const TDesC& aSelectedFile,const TDesC& aAlreadyAttachedFile);
+ TBool CompareContentOfTextFiles(const TDesC& aSelectedFile,const TDesC& aAlreadyAttachedFile);
/**
* Remove the temporary file after attaching the attachtment to tht entry.
*/
- void RemoveTemporaryFilesL();
+ void RemoveTemporaryFiles();
private:
--- a/calendarui/controller/inc/calenlocationui.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/inc/calenlocationui.h Wed Oct 13 14:30:35 2010 +0300
@@ -197,7 +197,7 @@
* hard key is pressed.
* @return User response
**/
- TInt ShowDefineLocationQueryL();
+ TInt ShowDefineLocationQuery();
private: // data
--- a/calendarui/controller/inc/calenmultipledbui.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/inc/calenmultipledbui.h Wed Oct 13 14:30:35 2010 +0300
@@ -347,7 +347,6 @@
CAsyncCallBack* iAsyncAction;
TInt iAsyncActionCmd;
TInt iCurrentIndex;
- HBufC* iCalEditedDefaultName;
};
--- a/calendarui/controller/src/calenalarmmanager.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/calenalarmmanager.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -980,42 +980,39 @@
void CCalenAlarmManager::UpdateMissedAlarmsListL()
{
TRACE_ENTRY_POINT;
-
+
+ RPointerArray<CMissedAlarm> missedAlarmStorelist;
+ CleanupResetAndDestroyPushL( missedAlarmStorelist );
+ iMissedAlarmStore->GetL(missedAlarmStorelist);
+
TUint32 newCount;
// update the missed alarms count
iMissedAlarmStore->CountL(newCount);
-
- // Need atleast one missed alarm to perform this
- if(newCount>0)
+
+ TCalenInstanceId instanceId;
+ TInt entryLocalUid;
+ TTime instanceTime;
+
+ //Retreiving the latest missed alarm array entry
+ CMissedAlarm* missedAlarm = missedAlarmStorelist[newCount-1];
+ entryLocalUid = missedAlarm->iLuid;
+ instanceTime = missedAlarm->iInstanceTime;
+
+ CCalSession &session = iController.Services().SessionL( missedAlarm->iCalFileName );
+ // pack instance ids of the missed alarm instances
+ TRAP_IGNORE(instanceId = TCalenInstanceId::CreateL( entryLocalUid,
+ instanceTime, 0 ));
+ instanceId.iColId = session.CollectionIdL();
+ iMissedAlarmList.Append(instanceId);
+ CleanupStack::PopAndDestroy(); // missedAlarmStorelist
+
+ // if iMissedAlarmList count is greater than maximum missed alarms(10)
+ // remove the old missed alarm(index = 0) from the list
+ if(iMissedAlarmList.Count()>KMaxMissedAlarms)
{
- RPointerArray<CMissedAlarm> missedAlarmStorelist;
- CleanupResetAndDestroyPushL( missedAlarmStorelist );
- TCalenInstanceId instanceId;
- TInt entryLocalUid;
- TTime instanceTime;
-
- iMissedAlarmStore->GetL(missedAlarmStorelist);
-
- //Retreiving the latest missed alarm array entry
- CMissedAlarm* missedAlarm = missedAlarmStorelist[newCount-1];
- entryLocalUid = missedAlarm->iLuid;
- instanceTime = missedAlarm->iInstanceTime;
-
- CCalSession &session = iController.Services().SessionL( missedAlarm->iCalFileName );
- // pack instance ids of the missed alarm instances
- TRAP_IGNORE(instanceId = TCalenInstanceId::CreateL( entryLocalUid,
- instanceTime, 0 ));
- instanceId.iColId = session.CollectionIdL();
- iMissedAlarmList.Append(instanceId);
- CleanupStack::PopAndDestroy(); // missedAlarmStorelist
-
- // if iMissedAlarmList count is greater than maximum missed alarms(10)
- // remove the old missed alarm(index = 0) from the list
- if(iMissedAlarmList.Count()>KMaxMissedAlarms)
- {
- iMissedAlarmList.Remove(0);
- }
+ iMissedAlarmList.Remove(0);
}
+
TRACE_EXIT_POINT;
}
@@ -1123,29 +1120,27 @@
// FIXME: leaving!
CCalAlarm* alarm = aEntry.AlarmL();
-
if(alarm)
{
- CleanupStack::PushL( alarm );
+ CleanupStack::PushL( alarm );
- switch( aEntry.EntryTypeL() )
- {
- case CCalEntry::ETodo:
- aAlarmDateTime = aEntry.EndTimeL().TimeLocalL();
- break;
+ switch( aEntry.EntryTypeL() )
+ {
+ case CCalEntry::ETodo:
+ aAlarmDateTime = aEntry.EndTimeL().TimeLocalL();
+ break;
- case CCalEntry::EAppt:
- case CCalEntry::EEvent:
- case CCalEntry::EAnniv:
- default:
- aAlarmDateTime = aEntry.StartTimeL().TimeLocalL();
- break;
- }
- aAlarmDateTime -= alarm->TimeOffset();
-
- CleanupStack::PopAndDestroy( alarm );
+ case CCalEntry::EAppt:
+ case CCalEntry::EEvent:
+ case CCalEntry::EAnniv:
+ default:
+ aAlarmDateTime = aEntry.StartTimeL().TimeLocalL();
+ break;
+ }
+ aAlarmDateTime -= alarm->TimeOffset();
+
+ CleanupStack::PopAndDestroy( alarm );
}
-
TRACE_EXIT_POINT;
}
--- a/calendarui/controller/src/calenattachmentui.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/calenattachmentui.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -159,7 +159,7 @@
{
iAttachmentModel->Reset();
iController.BroadcastNotification(ECalenNotifyAttachmentRemoved);
- RemoveTemporaryFilesL();
+ RemoveTemporaryFiles();
}
else
{
@@ -222,7 +222,7 @@
iAttachmentModel->Reset();
}
// clear calendar editor's folder
- RemoveTemporaryFilesL();
+ RemoveTemporaryFiles();
iAttachmentInfoIntialized = EFalse;
}
break;
@@ -251,7 +251,7 @@
// add attachments to the entry being viewed in event viewer
AddAttachmentsToEntryL();
// clear calendar editor's folder
- RemoveTemporaryFilesL();
+ RemoveTemporaryFiles();
iAttachmentModel->Reset();
}
@@ -566,7 +566,7 @@
}
TBool isAlreadyExists = IsDuplicateNameL(parsedFileName);
- CheckDRMStatusL(aSourceFilePath,drmProtected);
+ CheckDRMStatus(aSourceFilePath,drmProtected);
if(drmProtected || isAlreadyExists)
{
@@ -835,7 +835,7 @@
// CCalenAttachmentUi::CheckDRMStatus()
// -----------------------------------------------------------------------------
//
-void CCalenAttachmentUi::CheckDRMStatusL( const TDesC& aFileName,TBool& aProtection )
+void CCalenAttachmentUi::CheckDRMStatus( const TDesC& aFileName,TBool& aProtection )
{
TRACE_ENTRY_POINT;
@@ -920,7 +920,7 @@
// Compares the binary data of already attached and currently selected text file.
// -----------------------------------------------------------------------------
//
-TBool CCalenAttachmentUi::CompareContentOfTextFilesL( const TDesC& aSelectedFile,
+TBool CCalenAttachmentUi::CompareContentOfTextFiles( const TDesC& aSelectedFile,
const TDesC& aAlreadyAttachedFile)
{
TRACE_ENTRY_POINT;
@@ -983,7 +983,7 @@
// removes the temporary files, those we have added to temp path.
// -----------------------------------------------------------------------------
//
-void CCalenAttachmentUi::RemoveTemporaryFilesL()
+void CCalenAttachmentUi::RemoveTemporaryFiles()
{
TRACE_ENTRY_POINT;
--- a/calendarui/controller/src/calencmdlinelauncher.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/calencmdlinelauncher.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -151,6 +151,45 @@
// If aTail is set, other app starts Calendar
if( aTail.Length() )
{
+
+
+ // Interpret 8bit data as 16bit unicode data
+ //lint -e{826} Disable the lint warning of the pointer sizes being different
+ const TText* buf = reinterpret_cast<const TText*> (aTail.Ptr());
+ TPtrC ptr(buf, aTail.Length() / (TInt) sizeof(TText));
+
+ // create cmd line parser
+ CCalenCmdLineParser* parser = CCalenCmdLineParser::NewL();
+ CleanupStack::PushL(parser);
+ // parse parameters
+ parser->ParseCommandLineL(ptr);
+ iCmdParameters = parser->CommandLineParameters();
+ CleanupStack::PopAndDestroy(); // parser
+
+ if( iCmdParameters.iCommandType == CCalenCmdLineParser::EStartTypeUidAlarmViewer
+ || iCmdParameters.iCommandType == CCalenCmdLineParser::EStartTypeUidAlarmViewerNoSnooze)
+
+ {
+ // disable the MSK feature when the same events editor is opened whose alarm is expiring.
+ if(iController.IsEditorActive())
+ {
+ TCalLocalUid uid( iCmdParameters.iLocalUid );
+ TCalCollectionId colId = iGlobalData->CalSessionL( iCmdParameters.iCalenFileName ).CollectionIdL();
+
+ // get the context
+ MCalenContext& context = iController.Services().Context();
+ TCalLocalUid entryUid = context.InstanceId().iEntryLocalUid;
+ TCalCollectionId collectionId = context.InstanceId().iColId;
+
+ if(entryUid == uid && colId == collectionId)
+ {
+ return ETrue;
+ }
+ }
+ }
+
+
+
// If we are displaying a dialog, then Calendar is obviously already open
// If we have been launched with cmd line parameters, we need to close the
// open dialog and deal with the command line. An example of this would be that
@@ -170,19 +209,6 @@
//close all open dialogs in asynchronous way
iShutter->ShutDialogsL();
}
-
- // Interpret 8bit data as 16bit unicode data
- //lint -e{826} Disable the lint warning of the pointer sizes being different
- const TText* buf = reinterpret_cast<const TText*> (aTail.Ptr());
- TPtrC ptr(buf, aTail.Length() / (TInt) sizeof(TText));
-
- // create cmd line parser
- CCalenCmdLineParser* parser = CCalenCmdLineParser::NewL();
- CleanupStack::PushL(parser);
- // parse parameters
- parser->ParseCommandLineL(ptr);
- iCmdParameters = parser->CommandLineParameters();
- CleanupStack::PopAndDestroy(); // parser
}
// If we are launched to a specific view, find and activate it.
--- a/calendarui/controller/src/calencontroller.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/calencontroller.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -435,10 +435,6 @@
{
SetFasterAppFlag( ETrue );
aCommand = ECalenFasterAppExit;
- if( iViewManager->CalenToolbar() )
- {
- iViewManager->CalenToolbar()->SetToolbarVisibilityL(ETrue);
- }
}
else if( aCommand == EAknCmdExit || aCommand == EEikCmdExit
|| aCommand == EAknSoftkeyExit )
--- a/calendarui/controller/src/calendeleteui.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/calendeleteui.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -41,7 +41,7 @@
#include <calcalendarinfo.h>
#include <calentoolbar.h>
#include <akntoolbar.h>
-#include <calenattachmentmodel.h>
+#include <CalenAttachmentModel.h>
#include "calendarui_debug.h" // Debug
#include "calendeleteui.h"
--- a/calendarui/controller/src/caleneditui.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/caleneditui.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -919,8 +919,8 @@
// (*) Alarm Default times are also set using the values
TTime activeTime(Time::NullTTime()); // initialize with NULL time
- MCalenContext &context = iGlobalData->Context();
- /*TTime& activeTimeRef = activeTime;
+ TTime& activeTimeRef = activeTime;
+ MCalenContext &context = iGlobalData->Context();
TUid currentView = iController.ViewManager().CurrentView();
if(currentView == KUidCalenWeekView)
{
@@ -945,11 +945,11 @@
}
}
else
- {*/
+ {
// use Today @ 8 am
activeTime = CalenDateUtils::Today();
activeTime = CalenDateUtils::DefaultTime(context.FocusDateAndTimeL().TimeLocalL()); // 8 am
- //}
+ }
TRACE_EXIT_POINT;
return activeTime;
--- a/calendarui/controller/src/calenlocationui.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/calenlocationui.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -20,7 +20,7 @@
//debug
#include "calendarui_debug.h"
-#include <calenlocationui.h>
+#include "calenlocationui.h"
#include "calencontroller.h"
#include <calencommands.hrh>
#include "calenlocationactiveselector.h"
@@ -193,7 +193,7 @@
break;
case ECalenShowLocationQuery:
{
- TInt userResponse = ShowDefineLocationQueryL();
+ TInt userResponse = ShowDefineLocationQuery();
if(userResponse)
{
isGetLocationAndSave = ETrue;
@@ -772,7 +772,7 @@
// Queries user to validate the location frm maps or not
// -----------------------------------------------------------------------------
//
-TInt CCalenLocationUi::ShowDefineLocationQueryL()
+TInt CCalenLocationUi::ShowDefineLocationQuery()
{
TRACE_ENTRY_POINT;
--- a/calendarui/controller/src/calenmultidbeditor.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/calenmultidbeditor.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -439,34 +439,11 @@
{
TRACE_ENTRY_POINT;
TKeyResponse keyResponse(EKeyWasNotConsumed);
- TInt ctrlid=IdOfFocusControl();
if (aType == EEventKey)
{
switch (aKeyEvent.iCode)
{
- case EKeyOK:
- if( ctrlid == ECalenMultiDbColor)
- {
- GetColorL();
- }
- else if ( ctrlid == ECalenMultiDbHiddenVisible )
- {
- iCalendarStatus = iCalendarInfo.Enabled();
- if( ECalenMultiDbHidden == iCalendarStatus )
- {
- SetVisiblityFieldL( ECalenMultiDbVisible );
- iCalendarStatus = ECalenMultiDbVisible;
- iCalendarInfo.SetEnabled(iCalendarStatus);
- }
- else
- {
- SetVisiblityFieldL( ECalenMultiDbHidden );
- iCalendarStatus = ECalenMultiDbHidden;
- iCalendarInfo.SetEnabled(iCalendarStatus);
- }
- }
- break;
case EKeyEscape:
TryExitL( EAknCmdExit );
keyResponse = EKeyWasConsumed;
@@ -645,7 +622,7 @@
if(IsFocused() && !iNoneChoosen)
{
iColVal = iChoosenColor.Value();
- TRAP_IGNORE(iPicture->SetRgbColorsL(iChoosenColor));
+ iPicture->SetRgbColorsL(iChoosenColor);
GetLineByLineAndPageIndex(1, 0)->DrawNow();
}
--- a/calendarui/controller/src/calenmultipledbui.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/calenmultipledbui.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -45,8 +45,6 @@
#include <featmgr.h>
#include <hlplch.h>
#include <csxhelp/cale.hlp.hrh>
-#include <calencontext.h>
-#include <calenservices.h>
// User includes
#include "calendarui_debug.h"
@@ -287,11 +285,7 @@
delete iCalendarInfoOriginal;
iCalendarInfoOriginal = NULL;
}
-if(iCalEditedDefaultName)
- {
- delete iCalEditedDefaultName;
- iCalEditedDefaultName = NULL;
- }
+
TRACE_EXIT_POINT;
}
@@ -693,11 +687,6 @@
TInt retError = KErrNone;
iDbEditor = NULL;
- if(iCalEditedDefaultName)
- {
- delete iCalEditedDefaultName;
- iCalEditedDefaultName = NULL;
- }
if(aItemAdded)
{
@@ -775,7 +764,6 @@
iCalendarInfoEdited = calendarInfoList[currentIndex];
- iCalEditedDefaultName = calendarInfoList[currentIndex]->FileNameL().AllocL();
CleanupStack::PopAndDestroy(&calendarInfoList);
//Take a copy of original before editing
@@ -1426,22 +1414,7 @@
case ECalenNotifyCalendarInfoCreated:
case ECalenNotifyCalendarInfoUpdated:
{
- MCalenContext& context = iController.Services().Context();
- TDesC& aConflictCalendarName = context.GetCalendarFileNameL();
- TBool isSameFileEdited = EFalse;
- if(iCalEditedDefaultName)
- {
- if(!iCalEditedDefaultName->CompareF(aConflictCalendarName))
- {
- isSameFileEdited = ETrue;
- }
- else
- {
- isSameFileEdited = EFalse;
- }
- }
-
- if (iDbEditor && isSameFileEdited)
+ if (iDbEditor)
{
iConflictOccured = ETrue;
iDbEditor->SetConflict(CCalenMultiDBEditor::EConflictUpdate);
@@ -1450,28 +1423,7 @@
break;
case ECalenNotifyCalendarFileDeleted:
{
- RPointerArray<CCalCalendarInfo> calendarInfoList;
- TBool isSameFileDeleted = EFalse;
- iController.GetAllCalendarInfoL(calendarInfoList);
- CleanupClosePushL(calendarInfoList);
- if(iCalEditedDefaultName)
- {
- for(TInt i=0; i<calendarInfoList.Count(); i++)
- {
- if(!iCalEditedDefaultName->CompareF(calendarInfoList[i]->FileNameL()))
- {
- isSameFileDeleted = EFalse;
- break;
- }
- else
- {
- isSameFileDeleted = ETrue;
- }
- }
- }
- CleanupStack::PopAndDestroy(&calendarInfoList);
-
- if (iDbEditor && isSameFileDeleted)
+ if (iDbEditor)
{
iConflictOccured = ETrue;
iDbEditor->SetConflict(CCalenMultiDBEditor::EConflictDelete);
@@ -1483,7 +1435,7 @@
}
// refresh calendar list
- TRAP_IGNORE(UpdateListboxL());
+ UpdateListboxL();
TRACE_EXIT_POINT;
}
--- a/calendarui/controller/src/calennotifier.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/calennotifier.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -45,10 +45,12 @@
#include "calenstatemachine.h"
#include "calencontroller.h"
+
const TInt KHashLength = 64;
const TInt KBuffLength = 24;
_LIT( KCalendarDatabaseFilePath, "c:calendar" );
+
// ----------------------------------------------------------------------------
// CCalenNotifier::CCalenNotifier
// C++ default constructor.
@@ -80,7 +82,10 @@
}
iHandlers.Close();
-
+
+ iBroadcastQueue.Close();
+
+
if( iFilnameDeleted )
{
delete iFilnameDeleted;
@@ -123,13 +128,10 @@
if( iGlobalData )
{
// stop listening for calendar file change notifications
- TRAP_IGNORE(iGlobalData->CalSessionL().StopFileChangeNotification());
+ iGlobalData->CalSessionL().StopFileChangeNotification();
iGlobalData->Release();
}
-
- iBroadcastQueue.Close();
-
- TRACE_EXIT_POINT;
+ TRACE_EXIT_POINT;
}
// ----------------------------------------------------------------------------
@@ -803,7 +805,6 @@
CleanupStack::PopAndDestroy(calendarInfo);
- //remove calendar except default calendar
if (err == KErrNone && markAsdelete && aCalendarInfoChangeEntries[index]->FileNameL().CompareF(
KCalendarDatabaseFilePath))
{
@@ -814,7 +815,7 @@
delete iFilnameDeleted;
iFilnameDeleted = NULL;
- }
+ }
else
{
BroadcastNotification(ECalenNotifyCalendarInfoUpdated);
--- a/calendarui/controller/src/calenviewmanager.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/controller/src/calenviewmanager.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -640,7 +640,7 @@
RequestActivationL(KUidCalenDayView);
// dim "today" toolbar item since focus is on today
- //iToolbar->Toolbar().SetItemDimmed( ECalenGotoToday, ETrue, ETrue);
+ iToolbar->Toolbar().SetItemDimmed( ECalenGotoToday, ETrue, ETrue);
}
break;
@@ -1058,7 +1058,6 @@
case ECalenNotifyEntryDeleted:
case ECalenNotifyInstanceDeleted:
{
- iAvoidRepopulation = EFalse;
HandleEntryDeleteNotificationL();
}
break;
@@ -1624,14 +1623,15 @@
{
TRACE_ENTRY_POINT;
+ if( iController.IsFasterAppFlagEnabled() )
+ {
//Set the context whenever system time is changed
TUid newViewUid = iSetting->DefaultView();
MCalenContext& context = iController.Services().Context();
TCalTime focusTime = context.DefaultCalTimeForViewsL();
context.SetFocusDateAndTimeL( focusTime,
TVwsViewId( KUidCalendar, newViewUid ));
- if( iController.IsFasterAppFlagEnabled() )
- {
+
// reset tha flag iAvoidRepopulation to refresh the view whenever
// system time is changed
iAvoidRepopulation = EFalse;
--- a/calendarui/customisationmanager/src/calencustomisationmanager.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/customisationmanager/src/calencustomisationmanager.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -593,31 +593,21 @@
case ELangEnglish_Thailand:
needsToBeRemoved.Append(KCalenChineseImplUid);
needsToBeRemoved.Append(KCalenVietnameseImplUid);
- needsToBeRemoved.Append(KCalenKoreanImplUid);
break;
case ELangTaiwanChinese:
case ELangHongKongChinese:
case ELangPrcChinese:
needsToBeRemoved.Append(KCalenThaiImplUid);
needsToBeRemoved.Append(KCalenVietnameseImplUid);
- needsToBeRemoved.Append(KCalenKoreanImplUid);
break;
case ELangVietnamese:
needsToBeRemoved.Append(KCalenThaiImplUid);
needsToBeRemoved.Append(KCalenChineseImplUid);
- needsToBeRemoved.Append(KCalenKoreanImplUid);
break;
- case ELangKorean:
- needsToBeRemoved.Append(KCalenChineseImplUid);
- needsToBeRemoved.Append(KCalenVietnameseImplUid);
- needsToBeRemoved.Append(KCalenThaiImplUid);
- break;
-
default:
needsToBeRemoved.Append(KCalenThaiImplUid);
needsToBeRemoved.Append(KCalenChineseImplUid);
needsToBeRemoved.Append(KCalenVietnameseImplUid);
- needsToBeRemoved.Append(KCalenKoreanImplUid);
break;
}
--- a/calendarui/editors/data/CalenDefaultEditorsData.rss Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/data/CalenDefaultEditorsData.rss Wed Oct 13 14:30:35 2010 +0300
@@ -30,8 +30,6 @@
#include <avkon.loc>
#include <calencommands.hrh> // Calendar commands
-#include "KoreanLunarDateEditor.rh"
-#include <calenkoreanlunar.loc>
#include "CalenDefaultEditors.hrh"
#include "CalendarVariant.hrh"
#include "calendar.hrh"
@@ -134,32 +132,6 @@
// ---------------------------------------------------------
//
-// r_korean_lunar_type_popup_items
-// Define items of "Solar/lunar:" popup list.
-//
-// ---------------------------------------------------------
-//
-RESOURCE ARRAY r_korean_lunar_type_popup_items
- {
- items=
- {
- LBUF
- {
- txt = qtn_kor_cale_note_type_solar;
- },
- LBUF
- {
- txt = qtn_kor_cale_note_type_lunar;
- },
- LBUF
- {
- txt = qtn_kor_cale_note_type_leap;
- }
- };
- }
-
-// ---------------------------------------------------------
-//
// r_calen_noteview_menubar
// Menubar for NoteView
// The upper menu title is defined in , the lower display position is.
@@ -1735,60 +1707,5 @@
LBUF { txt = qtn_cale_om_descript_exist; }
};
}
-
-// ---------------------------------------------------------
-//
-// r_korean_lunar_date_editor_line
-// Define Lunar "Date:" line
-//
-// ---------------------------------------------------------
-//
-RESOURCE DLG_LINE r_korean_lunar_date_editor_line
- {
- type = ECalenCtLunarDateEditor;
- prompt = qtn_cale_anniversary_start_date;
- id = EKoreanLunarAniversityStart; // was ecalendata tms.
- control = KOREAN_LUNAR_DATE_EDITOR
- {
- flags = 0;
- };
- }
-
-// ---------------------------------------------------------
-//
-// r_korean_lunar_noteview_type_line
-// Define "solar/lunar/leap:" line of Note Form
-//
-// ---------------------------------------------------------
-//
-RESOURCE DLG_LINE r_korean_lunar_noteview_type_line
- {
- type = EAknCtPopupField;
- prompt = qtn_kor_cale_note_type;
- id = EKoreanLunarTypeSelectSolarLunarLeap;
- // means that OK-Key works - IMPORTANT!
- itemflags = EEikDlgItemTakesEnterKey | EEikDlgItemOfferAllHotKeys;
- control = POPUP_FIELD
- {
- flags = 0;
- width = 8; // in characters
- other = " "; // Dummy
- };
- }
-
-RESOURCE TBUF r_kor_cale_note_offset_unit
- {
- buf = qtn_kor_cale_note_offset_unit;
- }
-
-RESOURCE TBUF r_qtn_kor_cale_viewer_alarm_offset
- {
- buf = qtn_kor_cale_viewer_alarm_offset;
- }
-
-RESOURCE TBUF r_qtn_kor_cale_viewer_alarm_offset_time
- {
- buf = qtn_kor_cale_viewer_alarm_offset_time;
- }
// End of File
--- a/calendarui/editors/group/CalenDefaultEditors.mmp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/group/CalenDefaultEditors.mmp Wed Oct 13 14:30:35 2010 +0300
@@ -79,9 +79,6 @@
SOURCE calenalldayfield.cpp
SOURCE calenpriorityfield.cpp
SOURCE calenunifiededitorcontrol.cpp
-SOURCE KoreanLunarDateEditor.cpp
-SOURCE KoreanLunarDateUtil.cpp
-SOURCE KoreanLunarTypeField.cpp
LIBRARY caleninterimutils2.lib
@@ -120,7 +117,6 @@
LIBRARY aknlayout2scalable.lib
LIBRARY centralrepository.lib // Central Repository
LIBRARY apmime.lib
-LIBRARY ccon.lib
// File logging
LIBRARY flogger.lib
--- a/calendarui/editors/inc/CalenDefaultEditors.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/inc/CalenDefaultEditors.h Wed Oct 13 14:30:35 2010 +0300
@@ -110,13 +110,6 @@
*/
MCalenServices* iServices;
- /**
- * True if FeatureManager is initialized.
- */
- TBool iFeatMgrInitialized;
-
-
-
};
#endif // __CALENDEFAULTEDITORS_H__
--- a/calendarui/editors/inc/CalenDefaultEditors.hrh Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/inc/CalenDefaultEditors.hrh Wed Oct 13 14:30:35 2010 +0300
@@ -34,11 +34,11 @@
#define KToDoMaxMinute 59
#define KToDoMaxHour 23
-enum TCalenEditorMenuPaneCommands
+enum //
{
// THIS RANGE SHOULD NOT OVERLAP WITH CALENDAR RANGE
//always hidden, allows easy adding of items to beginning of menu
- ECalenCommandFirstMenuItem = 5000,
+ ECalenCmdFirstMenuItem = 5000,
/* Description data commands */
ECalenCmdAddDescription,
@@ -82,8 +82,7 @@
enum //TCalenNoteCustomControls
{
- ECalenCtDescriptionField = KAknCtLastControlId + 1,
- ECalenCtLunarDateEditor
+ ECalenCtDescriptionField = KAknCtLastControlId + 1
};
enum //TCalenNoteFormConstant
@@ -98,6 +97,28 @@
/* Constants */
+enum // TCalenMinTime
+ {
+ ECalenMinDay = 0,
+ ECalenMinMonth = 0,
+ ECalenMinYear = 1900,
+ ECalenMinSecond = 0,
+ ECalenMinMinute = 0,
+ ECalenMinHour = 0,
+ ECalenMinAnnivYear = 1900
+ };
+
+enum // TCalenMaxTime
+ {
+ ECalenMaxDay = 29,
+ ECalenMaxMonth = 11,
+ ECalenMaxYear = 2100,
+ ECalenMaxSecond = 59,
+ ECalenMaxMinute = 59,
+ ECalenMaxHour = 23,
+ ECalenMaxAnnivYear = 2100 // FIXME, could be removed?
+ };
+
/**
* Date representing forever value in Repeat until field.
*/
@@ -135,9 +156,7 @@
ECalenEditorPeople,
ECalenEditorDBName,
ECalenEditorAttachment,
- ECalenEditorDescription,
- EKoreanLunarAniversityStart,
- EKoreanLunarTypeSelectSolarLunarLeap
+ ECalenEditorDescription
};
--- a/calendarui/editors/inc/CalenEditorDataHandler.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/inc/CalenEditorDataHandler.h Wed Oct 13 14:30:35 2010 +0300
@@ -279,13 +279,6 @@
* @return ETrue if modified, EFalse otherwise.
*/
TBool AllDayFieldEdited();
-
- /**
- * @brief Returns if the `Lunar event' field is modified or not.
- *
- * @return ETrue if modified, EFalse otherwise.
- */
- TBool LunarFieldEdited();
/**
* @brief To set default Alarm date time.
@@ -602,13 +595,6 @@
* @brief Holds the id of the instance which is being edited currently.
*/
TCalenInstanceId iInstanceId;
-
-
- /**
- * True if FeatureManager is initialized.
- */
- TBool iFeatMgrInitialized;
-
};
#endif // CALENEDITORDATAHANDLER_H
--- a/calendarui/editors/inc/KoreanLunarDateEditor.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,124 +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:
-*
-*/
-
-#if !defined(__KOREANLUNARDATEEDITOR_H_)
-#define __KOREANLUNARDATEEDITOR_H_
-
-// INCLUDES
-#include <eikmfne.h>
-#include <calencustomisationmanager.h>
-
-//Forward Declarations
-class CKoreanCalConv;
-class CKoreanLunarDateUtil;
-
-NONSHARABLE_CLASS( CKoreanLunarDateEditor ) : public CEikMfne//CEikDateEditor//
- {
- public: // public constructors
-
- /**
- * C++ default constructor.
- */
- CKoreanLunarDateEditor(MCalenServices* aServices);
-
- /**
- * Two phased constructor.
- */
- void ConstructL( const TInt aFlags=0 );
-
- /**
- * Two phased constructor.
- */
- static CKoreanLunarDateEditor* NewL(MCalenServices* aServices);
-
- public: // Methods for getting and setting values
-
- /**
- * Set's the date.
- * @param aDate date to set
- *
- */
- void SetDate( const TTime& aDate, TBool newEntry );
-
- /**
- * Gets the editor's value.
- * @return TTime struct including the date.
- */
- TTime Date();
-
- /**
- * Sets the editor's leap mode dynamically.
- * @param aLeap indicates if leap mode should be enabled (ETrue)
- * or disabled (EFalse)
- */
- void SetLeap( const TBool aLeap );
-
- /**
- * Method for reading the leap mode status.
- *
- */
- /**
- * Gets the editor's leap mode.
- * @return TBool indicating leap mode state.
- */
- TBool Leap() const;
-
-
-
- public: // from CCoeControl
-
- /**
- * From @c CCoeControl. Constructs controls from a resource file.
- * Essential for Dialog/Form construction.
- * @param aResourceReader The resource reader with which to access
- * @c LUNAR_DATE_EDITOR
- * resource.
- */
- void ConstructFromResourceL(TResourceReader& aResourceReader);
- /**
- * Prepares For FocusLoss
- */
- void PrepareForFocusLossL();
-
- /**
- * Handles Control State Change
- */
- void HandleControlStateChangeL( TInt aControlId );
-
- private:
- /**
- * From CAknControl
- */
- void* ExtensionInterface( TUid aInterface );
-
- private:
- virtual void CEikMfne_Reserved();
-
- private:
- HBufC* iIndicatorField;
- CEikMfneNumber* iMonthField;
- CEikMfneNumber* iDayField;
- TDateTime iDate;
- TBool iLeap;
-
- MCalenServices* iServices;
-
- CKoreanCalConv* iConverter;
- CKoreanLunarDateUtil* iDateUtil;
- };
-
-#endif /* __KOREANLUNARDATEEDITOR_H_ */
\ No newline at end of file
--- a/calendarui/editors/inc/KoreanLunarDateEditor.rh Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,21 +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:
-*
-*/
-
-STRUCT KOREAN_LUNAR_DATE_EDITOR
- {
- BYTE flags;
- }
--- a/calendarui/editors/inc/KoreanLunarDateUtil.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,89 +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:
-*
-*/
-
-#if !defined(__KOREANLUNARDATEUTIL_H_)
-#define __KOREANLUNARDATEUTIL_H_
-
-class MCalenServices;
-
-// SYSTEM INCLUDES
-#include <e32base.h>
-#include <calencustomisationmanager.h>
-#include <KoreanCalConv.h>
-#include <caltime.h>
-#include <CalendarConverter.h>
-typedef class TChineseDate TKoreanDate;
-
-
-NONSHARABLE_CLASS( CKoreanLunarDateUtil ) : public CBase
- {
- public: // public constructors
- /**
- * Two phased constructors.
- */
- static CKoreanLunarDateUtil* NewL(MCalenServices* aServices);
- static CKoreanLunarDateUtil* NewLC(MCalenServices* aServices);
-
- /**
- * Destructor.
- */
- virtual ~CKoreanLunarDateUtil();
-
- public:
-
- /**
- * Gets nearest possible gregorian date from lunar day and month and gregorian reference.
- * @param aMonth lunar month
- * @param aDay lunar day
- * @param aLeap ETrue if leap month, EFalse otherwise
- * @param aReference reference gregorian date
- * @leave KErrArgument Given date is unconvertible.
- * @return TTime struct including the date.
- */
- TDateTime GetNearestGregorianDateL( const TInt aMonth,
- const TInt aDay,
- const TBool aLeap,
- const TDateTime& aReference ) const;
-
- /**
- * Gets lunar yearly repeats in gregorian dates.
- * @param aRDates repeat date array
- * @param aEntryDate gregorian entry date
- * @param aMaxRepeats max repeat dates to get
- * @param aFloating ETrue if repeat dates should be in floating format, EFalse otherwise
- */
- void GetLunarYearlyRepeatsL( RArray<TCalTime>& aRDates,
- const TDateTime& aEntryDate,
- const TBool aFloating ) const;
-
- private:
- /**
- * C++ default constructor.
- */
- CKoreanLunarDateUtil(MCalenServices* aServices);
- /**
- * Two phased constructor.
- */
- void ConstructL();
-
- private:
- CKoreanCalConv* iConverter;
- MCalenServices* iServices;
- };
-
-
-#endif /* __KOREANLUNARDATEUTIL_H_ */
\ No newline at end of file
--- a/calendarui/editors/inc/KoreanLunarTypeField.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +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:
-*
-*/
-
-#ifndef KOREANLUNARTYPEFIELD_H
-#define KOREANLUNARTYPEFIELD_H
-
-// INCLUDES
-#include <e32base.h>
-#include <badesca.h>
-
-#include "calenunifiededitor.h"
-
-#include "calenentryutil.h"
-// FORWARD DECLARATIONS
-class CCalEntry;
-class CAknQueryValueTextArray;
-class CAknQueryValueText;
-
-
-// CLASS DECLARATION
-/**
- * Implements calendar type field for Calendar Editors.
- */
-NONSHARABLE_CLASS( CKoreanLunarTypeField ) : public CBase
- {
-public:
- /**
- * @brief NewL.
- * @param CCalenUnifiedEditor
- */
- static CKoreanLunarTypeField* NewL(CCalenUnifiedEditor& aForm);
-
- /**
- * @brief destructor.
- */
- virtual ~CKoreanLunarTypeField();
-
-public:
- /**
- * @brief Pre Layout.
- */
- void PreLayoutDynInitL();
- /**
- * @brief sets data to form
- */
- void SetDataToFormL();
- /**
- * @brief reads data to form
- * @param aContinueOnError
- */
- void ReadDataFromFormL( TBool aContinueOnError );
- /**
- * @brief prepares for focus transition
- * @param aFocusedId
- */
- void PrepareForFocusTransitionL( TInt aFocusedId );
- /**
- * @brief lunar calendar type
- */
- TLunarCalendarType Type();
- /**
- * @brief handles control state change
- * @param aControlId
- */
- void HandleControlStateChangeL( TInt aControlId );
-
-private:
- CKoreanLunarTypeField(CCalenUnifiedEditor& aForm);
-
- void ConstructL();
-private:
- // Reference to form
- CCalenUnifiedEditor& iUniEditor;
-
- // Synchronization popup query values
- CDesCArrayFlat* iTypeArrayText;
- CAknQueryValueTextArray* iTypeArray;
- CAknQueryValueText* iTypeTextValues;
- };
-
-#endif // KOREANLUNARTYPEFIELD_H
-
-
-// End of File
--- a/calendarui/editors/inc/calenunifiededitor.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/inc/calenunifiededitor.h Wed Oct 13 14:30:35 2010 +0300
@@ -267,7 +267,6 @@
*/
void ActivateL();
- void HandleCalendarDeleteL();
private:
/**
@@ -531,7 +530,7 @@
* updates the dbid into cenrep for the later use,
* next time editor will show this db in the editor (bu default)
*/
- void ModifyDbFieldL();
+ void ModifyDbField();
/**
* @brief Try to save the enty with new entry type
@@ -662,7 +661,7 @@
* exceptional entry/single instance of recurrent entry
*
*/
- void HideFieldsForEditSingleInstanceL();
+ void HideFieldsForEditSingleInstance();
static TInt AsyncProcessCommandL(TAny* aThisPtr);
@@ -823,11 +822,6 @@
CAsyncCallBack* iAsyncCallback;
- /**
- * True if FeatureManager is initialized.
- */
- TBool iFeatMgrInitialized;
-
};
/**
--- a/calendarui/editors/inc/calenunifiededitorcontrol.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/inc/calenunifiededitorcontrol.h Wed Oct 13 14:30:35 2010 +0300
@@ -24,7 +24,6 @@
// user includes
#include "CalenEditorDataHandler.h"
-#include "CalenEntryUtil.h"
// forward declaration
class CCalenUnifiedEditor;
@@ -36,8 +35,6 @@
class CCalenDbField;
class CCalenDescription;
class MCalenServices;
-class CKoreanLunarDateEditor;
-class CKoreanLunarTypeField;
/**
* CCalenUnifiedEditorControl class declaration
@@ -150,7 +147,7 @@
* @brief To set AllDay field value
* @param aActive
*/
- void SetAllDayEventL( TBool aActive );
+ void SetAllDayEvent( TBool aActive );
/**
* @brief Handles a state change in the control with id aControlId.
@@ -172,12 +169,6 @@
* @param aNewEventType Holds the new event type selected in editor
*/
void OnEventTypeChangedL( CCalEntry::TType aNewEventType );
-
- /**
- * @brief Handles lunar event type changed
- * @param aNewEventType Holds the new event type selected in editor
- */
- void OnLunarTypeChangedL( TLunarCalendarType aNewEventType );
/**
* @brief Reads editor data mainly for collapsed editor
@@ -234,7 +225,7 @@
/**
* Reads the RRule and Rdates for the current CCalEntry.
*/
- void ReadRruleL(TTime& startTime, TTime& endTime);
+ void ReadRrule(TTime& startTime, TTime& endTime);
/**
* @brief Get start date time from editor
@@ -347,17 +338,7 @@
* in updating the EndTime of editor on StartTime change.
*/
void UpdateMeetingDurationL();
-
- /**
- * @brief Setups Lunar Fields
- */
- void SetupLunarFields();
-
- /**
- * @brief Updates Lunar Date Fields
- */
- void UpdateLunarDateFields();
-
+
private:
/**
@@ -414,29 +395,6 @@
*/
TTimeIntervalMinutes iMeetingInterval;
- /**
- * @var iKoreanLunarDateEditor
- * @brief Korean lunar data editor
- */
- CKoreanLunarDateEditor* iKoreanLunarDateEditor;
-
- /**
- * @var iKoreanLunarTypeField
- * @brief Korean lunar type field
- */
- CKoreanLunarTypeField* iKoreanLunarTypeField;
-
- /**
- * @var iPrevLunarType
- * @brief previous lunar type
- */
- TLunarCalendarType iPrevLunarType;
-
- /**
- * True if FeatureManager is initialized.
- */
- TBool iFeatMgrInitialized;
-
};
#endif // _CALENUNIFIEDEDITORCONTROL_H
\ No newline at end of file
--- a/calendarui/editors/src/CalenDefaultEditors.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/src/CalenDefaultEditors.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -21,7 +21,6 @@
#include "calennotedatautil.h"
#include "calenentryutil.h"
#include "calenunifiededitor.h"
-#include "calenentryutil.h"
// system includes
#include <CalenDefaultEditorsData.rsg>
@@ -42,8 +41,6 @@
#include <calencontext.h>
#include <caleninstanceid.h>
#include "CleanupResetAndDestroy.h"
-#include <bldvariant.hrh> // for feature definitions
-#include <featmgr.h>
// debug
#include "calendarui_debug.h"
@@ -98,14 +95,6 @@
TRACE_ENTRY_POINT;
iResourceLoader.Close();
- // Do not call UnInitializeLib() if InitalizeLib() leaves.
- if ( iFeatMgrInitialized )
- {
- // Frees the TLS. Must be done after FeatureManager is used.
- FeatureManager::UnInitializeLib();
- }
-
-
TRACE_EXIT_POINT;
}
@@ -138,13 +127,6 @@
BaflUtils::NearestLanguageFile( CCoeEnv::Static()->FsSession(), resource );
TInt err = iResourceLoader.Open( resource );
__ASSERT_ALWAYS( err == KErrNone, Panic( EPanicCalenDefaultEditorsResourceLoading ) );
-
- // Sets up TLS, must be done before FeatureManager is used.
- FeatureManager::InitializeLibL();
- // Used in destructor.
- iFeatMgrInitialized = ETrue;
-
-
TRACE_EXIT_POINT;
}
@@ -300,19 +282,8 @@
// For repeat type, EThisAndAll start Date/Time is first instance Date/Time.
TAgnEntryUiInParams inParamsCopy( aInParams );
if( aRepeatType == CalCommon::EThisAndAll )
- {
- // remove for lunar entries
- if ( FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- if ( !(aEntry.EntryTypeL() == CCalEntry::EAnniv && aEntry.UserInt32L() != ESolar) )
- {
- inParamsCopy.iInstanceDate.SetTimeLocalL( aEntry.StartTimeL().TimeLocalL() );
- }
- }
- else // normal case
- {
- inParamsCopy.iInstanceDate.SetTimeLocalL( aEntry.StartTimeL().TimeLocalL() );
- }
+ {
+ inParamsCopy.iInstanceDate.SetTimeLocalL( aEntry.StartTimeL().TimeLocalL() );
}
switch ( aEntry.EntryTypeL() )
--- a/calendarui/editors/src/CalenEditorDataHandler.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/src/CalenEditorDataHandler.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -30,7 +30,6 @@
#include <calencontext.h>
#include <caleninstanceid.h> // TCalenInstanceId
#include <calenservices.h>
-#include <featmgr.h>
// User includes
#include "CalenEditorDataHandler.h"
@@ -43,7 +42,6 @@
#include "calenattachmentmodel.h"
#include "calenunifiededitor.h"
#include "calendarui_debug.h"
-#include "koreanlunardateutil.h"
// Constants
#define KNoOfDaysInWeek 7
@@ -148,11 +146,7 @@
iInstanceId = iServices.Context().InstanceId();
}
- // Sets up TLS, must be done before FeatureManager is used.
- FeatureManager::InitializeLibL();
- // Used in destructor.
- iFeatMgrInitialized = ETrue;
-
+
TRACE_EXIT_POINT;
}
@@ -194,15 +188,7 @@
delete iOriginal;
delete iEdited;
-
-
- // Do not call UnInitializeLib() if InitalizeLib() leaves.
- if ( iFeatMgrInitialized )
- {
- // Frees the TLS. Must be done after FeatureManager is used.
- FeatureManager::UnInitializeLib();
- }
-
+
TRACE_EXIT_POINT;
}
@@ -345,8 +331,7 @@
IsCalendarEditedL() ||
IsAttachmentExists() ||
IsEventTypeEdited() ||
- AllDayFieldEdited() ||
- LunarFieldEdited() );
+ AllDayFieldEdited() );
}
// ---------------------------------------------------------------------------
@@ -428,218 +413,196 @@
// Repeat rule has to be modified in both cases
if ( isNew || IsStartDateTimeEdited() || IsRepeatRuleEdited() )
{
- if ( FeatureManager::FeatureSupported( KFeatureIdKorean ) &&
- Edited().EntryType() == CCalEntry::EAnniv &&
- ( Edited().CalendarType() == ELunar || Edited().CalendarType() == ELunarLeap) )
- { /* Lunar entries need special repeating dates */
- CKoreanLunarDateUtil* dateUtil = CKoreanLunarDateUtil::NewLC(&iServices);
- RArray<TCalTime> repeatDateList;
- CleanupClosePushL( repeatDateList );
-
- /* Clear previous repeat rules */
+
+ if ( aRepeatTarget == CalCommon::EThisOnly)
+ {
iEntry.ClearRepeatingPropertiesL();
- TRAPD( err, dateUtil->GetLunarYearlyRepeatsL( repeatDateList, Edited().StartDateTime().DateTime(), UseFloatingTimeL() ) );
-
- if( err == KErrNone )
- {
- iEntry.SetRDatesL( repeatDateList );
- }
-
- /* Pop and destroy repeatDateList and dateUtil */
- CleanupStack::PopAndDestroy(2);
}
- else
+ else if ( Edited().IsRepeating() )
{
- if ( aRepeatTarget == CalCommon::EThisOnly)
+ // If we're an RDate (with repeat type ERepeatOther), don't try to set an RRule,
+ // but don't clear the repeat properties either.
+ if( Edited().RepeatType() != ERepeatOther )
{
- iEntry.ClearRepeatingPropertiesL();
+ TCalRRule rrule;
+
+ CalculateRepeatRuleL( Edited().StartDateTime(),
+ Edited().RepeatType(),
+ Edited().RepeatUntilDateTime(),
+ rrule );
+
+ iEntry.SetRRuleL( rrule );
+
+ // As there should not be any rdates, remove any that are
+ // still present
+ RArray<TCalTime> emptyList;
+ CleanupClosePushL( emptyList );
+ iEntry.SetRDatesL( emptyList );
+ CleanupStack::PopAndDestroy(); // emptyList
}
- else if ( Edited().IsRepeating() )
+ else
{
- // If we're an RDate (with repeat type ERepeatOther), don't try to set an RRule,
- // but don't clear the repeat properties either.
- if( Edited().RepeatType() != ERepeatOther )
+ // The repeat type is ERepeatOther, therefore as
+ // it is impossible to create an entry of type
+ // ERepeat other using the editor either the repeat until
+ // date or the start date must have been changed
+
+ // The start date/time has changed, in order for the
+ // series to maintain its pattern, any rDates and if
+ // present rRule are moved by the same offset
+ // The repeat type is ERepeatOther, so check if we have any rdates
+ RArray<TCalTime> rDateList;
+ CleanupClosePushL( rDateList );
+ iEntry.GetRDatesL( rDateList );
+ TInt count = rDateList.Count();
+
+ if ( count == 0 )
{
+ // There are no rdates so the new until and start date can be applied
+ // directly.
TCalRRule rrule;
-
+
CalculateRepeatRuleL( Edited().StartDateTime(),
- Edited().RepeatType(),
- Edited().RepeatUntilDateTime(),
- rrule );
-
+ Edited().RepeatType(),
+ Edited().RepeatUntilDateTime(),
+ rrule );
+
iEntry.SetRRuleL( rrule );
-
- // As there should not be any rdates, remove any that are
- // still present
- RArray<TCalTime> emptyList;
- CleanupClosePushL( emptyList );
- iEntry.SetRDatesL( emptyList );
- CleanupStack::PopAndDestroy(); // emptyList
}
else
{
- // The repeat type is ERepeatOther, therefore as
- // it is impossible to create an entry of type
- // ERepeat other using the editor either the repeat until
- // date or the start date must have been changed
-
- // The start date/time has changed, in order for the
- // series to maintain its pattern, any rDates and if
- // present rRule are moved by the same offset
- // The repeat type is ERepeatOther, so check if we have any rdates
- RArray<TCalTime> rDateList;
- CleanupClosePushL( rDateList );
- iEntry.GetRDatesL( rDateList );
- TInt count = rDateList.Count();
-
- if ( count == 0 )
+ // There are rDates which need to be checked.
+ if ( IsStartDateTimeEdited() )
{
- // There are no rdates so the new until and start date can be applied
- // directly.
- TCalRRule rrule;
-
- CalculateRepeatRuleL( Edited().StartDateTime(),
- Edited().RepeatType(),
- Edited().RepeatUntilDateTime(),
- rrule );
-
- iEntry.SetRRuleL( rrule );
+ // Need to shift any rdates
+ TTime editedStart = iEdited->StartDateTime();
+ TTime origStart = iOriginal->StartDateTime();
+ TTimeIntervalMicroSeconds offSet = editedStart.MicroSecondsFrom( origStart );
+ for ( TInt index = 0; index < count; index++ )
+ {
+ TCalTime& rDateTime = rDateList[ index ];
+ TTime shiftedTime = rDateTime.TimeUtcL();
+ TDateTime before = shiftedTime.DateTime();
+ shiftedTime += offSet;
+ TDateTime after = shiftedTime.DateTime();
+ rDateTime.SetTimeUtcL( shiftedTime );
+ }
}
- else
+
+ // Check and fix the rDates and rRules match the
+ // repeat until date and time.
+ TTime untilTime = Edited().RepeatUntilDateTime();
+
+ // Remove any rdates that are after the the repeat until date
+ TInt count = rDateList.Count();
+ if ( count > 0 )
{
- // There are rDates which need to be checked.
- if ( IsStartDateTimeEdited() )
+ TInt index = count - 1;
+ do
{
- // Need to shift any rdates
- TTime editedStart = iEdited->StartDateTime();
- TTime origStart = iOriginal->StartDateTime();
- TTimeIntervalMicroSeconds offSet = editedStart.MicroSecondsFrom( origStart );
- for ( TInt index = 0; index < count; index++ )
+ TTime lastRDate = CalenDateUtils::BeginningOfDay( rDateList[ index ].TimeLocalL() );
+ TDateTime before = lastRDate.DateTime();
+ if ( lastRDate > untilTime )
{
- TCalTime& rDateTime = rDateList[ index ];
- TTime shiftedTime = rDateTime.TimeUtcL();
- TDateTime before = shiftedTime.DateTime();
- shiftedTime += offSet;
- TDateTime after = shiftedTime.DateTime();
- rDateTime.SetTimeUtcL( shiftedTime );
+ rDateList.Remove( index-- );
+ }
+ else
+ {
+ index = KErrNotFound;
}
- }
-
- // Check and fix the rDates and rRules match the
- // repeat until date and time.
- TTime untilTime = Edited().RepeatUntilDateTime();
-
- // Remove any rdates that are after the the repeat until date
- TInt count = rDateList.Count();
+ } while ( index != KErrNotFound );
+ }
+
+ // Need to check if the end date of the
+ // rrule needs adjusting if it exists.
+ TCalRRule rRule;
+ if ( iEntry.GetRRuleL( rRule ) )
+ {
+ count = rDateList.Count();
if ( count > 0 )
{
- TInt index = count - 1;
- do
- {
- TTime lastRDate = CalenDateUtils::BeginningOfDay( rDateList[ index ].TimeLocalL() );
- TDateTime before = lastRDate.DateTime();
- if ( lastRDate > untilTime )
+ // There still exists some rdates, so only need to trim
+ // the rrule if it exists
+ TTime lastRDate = CalenDateUtils::BeginningOfDay( rDateList[ count - 1 ].TimeLocalL() );
+ const TTime& origUntilDate = Original().RepeatUntilDateTime();
+ TTime startDT = rRule.DtStart().TimeLocalL();
+
+ if ( lastRDate <= origUntilDate && startDT > lastRDate )
+ {
+ if ( startDT < untilTime)
{
- rDateList.Remove( index-- );
- }
- else
- {
- index = KErrNotFound;
+ if( origUntilDate != untilTime)
+ {
+ ApplyUntilDateToRRuleL( rRule, untilTime);
+ iEntry.SetRRuleL( rRule );
+ }
}
- } while ( index != KErrNotFound );
- }
-
- // Need to check if the end date of the
- // rrule needs adjusting if it exists.
- TCalRRule rRule;
- if ( iEntry.GetRRuleL( rRule ) )
- {
- count = rDateList.Count();
- if ( count > 0 )
- {
- // There still exists some rdates, so only need to trim
- // the rrule if it exists
- TTime lastRDate = CalenDateUtils::BeginningOfDay( rDateList[ count - 1 ].TimeLocalL() );
- const TTime& origUntilDate = Original().RepeatUntilDateTime();
- TTime startDT = rRule.DtStart().TimeLocalL();
-
- if ( lastRDate <= origUntilDate && startDT > lastRDate )
- {
- if ( startDT < untilTime)
- {
- if( origUntilDate != untilTime)
- {
- ApplyUntilDateToRRuleL( rRule, untilTime);
- iEntry.SetRRuleL( rRule );
- }
- }
- else
+ else
+ {
+ // The repeat start is after the until date
+ // so remove any repeat information.
+ iEntry.ClearRepeatingPropertiesL();
+
+ // If the entry date has been moved past the until
+ // date, need to swap the an rDate for the entry.
+ TTime startTime = iEntry.StartTimeL().TimeLocalL();
+
+ if ( startTime > untilTime )
{
- // The repeat start is after the until date
- // so remove any repeat information.
- iEntry.ClearRepeatingPropertiesL();
+ // Find the duration of the entry
+ TTime endTime = iEntry.EndTimeL().TimeLocalL();
+ TTimeIntervalMinutes duration;
+ //startTime.MinutesFrom( endTime, duration );// for bug: CMCA-745CZ4
+ endTime.MinutesFrom( startTime, duration );
- // If the entry date has been moved past the until
- // date, need to swap the an rDate for the entry.
- TTime startTime = iEntry.StartTimeL().TimeLocalL();
-
- if ( startTime > untilTime )
+ // Choose the first rDate as the new start time
+ TCalTime newStartTime = rDateList[ 0 ];
+ endTime = newStartTime.TimeLocalL() + duration;
+
+ // FIXME.
+ // If there is only one rDate left, the agenda model
+ // will crash if it is deleted.
+ if ( count != 0 )
{
- // Find the duration of the entry
- TTime endTime = iEntry.EndTimeL().TimeLocalL();
- TTimeIntervalMinutes duration;
- //startTime.MinutesFrom( endTime, duration );// for bug: CMCA-745CZ4
- endTime.MinutesFrom( startTime, duration );
-
- // Choose the first rDate as the new start time
- TCalTime newStartTime = rDateList[ 0 ];
- endTime = newStartTime.TimeLocalL() + duration;
-
- // FIXME.
- // If there is only one rDate left, the agenda model
- // will crash if it is deleted.
- if ( count != 0 )
- {
- rDateList.Remove( 0 );
- }
-
- TCalTime newEndTime;
- if ( UseFloatingTimeL() )
- {
- newEndTime.SetTimeLocalFloatingL( endTime );
- }
- else
- {
- newEndTime.SetTimeLocalL( endTime );
- }
-
- iEntry.SetStartAndEndTimeL( newStartTime, newEndTime );
- }
- }
+ rDateList.Remove( 0 );
+ }
+
+ TCalTime newEndTime;
+ if ( UseFloatingTimeL() )
+ {
+ newEndTime.SetTimeLocalFloatingL( endTime );
+ }
+ else
+ {
+ newEndTime.SetTimeLocalL( endTime );
+ }
+
+ iEntry.SetStartAndEndTimeL( newStartTime, newEndTime );
+ }
}
}
}
-
- iEntry.SetRDatesL( rDateList );
}
-
- CleanupStack::PopAndDestroy(); // rDateList
+
+ iEntry.SetRDatesL( rDateList );
}
+
+ CleanupStack::PopAndDestroy(); // rDateList
}
- else
- {
- iEntry.ClearRepeatingPropertiesL();
-
- // FIXME As the entry is supposedly not repeating
- // any rDates should be removed. Unforunately this
- // is not possible at the moment because removing the
- // rdates will cause the agenda model to panic
- //
- // RArray<TCalTime> emptyList;
- // CleanupClosePushL( emptyList );
- // iEntry.SetRDatesL( emptyList );
- // CleanupStack::PopAndDestroy(); // emptyList
- }
+ }
+ else
+ {
+ iEntry.ClearRepeatingPropertiesL();
+
+ // FIXME As the entry is supposedly not repeating
+ // any rDates should be removed. Unforunately this
+ // is not possible at the moment because removing the
+ // rdates will cause the agenda model to panic
+ //
+ // RArray<TCalTime> emptyList;
+ // CleanupClosePushL( emptyList );
+ // iEntry.SetRDatesL( emptyList );
+ // CleanupStack::PopAndDestroy(); // emptyList
}
}
@@ -672,10 +635,7 @@
// If edit alarm of repeating entry, we have to nudge start
// time to instance date
-
- if ( isRepeating && aRepeatTarget == CalCommon::EThisAndAll
- || Edited().EntryType() == CCalEntry::EAnniv && Edited().CalendarType() != ESolar )
- // this is lunar anniv
+ if ( isRepeating && aRepeatTarget == CalCommon::EThisAndAll )
{
// nudge to instance date;
TTime instanceDate = iInstanceDateTime.TimeLocalL();
@@ -732,11 +692,6 @@
iEntry.SetPriorityL( priority );
}
- if (FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- iEntry.SetUserInt32L( (TUint32)Edited().CalendarType() );
- }
-
if ( isNew )
{
CCalEntry::TReplicationStatus status = CCalEntry::EOpen;
@@ -757,15 +712,14 @@
}
iEntry.SetReplicationStatusL( status );
}
-
+
/**
* S60 settings for new entries
*/
if ( IsCreatingNew() )
{
-
- if ( Edited().EntryType() == CCalEntry::EAnniv && Edited().CalendarType() == ESolar)
- { /* Lunar entries have different repeating */
+ if ( Edited().EntryType() == CCalEntry::EAnniv )
+ {
TCalRRule rrule( TCalRRule::EYearly );
rrule.SetDtStart( iEntry.StartTimeL() );
rrule.SetInterval( 1 );
@@ -1491,17 +1445,6 @@
TRACE_ENTRY_POINT;
TError error = EFormErrNone;
-
- if (FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- if( Edited().CalendarType() == ELunar ||
- Edited().CalendarType() == ELunarLeap )
- { /* Lunar entries have alarm as offset
- and can't thus be erroneous */
- return error;
- }
- }
-
// If alarm not active, no check
if ( Edited().IsAlarmActivated() )
{
@@ -2215,24 +2158,6 @@
return fieldModified;
}
-TBool CCalenEditorDataHandler::LunarFieldEdited()
- {
- TRACE_ENTRY_POINT;
- TBool fieldModified = EFalse;
-
- if (FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- if( iOriginal->CalendarType() != iEdited->CalendarType() )
- {
- fieldModified = ETrue;
- }
- }
-
- TRACE_EXIT_POINT;
- return fieldModified;
- }
-
-
// -----------------------------------------------------------------------------
// CCalenEditorDataHandler::SetDefaultAlarmDateTimeL
// Sets the alarm to the default value. This function is called after the user
--- a/calendarui/editors/src/KoreanLunarDateEditor.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,261 +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:
-*
-*/
-
-#include <barsread.h>
-#include <aknextendedinputcapabilities.h>
-#include "KoreanLunarDateEditor.h"
-#include "KoreanLunarDateUtil.h"
-
-// debug
-#include "calendarui_debug.h"
-
-_LIT( KDelimiter, "/" );
-_LIT( KLunarIndicator, "\xC74C\xB825" );
-_LIT( KLeapIndicator, "\xC724\xB2EC" );
-
-const TInt KNumFields = 4; /* [Indicators][month]/[day] */
-const TInt KMinLeapMonth = 2;
-const TInt KMinMonth = 1;
-const TInt KMaxLeapMonth = 11;
-const TInt KMaxMonth = 12;
-const TInt KMinDay = 1;
-const TInt KMaxDay = 31;
-
-
-/**
- * Public method for constructing a CKoreanLunarDateEditor object.
- */
-CKoreanLunarDateEditor* CKoreanLunarDateEditor::NewL(MCalenServices* aServices)
- {
- TRACE_ENTRY_POINT;
- CKoreanLunarDateEditor* editor=new(ELeave)CKoreanLunarDateEditor(aServices);
- CleanupStack::PushL(editor);
- editor->ConstructL(0); // flags are not used
- CleanupStack::Pop(editor);
-
- TRACE_EXIT_POINT;
- return editor;
- }
-
-
-CKoreanLunarDateEditor::CKoreanLunarDateEditor(MCalenServices* aServices):iServices(aServices)
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-
-void CKoreanLunarDateEditor::ConstructL( const TInt /* aFlags */ )
- {
- TRACE_ENTRY_POINT;
- HBufC* charField;
- iConverter = CKoreanCalConv::NewL();
- iDateUtil = CKoreanLunarDateUtil::NewL(iServices);
- iLeap = EFalse;
-// todo add editable field to first place to go around avkon crash if avkon can not be fixed
- CreateFieldArrayL( KNumFields );
-
- iIndicatorField = HBufC::NewL(2);
- iIndicatorField->Des().Append( KLunarIndicator );
- AddField( CEikMfneSeparator::NewL( iIndicatorField ) );
-
-
- iMonthField = CEikMfneNumber::NewL( *Font(),
- KMinMonth,
- KMaxMonth,
- KMinMonth,
- (CEikMfneNumber::EFillWithLeadingZeros|CEikMfneNumber::EPreserveOldWidthBeforeEditing) );
- AddField( iMonthField );
- iMonthField->SetValue( KMinMonth, *Font() );
- charField = HBufC::NewLC(1);
- charField->Des().Append( KDelimiter );
- AddField( CEikMfneSeparator::NewL( charField ) );
- CleanupStack::Pop(); // charField
-
- iDayField = CEikMfneNumber::NewL( *Font(),
- KMinDay,
- KMaxDay,
- KMinDay,
- (CEikMfneNumber::EFillWithLeadingZeros|CEikMfneNumber::EPreserveOldWidthBeforeEditing) );
- AddField( iDayField );
- iDayField->SetValue( KMinDay, *Font() );
- MObjectProvider* mop = InputCapabilities().ObjectProvider();
- if( mop )
- {
- CAknExtendedInputCapabilities* extendedInputCapabilities = mop->MopGetObject( extendedInputCapabilities );
- if( extendedInputCapabilities )
- {
- extendedInputCapabilities->SetCapabilities( CAknExtendedInputCapabilities::ESupportsOnlyASCIIDigits );
- }
- }
- TRACE_EXIT_POINT;
- }
-
-/**
- * Method for Setting the date.
- *
- */
-void CKoreanLunarDateEditor::SetDate( const TTime& aDate, TBool newEntry )
- {
- TRACE_ENTRY_POINT;
- iDate = aDate.DateTime();
- TKoreanDate lunarDate;
- TInt err = KErrNone;
-
- if( !newEntry )
- {
- TRAP( err, iConverter->DateTimeToKoreanL( iDate, lunarDate ) );
- }
-
- if( newEntry || err != KErrNone )
- { /* Use always initial values in case of new entry or
- failed conversion */
- if( iLeap )
- {
- iMonthField->SetValue( KMinLeapMonth, *Font() );
- iDayField->SetValue( KMinDay, *Font() );
- }
- else
- {
- iMonthField->SetValue( KMinMonth, *Font() );
- iDayField->SetValue( KMinDay, *Font() );
- }
- }
- else
- {
- iMonthField->SetValue( lunarDate.iMonth, *Font() );
- iDayField->SetValue( lunarDate.iDay, *Font() );
- }
- //DrawNow();
- TBool error = EFalse;
- TBool dataAltered = ETrue;
- // needs to call this to make redraw work correctly
- HandleInteraction(EFalse, 2, 0, CEikMfneField::ECursor, dataAltered, error);
- TRACE_EXIT_POINT;
- }
-
-/**
- * Method for reading the editor value.
- *
- */
-TTime CKoreanLunarDateEditor::Date()
- {
- TRACE_ENTRY_POINT;
- TRAP_IGNORE( iDate = iDateUtil->GetNearestGregorianDateL( iMonthField->Value(), iDayField->Value(), iLeap, iDate ) );
-
- TRACE_EXIT_POINT;
- return TTime(iDate);
- }
-
-/**
- * Method for setting the editor to leap mode.
- * Gets one parameter:
- * const TBool aLeap - ETrue if leap mode is to be enabled, EFalse if disabled.
- *
- */
-void CKoreanLunarDateEditor::SetLeap( const TBool aLeap )
- {
- TRACE_ENTRY_POINT;
- if( aLeap != iLeap )
- {
- iLeap = aLeap;
- if( iLeap )
- {
- iIndicatorField->Des().Replace( 0, 2, KLeapIndicator );
- iMonthField->SetValue( KMinLeapMonth, *Font() );
- iDayField->SetValue( KMinDay, *Font() );
- iMonthField->SetMinimumAndMaximum( KMinLeapMonth,
- KMaxLeapMonth,
- *Font() );
- }
- else
- {
- iIndicatorField->Des().Replace( 0, 2, KLunarIndicator );
- iMonthField->SetValue( KMinMonth, *Font() );
- iDayField->SetValue( KMinDay, *Font() );
- iMonthField->SetMinimumAndMaximum( KMinMonth,
- KMaxMonth,
- *Font() );
- }
- DrawNow();
- }
- TRACE_EXIT_POINT;
- }
-
-/**
- * Method for reading the leap mode status.
- *
- */
-TBool CKoreanLunarDateEditor::Leap() const
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
-
- return iLeap;
- }
-
-/**
- * Method for constructing the control from resources.
- * Gets one parameter:
- * TResourceReader& aResourceReader - Reference to a resource reader associated to a
- * Korean lunar date editor control resource.
- *
- */
-void CKoreanLunarDateEditor::ConstructFromResourceL(TResourceReader& aResourceReader)
- {
- TRACE_ENTRY_POINT;
- TUint32 flags = aResourceReader.ReadUint8();
- ConstructL( flags );
- TRACE_EXIT_POINT;
- }
-
-
-void CKoreanLunarDateEditor::PrepareForFocusLossL()
- {
- TRACE_ENTRY_POINT;
- CEikMfne::PrepareForFocusLossL();
- CKoreanLunarDateUtil* dateUtil = CKoreanLunarDateUtil::NewLC(iServices);
- TTime nowTime;
- nowTime.HomeTime();
-
- TRAP_IGNORE( iDate = dateUtil->GetNearestGregorianDateL( iMonthField->Value(), iDayField->Value(), iLeap, nowTime.DateTime() ) );
- /* Pop and destroy dateUtil */
- CleanupStack::PopAndDestroy();
- TRACE_EXIT_POINT;
- }
-
-void CKoreanLunarDateEditor::HandleControlStateChangeL( TInt aControlId )
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-void* CKoreanLunarDateEditor::ExtensionInterface( TUid /*aInterface*/ )
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
-
- return NULL;
- }
-
-void CKoreanLunarDateEditor::CEikMfne_Reserved()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// End of file
--- a/calendarui/editors/src/KoreanLunarDateUtil.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,228 +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:
-*
-*/
-
-
-#include "KoreanLunarDateUtil.h"
-// debug
-#include "calendarui_debug.h"
-
-const TInt KMaxLunarYear = 60;
-
-/**
- * Public methods for constructing a CKoreanLunarDateUtil object.
- */
-CKoreanLunarDateUtil* CKoreanLunarDateUtil::NewL(MCalenServices* aServices)
- {
- TRACE_ENTRY_POINT;
- CKoreanLunarDateUtil* self = CKoreanLunarDateUtil::NewLC(aServices);
- CleanupStack::Pop( self );
-
- TRACE_EXIT_POINT;
- return self;
- }
-
-CKoreanLunarDateUtil* CKoreanLunarDateUtil::NewLC(MCalenServices* aServices)
- {
- TRACE_ENTRY_POINT;
- CKoreanLunarDateUtil* self = new (ELeave) CKoreanLunarDateUtil(aServices);
- CleanupStack::PushL( self );
- self->ConstructL();
- return self;
- }
-
-
-CKoreanLunarDateUtil::CKoreanLunarDateUtil(MCalenServices* aServices):iServices(aServices)
- {
- TRACE_ENTRY_POINT;
- }
-
-
-void CKoreanLunarDateUtil::ConstructL()
- {
- TRACE_ENTRY_POINT;
- iConverter = CKoreanCalConv::NewL();
- }
-
-CKoreanLunarDateUtil::~CKoreanLunarDateUtil()
- {
- TRACE_ENTRY_POINT;
- delete iConverter;
- }
-
-/**
- * Method for getting nearest gregorian date from
- * lunar day and month and gregorian reference.
- */
-TDateTime CKoreanLunarDateUtil::GetNearestGregorianDateL( const TInt aMonth,
- const TInt aDay,
- const TBool aLeap,
- const TDateTime& aReference ) const
- {
- TRACE_ENTRY_POINT;
- TKoreanDate refLunarDate;
- TKoreanDate lunarDate;
- TDateTime resDateTime;
- TInt err = KErrNone;
-
- iConverter->DateTimeToKoreanL( aReference, refLunarDate );
- /* Try to convert with the year and cycle we got with the reference */
- lunarDate.iCycle = refLunarDate.iCycle;
- lunarDate.iYear = refLunarDate.iYear;
- lunarDate.iMonth = aMonth;
- lunarDate.iDay = aDay;
- lunarDate.iLeapMonth = aLeap;
- TRAP( err, iConverter->KoreanToDateTimeL( lunarDate, resDateTime ) );
- if( err == KErrArgument )
- { /* Date is invalid for this year (day 30 on a month
- that has only 29 days on selected year or a leap month
- not in this year), try to find suitable */
- TKoreanDate lowerLimit;
- TKoreanDate upperLimit;
- iConverter->DateRange( lowerLimit, upperLimit );
- while( 1 )
- { /* Search by increasing year */
- if( lunarDate.iYear < KMaxLunarYear )
- {
- lunarDate.iYear++;
- }
- else
- {
- lunarDate.iYear = 1;
- lunarDate.iCycle++;
- }
- if( (lunarDate.iCycle == upperLimit.iCycle &&
- lunarDate.iYear > upperLimit.iYear) ||
- lunarDate.iCycle > upperLimit.iCycle )
- { /* Could not find, just break */
- break;
- }
- TRAP( err, iConverter->KoreanToDateTimeL( lunarDate, resDateTime ) );
- if( err == KErrNone )
- { /* Found suitable */
- break;
- }
- }
- if( err != KErrNone )
- { /* Suitable not found by increasing,
- reset values and search by decreasing year */
- lunarDate.iCycle = refLunarDate.iCycle;
- lunarDate.iYear = refLunarDate.iYear;
- lunarDate.iMonth = aMonth;
- lunarDate.iDay = aDay;
- while( 1 )
- { /* Search by decreasing year */
- if( lunarDate.iYear > 1 )
- {
- lunarDate.iYear--;
- }
- else
- {
- if( lunarDate.iCycle == 0 )
- { /* Run out of cycles, break with error */
- break;
- }
- lunarDate.iYear = KMaxLunarYear;
- lunarDate.iCycle--;
- }
- if( (lunarDate.iCycle == lowerLimit.iCycle &&
- lunarDate.iYear < lowerLimit.iYear) ||
- lunarDate.iCycle < lowerLimit.iCycle )
- { /* Could not find, just break */
- break;
- }
- TRAP( err, iConverter->KoreanToDateTimeL( lunarDate, resDateTime ) );
- if( err == KErrNone )
- { /* Found suitable */
- break;
- }
- }
- }
- }
- /* If still not found, leave with error */
- User::LeaveIfError( err );
-
- TRACE_ENTRY_POINT;
- /* Otherwise return the result */
- return resDateTime;
- }
-
-/**
-* Method for getting lunar yearly repeats in gregorian dates.
-*/
-void CKoreanLunarDateUtil::GetLunarYearlyRepeatsL( RArray<TCalTime>& aRDates,
- const TDateTime& aEntryDate,
- const TBool aFloating ) const
- {
- TInt err = KErrNone;
- TCalTime repeatDate;
- TDateTime resDateTime;
- TDateTime lowerLimit;
- TKoreanDate upperKoreanLimit;
- TKoreanDate lunarStartDate;
-
- /* Get the upper limit for dates in Korean lunar format */
- iConverter->DateRange( lunarStartDate, upperKoreanLimit );
-
- /* Get the entry date in Korean lunar format */
- iConverter->DateTimeToKoreanL( aEntryDate, lunarStartDate );
-
- /* Get the lower limit for dates in Gregorian format */
- iConverter->DateRange( lowerLimit, resDateTime );
-
- /* Get the first occurrence of the event after
- the lower limit in Korean lunar format */
- iConverter->DateTimeToKoreanL( GetNearestGregorianDateL( lunarStartDate.iMonth,
- lunarStartDate.iDay,
- lunarStartDate.iLeapMonth,
- lowerLimit ),
- lunarStartDate );
-
- while( 1 )
- {
- TRAP( err, iConverter->KoreanToDateTimeL( lunarStartDate, resDateTime ) );
- if( err == KErrNone )
- { /* Date exists in current year */
- if( aFloating )
- {
- repeatDate.SetTimeLocalFloatingL( resDateTime );
- }
- else
- {
- repeatDate.SetTimeLocalL( resDateTime );
- }
- aRDates.AppendL( repeatDate );
- }
- /* Increase to next lunar year */
- if( lunarStartDate.iYear < KMaxLunarYear )
- {
- lunarStartDate.iYear++;
- }
- else
- {
- lunarStartDate.iYear = 1;
- lunarStartDate.iCycle++;
- }
- if( (lunarStartDate.iCycle == upperKoreanLimit.iCycle &&
- lunarStartDate.iYear > upperKoreanLimit.iYear) ||
- lunarStartDate.iCycle > upperKoreanLimit.iCycle )
- { /* Reached the limit, break */
- break;
- }
- }
- }
-
-// End of file
--- a/calendarui/editors/src/KoreanLunarTypeField.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,151 +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:
-*
-*/
-
-//debug
-#include "calendarui_debug.h"
-
-#include "KoreanLunarTypeField.h"
-
-#include "CalenDefaultEditors.hrh"
-
-#include <CalenDefaultEditorsData.rsg>
-
-#include <AknPopupField.h>
-#include <AknQueryValueText.h>
-#include <badesca.h>
-#include <calentry.h>
-#include <eikcapc.h>
-
-
-// CONSTRUCTION AND DESTRUCTION METHODS
-CKoreanLunarTypeField* CKoreanLunarTypeField::NewL(CCalenUnifiedEditor& aForm)
- {
- TRACE_ENTRY_POINT;
-
- CKoreanLunarTypeField* self =
- new( ELeave ) CKoreanLunarTypeField(aForm);
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop();
-
- TRACE_EXIT_POINT;
- return self;
- }
-
-CKoreanLunarTypeField::CKoreanLunarTypeField(CCalenUnifiedEditor& aForm)
- : iUniEditor(aForm)
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-void CKoreanLunarTypeField::ConstructL()
- {
- TRACE_ENTRY_POINT;
-
- iTypeArrayText = iUniEditor.ControlEnv()->ReadDesCArrayResourceL( R_KOREAN_LUNAR_TYPE_POPUP_ITEMS );
-
- // create textarray
- iTypeArray = CAknQueryValueTextArray::NewL();
- iTypeArray->SetArray(*iTypeArrayText);
-
- iTypeTextValues = CAknQueryValueText::NewL();
- iTypeTextValues->SetArrayL(iTypeArray);
-
- TRACE_EXIT_POINT;
- }
-
-CKoreanLunarTypeField::~CKoreanLunarTypeField()
- {
- TRACE_ENTRY_POINT;
-
- delete iTypeArrayText;
- delete iTypeArray;
- delete iTypeTextValues;
-
- TRACE_EXIT_POINT;
- }
-
-void CKoreanLunarTypeField::PreLayoutDynInitL()
- {
- TRACE_ENTRY_POINT;
- SetDataToFormL();
- CAknPopupField* pops =
- static_cast<CAknPopupField*>( iUniEditor.Control(EKoreanLunarTypeSelectSolarLunarLeap) );
- pops->SetQueryValueL(iTypeTextValues);
-
- TRACE_EXIT_POINT;
- }
-
-void CKoreanLunarTypeField::SetDataToFormL()
- {
- TRACE_ENTRY_POINT;
- //TInt pos = (TInt)Type();
- TInt pos = iUniEditor.Edited().CalendarType();
- iTypeTextValues->SetCurrentValueIndex( pos );
-
- TRACE_EXIT_POINT;
- }
-
-void CKoreanLunarTypeField::ReadDataFromFormL( TBool /*aContinueOnError*/ )
- {
- TRACE_ENTRY_POINT;
-
- TInt pos = iTypeTextValues->CurrentValueIndex();
- iUniEditor.Edited().SetCalendarTypeL( static_cast<TLunarCalendarType>( pos ) );
-
- TRACE_EXIT_POINT;
- }
-
-void CKoreanLunarTypeField::PrepareForFocusTransitionL( TInt aFocusedId )
- {
- TRACE_ENTRY_POINT;
-
- switch( aFocusedId )
- {
- //case ECalenNoteType:
- case ECalenEditorEventType:
- {
- TBool continueOnError = EFalse;
- ReadDataFromFormL( continueOnError );
- break;
- }
- default:
- break;
- }
- TRACE_EXIT_POINT;
- }
-
-TLunarCalendarType CKoreanLunarTypeField::Type()
- {
- TRACE_ENTRY_POINT;
- TInt pos = iTypeTextValues->CurrentValueIndex();
-
- TRACE_EXIT_POINT;
- return static_cast<TLunarCalendarType>( pos );
- }
-
-
-void CKoreanLunarTypeField::HandleControlStateChangeL( TInt aControlId )
- {
- TRACE_ENTRY_POINT;
- iUniEditor.EditorFields().OnLunarTypeChangedL( Type() );
- TRACE_EXIT_POINT;
- }
-
-// End of File
-
--- a/calendarui/editors/src/calenalldayfield.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/src/calenalldayfield.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -169,8 +169,8 @@
}
}
- iUnifiedEditor.EditorFields().SetDateField( ECalenEditorStartDate, startDate, EFalse );
- iUnifiedEditor.EditorFields().SetDateField( ECalenEditorEndDate, endDate, EFalse );
+ iUnifiedEditor.EditorFields().SetDateField( ECalenEditorStartDate, startDate, ETrue );
+ iUnifiedEditor.EditorFields().SetDateField( ECalenEditorEndDate, endDate, ETrue );
}
else
{
@@ -180,16 +180,16 @@
TTime startDate = iUnifiedEditor.Edited().StartDateTime();
TTime endDate = iUnifiedEditor.Edited().EndDateTime();
- iUnifiedEditor.EditorFields().SetDateField( ECalenEditorStartDate, startDate, EFalse );
- iUnifiedEditor.EditorFields().SetTimeField( ECalenEditorStartTime, startDate, EFalse );
- iUnifiedEditor.EditorFields().SetDateField( ECalenEditorEndDate, endDate, EFalse );
- iUnifiedEditor.EditorFields().SetTimeField( ECalenEditorEndTime, endDate, EFalse );
+ iUnifiedEditor.EditorFields().SetDateField( ECalenEditorStartDate, startDate, ETrue );
+ iUnifiedEditor.EditorFields().SetTimeField( ECalenEditorStartTime, startDate, ETrue );
+ iUnifiedEditor.EditorFields().SetDateField( ECalenEditorEndDate, endDate, ETrue );
+ iUnifiedEditor.EditorFields().SetTimeField( ECalenEditorEndTime, endDate, ETrue );
}
else if( iUnifiedEditor.GetEntryType()== CCalEntry::EEvent )
{
TTime startTime = iUnifiedEditor.Edited().StartDateTime();
- iUnifiedEditor.EditorFields().SetDateField( ECalenEditorStartDate, startTime, EFalse );
- iUnifiedEditor.EditorFields().SetTimeField( ECalenEditorStartTime, startTime, EFalse );
+ iUnifiedEditor.EditorFields().SetDateField( ECalenEditorStartDate, startTime, ETrue );
+ iUnifiedEditor.EditorFields().SetTimeField( ECalenEditorStartTime, startTime, ETrue );
}
}
@@ -214,11 +214,11 @@
// AllDay event, delete Start time & End time fields from form.
if( eventStartTimeCtrl )
{
- iUnifiedEditor.DeleteLine( ECalenEditorStartTime,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorStartTime,ETrue );
}
if( eventEndTimeCtrl )
{
- iUnifiedEditor.DeleteLine( ECalenEditorEndTime,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorEndTime,ETrue );
}
}
else
--- a/calendarui/editors/src/calendbfield.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/src/calendbfield.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -264,13 +264,8 @@
iUnifiedEditor.EditorDataHandler().SetCalendarFieldEditedL(IsCalendarEdited()
,iPreviousColId,iCurrentColId);
-
- if(!iAsyncDBquery)
- {
TCallBack callback(DoAsyncShowChangeDBQueryL,this);
iAsyncDBquery = new(ELeave) CAsyncCallBack(callback,CActive::EPriorityStandard);
- }
-
iAsyncDBquery->CallBack();
break;
}
@@ -388,7 +383,6 @@
TRACE_EXIT_POINT
return *iCalendarFileName;
}
-
// -----------------------------------------------------------------------------
// CCalenDbField::GetCalendarNameForEntryL
// get calendar index for the entry
--- a/calendarui/editors/src/calenreminderfield.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/src/calenreminderfield.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -140,11 +140,11 @@
// Alarm Off, Delete alarm date & alarm time fields from Editor
if( alarmTimeCtrl )
{
- iUnifiedEditor.DeleteLine( ECalenEditorReminderTime,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorReminderTime,ETrue );
}
if( alarmDateCtrl )
{
- iUnifiedEditor.DeleteLine( ECalenEditorReminderDate,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorReminderDate,ETrue );
}
}
else
--- a/calendarui/editors/src/calenrepeatfield.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/src/calenrepeatfield.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -317,7 +317,7 @@
if( repUntilCtrl )
{
// Delete RepeatUntil line from From
- iUnifiedEditor.DeleteLine( ECalenEditorRepeatUntil, EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorRepeatUntil, ETrue );
}
}
else
--- a/calendarui/editors/src/calenunifiededitor.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/src/calenunifiededitor.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -31,9 +31,6 @@
#include "calenattachmentmodel.h"
#include "CleanupResetAndDestroy.h"
#include "CalendarPrivateCRKeys.h"
-#include "KoreanLunarDateEditor.h"
-#include <featmgr.h>
-#include "CalenUid.h"
// system includes
#include <coemain.h>
@@ -70,7 +67,6 @@
#include <caleninstanceid.h> // TCalenInstanceId
#include <calenservices.h>
#include <calcalendarinfo.h>
-#include <vwsdef.h>
// debug
#include "calendarui_debug.h"
@@ -176,14 +172,6 @@
iAsyncCallback->Cancel();
delete iAsyncCallback;
- // Do not call UnInitializeLib() if InitalizeLib() leaves.
- if ( iFeatMgrInitialized )
- {
- // Frees the TLS. Must be done after FeatureManager is used.
- FeatureManager::UnInitializeLib();
- }
-
-
TRACE_EXIT_POINT;
}
@@ -312,11 +300,6 @@
iIdle->Start( TCallBack( KeyCallBack, this) );
iCoeEnv->AddFepObserverL( *this );
- // Sets up TLS, must be done before FeatureManager is used.
- FeatureManager::InitializeLibL();
- // Used in destructor.
- iFeatMgrInitialized = ETrue;
-
TRACE_EXIT_POINT;
}
@@ -398,28 +381,23 @@
break;
case ECalenNotifyCalendarFileDeleted:
{
- TRAP_IGNORE(HandleCalendarDeleteL());
+ TPtrC fileNamePtr = iServices->Context().GetCalendarFileNameL();
+ TInt index = KErrNotFound;
+ TRAP_IGNORE(index = iUnifiedEditorControl->GetCalendarNameForEntryL(fileNamePtr));
+ if(index == KErrNotFound)
+ {
+ DisplayErrorMsgL( CCalenEditorDataHandler::EFormErrDbConflictEntryDeleted );
+ iEntryUiOutParams.iAction = EMeetingDeleted;
+ TryExitL( KCalenButtonIdCloseForm );
+ }
}
break;
default:
break;
}
+
TRACE_EXIT_POINT;
}
-
-
-void CCalenUnifiedEditor::HandleCalendarDeleteL()
- {
- TPtrC fileNamePtr = iServices->Context().GetCalendarFileNameL();
- TInt index = iUnifiedEditorControl->GetCalendarNameForEntryL(fileNamePtr);
- if(index == KErrNotFound)
- {
- DisplayErrorMsgL( CCalenEditorDataHandler::EFormErrDbConflictEntryDeleted );
- iEntryUiOutParams.iAction = EMeetingDeleted;
- TryExitL( KCalenButtonIdCloseForm );
- }
-
- }
// -----------------------------------------------------------------------------
// CCalenUnifiedEditor::InsertFieldL
@@ -569,7 +547,7 @@
SetAllDayFieldL( ETrue );
active = ETrue;
}
- iUnifiedEditorControl->SetAllDayEventL( active );
+ iUnifiedEditorControl->SetAllDayEvent( active );
}
break;
@@ -731,31 +709,6 @@
iServices->IssueCommandL( ECalenAddAttachment );
}
}
- else if ( ctrlid == ECalenEditorAllDayItem )
- {
- // Tap on AllDay field, Switch the status of AllDay field
- iUnifiedEditorControl->SetAllDayEventL(
- !( iUnifiedEditorControl->IsAllDayEvent() ) );
- }
- else if ( ctrlid == ECalenEditorReminder )
- {
- TBool active;
- if( iUnifiedEditorControl->IsAlarmActiveInForm() )
- {
- SetAlarmFieldOnOffL( EFalse );
- active = EFalse;
- }
- else
- {
- SetAlarmFieldOnOffL( ETrue );
- active = ETrue;
- }
- iUnifiedEditorControl->CheckAlarmActive( active );
- }
- else
- {
- keyResponse = CAknForm::OfferKeyEventL( aKeyEvent, aType );
- }
break;
case EKeyEscape:
// Calendar relaunched from cmd line - close viewer
@@ -1038,7 +991,7 @@
iUnifiedEditorControl->MakeUnifiedEditorL();
// Hides Entry type and Calendar Field for exceptional entry/single
// instance of recurrent entry.
- HideFieldsForEditSingleInstanceL();
+ HideFieldsForEditSingleInstance();
TRACE_EXIT_POINT;
}
@@ -1258,7 +1211,7 @@
else if ( focusControl == ECalenEditorAllDayItem )
{
// Tap on AllDay field, Switch the status of AllDay field
- iUnifiedEditorControl->SetAllDayEventL(
+ iUnifiedEditorControl->SetAllDayEvent(
!( iUnifiedEditorControl->IsAllDayEvent() ) );
}
else if ( focusControl == ECalenEditorReminder )
@@ -1522,15 +1475,7 @@
SEikControlInfo CCalenUnifiedEditor::CreateCustomControlL( TInt aControlType )
{
TRACE_ENTRY_POINT;
- if( aControlType == ECalenCtLunarDateEditor && FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- SEikControlInfo controlInfo;
- controlInfo.iControl = new (ELeave) CKoreanLunarDateEditor(iServices);
- controlInfo.iControl->SetParent( this );
- controlInfo.iFlags = 0;
- controlInfo.iTrailerTextId = 0;
- return controlInfo;
- }
+
__ASSERT_ALWAYS( aControlType==ECalenCtDescriptionField, User::Invariant() );
TRACE_EXIT_POINT;
@@ -1552,11 +1497,6 @@
TRACE_EXIT_POINT;
return MEikDialogPageObserver::EEdwinDerived;
}
- if( aControlType == ECalenCtLunarDateEditor && FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- TRACE_EXIT_POINT;
- return MEikDialogPageObserver::EMfneDerived;
- }
TRACE_EXIT_POINT;
return MEikDialogPageObserver::EUnknownType;
@@ -2115,17 +2055,11 @@
if ( error == CCalenEditorDataHandler::EFormErrNone )
{
- ModifyDbFieldL();//default calendar code
+ ModifyDbField();//default calendar code
EditorDataHandler().WriteChangesToEntryL( iRepeatType );
TCalTime newInstanceStartDate, newInstanceEndDate;
CalculateNewInstanceStartAndEndDateL( newInstanceStartDate, newInstanceEndDate );
- if(EditorDataHandler().IsRepeatRuleEdited() && !IsCreatingNewEntry())
- {
- MCalenContext& context = iServices->Context();
- TCalenInstanceId instanceId = context.InstanceId();
- context.SetFocusDateAndTimeL(newInstanceStartDate,TVwsViewId( KUidCalendar, KUidCalenEventView));
- }
TInt saveErr( 0 );
TBool dbChange = iEditorDataHandler->IsCalendarEditedL();
@@ -2228,16 +2162,12 @@
{
if( entry->EntryTypeL() == CCalEntry::EAnniv )
{
- if( !( FeatureManager::FeatureSupported( KFeatureIdKorean )
- && entry->UserInt32L() != ESolar ) )
- {
- // Set yearly rule to Anniversary entry, to create Annaiversary instance yearly
- TCalRRule rrule( TCalRRule::EYearly );
- TCalTime startDate;
- rrule.SetDtStart( newInstanceStartDate );
- rrule.SetInterval( 1 ); // once a year
- entry->SetRRuleL( rrule );
- }
+ // Set yearly rule to Anniversary entry, to create Annaiversary instance yearly
+ TCalRRule rrule( TCalRRule::EYearly );
+ TCalTime startDate;
+ rrule.SetDtStart( newInstanceStartDate );
+ rrule.SetInterval( 1 ); // once a year
+ entry->SetRRuleL( rrule );
}
}
@@ -2321,7 +2251,7 @@
{
EditorDataHandler().ForceValidValuesL( iHasChosenRepeatType? iRepeatType
: CalCommon::EThisAndAll );
- ModifyDbFieldL();//Default Calendar code
+ ModifyDbField();//Default Calendar code
EditorDataHandler().WriteChangesToEntryL( iHasChosenRepeatType? iRepeatType
: CalCommon::EThisAndAll );
@@ -3224,7 +3154,7 @@
// modifies the DB filed in cenrep if user has edited it.
// -----------------------------------------------------------------------------
//
-void CCalenUnifiedEditor::ModifyDbFieldL()
+void CCalenUnifiedEditor::ModifyDbField()
{
if(IsCreatingNewEntry())
{
@@ -3246,7 +3176,7 @@
// instance of recurrent entry.
// -----------------------------------------------------------------------------
//
-void CCalenUnifiedEditor::HideFieldsForEditSingleInstanceL()
+void CCalenUnifiedEditor::HideFieldsForEditSingleInstance()
{
TRACE_ENTRY_POINT;
--- a/calendarui/editors/src/calenunifiededitorcontrol.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/editors/src/calenunifiededitorcontrol.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -24,7 +24,7 @@
#include <CalenDefaultEditorsData.rsg>
#include <calendateutils.h>
#include <calenservices.h>
-#include <featmgr.h>
+
// user includes
#include "calenunifiededitorcontrol.h"
#include "calenunifiededitor.h"
@@ -37,9 +37,6 @@
#include "calenpriorityfield.h"
#include "calendbfield.h"
#include "CalenDescription.h"
-#include "KoreanLunarDateEditor.h"
-#include "KoreanLunarTypeField.h"
-
// debug
#include "calendarui_debug.h"
@@ -84,18 +81,6 @@
delete iDbField;
delete iDescription;
- if( iKoreanLunarTypeField )
- {
- delete iKoreanLunarTypeField;
- }
-
- // Do not call UnInitializeLib() if InitalizeLib() leaves.
- if ( iFeatMgrInitialized )
- {
- // Frees the TLS. Must be done after FeatureManager is used.
- FeatureManager::UnInitializeLib();
- }
-
TRACE_EXIT_POINT;
}
@@ -116,16 +101,6 @@
iDbField = CCalenDbField::NewL( iUnifiedEditor,aServices );
iDescription = CCalenDescription::NewL( iUnifiedEditor );
- // Sets up TLS, must be done before FeatureManager is used.
- FeatureManager::InitializeLibL();
- // Used in destructor.
- iFeatMgrInitialized = ETrue;
-
- if( FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- iKoreanLunarTypeField = CKoreanLunarTypeField::NewL( iUnifiedEditor );
- }
-
TRACE_EXIT_POINT;
}
@@ -220,7 +195,7 @@
User::LeaveIfError( entryEndTime.MinutesFrom( entryStartTime, duration ) );
- ReadRruleL(firstRDate,rruleEndTime);
+ ReadRrule(firstRDate,rruleEndTime);
if( firstRDate <= entryStartTime)
{
@@ -367,13 +342,6 @@
}
CleanupStack::PopAndDestroy( &calendarInfoList );
-
- if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType()
- && FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- iKoreanLunarTypeField->PreLayoutDynInitL();
- }
-
iDescription->InitDescritpionFieldLayoutL();
TRACE_EXIT_POINT;
@@ -388,64 +356,40 @@
{
TRACE_ENTRY_POINT;
// event type, subject, date & year,more details
+
+ RPointerArray<CCalCalendarInfo> calendarInfoList;
+ iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList);
+ CleanupClosePushL( calendarInfoList );
- TInt prevItem = 0;
- prevItem=ECalenEditorSubject;
-
- if(FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_NOTEVIEW_TYPE_LINE,
- EKoreanLunarTypeSelectSolarLunarLeap, ECalenEditorSubject );
- prevItem=EKoreanLunarTypeSelectSolarLunarLeap;
- }
-
- TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType();
-
- if( type != ESolar && FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_DATE_EDITOR_LINE,
- EKoreanLunarAniversityStart, prevItem );
- prevItem=EKoreanLunarAniversityStart;
-
- TTime birthDayYear = iUnifiedEditor.Edited().EventDateTime();
- SetDateField( ECalenEditorStartDate, birthDayYear, ETrue );
- }
- else
- {
- RPointerArray<CCalCalendarInfo> calendarInfoList;
- iUnifiedEditor.GetServices().GetAllCalendarInfoL(calendarInfoList);
- CleanupClosePushL( calendarInfoList );
+ if( calendarInfoList.Count() > 1 )
+ {
+ iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
+ ECalenEditorDBName, ECalenEditorSubject );
- if( calendarInfoList.Count() > 1 )
- {
- iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
- ECalenEditorDBName, prevItem );
- prevItem = ECalenEditorDBName;
- iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM,
- ECalenEditorStartDate, prevItem );
- prevItem=ECalenEditorStartDate;
- }
- else
- {
- iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM,
- ECalenEditorStartDate, prevItem );
- prevItem = ECalenEditorStartDate;
- }
+ iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM,
+ ECalenEditorStartDate, ECalenEditorDBName );
+ }
+ else
+ {
+ iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM,
+ ECalenEditorStartDate, ECalenEditorSubject );
+ }
- CleanupStack::PopAndDestroy( &calendarInfoList );
-
- // "Start Date" Label should be "Date of Birth" for Birthday
- iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate,
- R_QTN_CALEN_EDITOR_DATE_OF_BIRTH );
- }
-
+ CleanupStack::PopAndDestroy( &calendarInfoList );
+
+ // "Start Date" Label should be "Date of Birth" for Birthday
+ iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate,
+ R_QTN_CALEN_EDITOR_DATE_OF_BIRTH );
- iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_ITEM,
- ECalenEditorReminder, prevItem );
-
+ iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_REMINDER_ITEM,
+ ECalenEditorReminder, ECalenEditorStartDate );
iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PLACE_ITEM,
ECalenEditorPlace, ECalenEditorReminder );
+/* iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_PEOPLE_ITEM,
+ ECalenEditorPeople, ECalenEditorPlace );
+*/ /* iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_DB_NAME_ITEM,
+ ECalenEditorDBName, ECalenEditorPlace );*/
// TODO: Uncomment this when enabling attachment support
// Replace ECalenEditorDBName with ECalenEditorAttachment in the next statement
@@ -620,47 +564,17 @@
{
TRACE_ENTRY_POINT;
- TBool useLunarDate = EFalse;
- if(aControlId == ECalenEditorStartDate
- && FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() )
- {
- TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType();
- if( type != ESolar )
- {
- useLunarDate = ETrue;
- }
- }
- }
-
- if(useLunarDate || aControlId == EKoreanLunarAniversityStart
- && FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- CKoreanLunarDateEditor* dateField = NULL;
- dateField = static_cast<CKoreanLunarDateEditor*>( iUnifiedEditor.ControlOrNull( EKoreanLunarAniversityStart ) );
- if( dateField )
- {
- dateField->SetDate(aTime, EFalse);
- }
- if ( aDoDraw )
- {
- dateField->DrawDeferred();
- }
- }
- else
+ CEikDateEditor* dateField = NULL;
+ dateField = static_cast<CEikDateEditor*>( iUnifiedEditor.ControlOrNull( aControlId ) );
+ if( dateField )
{
- CEikDateEditor* dateField = NULL;
- dateField = static_cast<CEikDateEditor*>( iUnifiedEditor.ControlOrNull( aControlId ) );
- if( dateField )
- {
- dateField->SetDate( aTime );
- if( aDoDraw )
- {
- dateField->DrawDeferred();
- }
- }
- }
+ dateField->SetDate( aTime );
+ if( aDoDraw )
+ {
+ dateField->DrawDeferred();
+ }
+ }
+
TRACE_EXIT_POINT;
}
@@ -761,7 +675,7 @@
// To Set AllDay field value
// -----------------------------------------------------------------------------
//
-void CCalenUnifiedEditorControl::SetAllDayEventL( TBool aActive )
+void CCalenUnifiedEditorControl::SetAllDayEvent( TBool aActive )
{
TRACE_ENTRY_POINT;
@@ -807,19 +721,6 @@
iDbField->HandleControlStateChangeL( aControlId );
}
break;
- case EKoreanLunarTypeSelectSolarLunarLeap:
- {
- if (FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- iKoreanLunarTypeField->HandleControlStateChangeL( aControlId );
- }
- }
- break;
- case EKoreanLunarAniversityStart:
- {
- iKoreanLunarDateEditor->HandleControlStateChangeL( aControlId );
- }
-
default:
break;
}
@@ -849,7 +750,6 @@
case ECalenEditorStartTime:
case ECalenEditorStartDate:
- case EKoreanLunarAniversityStart:
{
ReadStartDateTimeFromEditorL( ETrue, aFocusedId );
UpdateMeetingDurationL();
@@ -904,8 +804,6 @@
break;
case ECalenEditorDescription:
break;
- case EKoreanLunarTypeSelectSolarLunarLeap:
- break;
default:
break;
}
@@ -946,44 +844,6 @@
}
// -----------------------------------------------------------------------------
-// CCalenUnifiedEditorControl::OnLunarTypeChangedL
-// Handles lunar type changed
-// -----------------------------------------------------------------------------
-//
-void CCalenUnifiedEditorControl::OnLunarTypeChangedL( TLunarCalendarType aNewEventType )
- {
- TRACE_ENTRY_POINT;
- if( FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- TLunarCalendarType oldType = iUnifiedEditor.Edited().CalendarType();
- if(oldType != aNewEventType)
- {
- iUnifiedEditor.Edited().SetCalendarTypeL(aNewEventType);
- if(aNewEventType == ESolar)
- {
- iUnifiedEditor.DeleteLine(EKoreanLunarAniversityStart, ETrue);
- iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM,
- ECalenEditorStartDate, EKoreanLunarTypeSelectSolarLunarLeap );
- iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate,
- R_QTN_CALEN_EDITOR_DATE_OF_BIRTH );
- SetDataToEditorL();
- }
- else
- {
- if(oldType == ESolar)
- {
- iUnifiedEditor.DeleteLine(ECalenEditorStartDate, ETrue);
- iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_DATE_EDITOR_LINE,
- EKoreanLunarAniversityStart, EKoreanLunarTypeSelectSolarLunarLeap );
- SetDataToEditorL();
- }
- }
- }
- }
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
// CCalenUnifiedEditorControl::DeletePreviousEntryTypeFieldsL
// Delete previous entry type fields on selcting
// the new entry type
@@ -998,28 +858,15 @@
case CCalEntry::EEvent:
{
// Delete AllDay, StartDate, EndDate, and Place fields
- iUnifiedEditor.DeleteLine( ECalenEditorAllDayItem, EFalse );
- iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse );
- iUnifiedEditor.DeleteLine( ECalenEditorEndDate, EFalse );
- iUnifiedEditor.DeleteLine( ECalenEditorPlace, EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorAllDayItem, ETrue );
+ iUnifiedEditor.DeleteLine( ECalenEditorStartDate, ETrue );
+ iUnifiedEditor.DeleteLine( ECalenEditorEndDate, ETrue );
+ iUnifiedEditor.DeleteLine( ECalenEditorPlace, ETrue );
}
break;
case CCalEntry::EAnniv:
{
- TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType();
- if( type != ESolar && FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- iUnifiedEditor.DeleteLine( EKoreanLunarAniversityStart, EFalse );
- }
- else
- {
- iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse );
- }
-
- if(FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- iUnifiedEditor.DeleteLine( EKoreanLunarTypeSelectSolarLunarLeap, EFalse );
- }
+ iUnifiedEditor.DeleteLine( ECalenEditorStartDate, ETrue );
}
break;
case CCalEntry::EAppt:
@@ -1027,26 +874,26 @@
if( iUnifiedEditor.Edited().IsAllDayEvent() )
{
// Delete, AllDay event fields from Editor
- iUnifiedEditor.DeleteLine( ECalenEditorAllDayItem, EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorAllDayItem, ETrue );
}
else
{
// Delete, Non-AllDay event fields from Editor
- iUnifiedEditor.DeleteLine( ECalenEditorAllDayItem, EFalse );
- iUnifiedEditor.DeleteLine( ECalenEditorStartTime, EFalse );
- iUnifiedEditor.DeleteLine( ECalenEditorEndTime, EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorAllDayItem, ETrue );
+ iUnifiedEditor.DeleteLine( ECalenEditorStartTime, ETrue );
+ iUnifiedEditor.DeleteLine( ECalenEditorEndTime, ETrue );
}
- iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse );
- iUnifiedEditor.DeleteLine( ECalenEditorEndDate, EFalse );
- iUnifiedEditor.DeleteLine( ECalenEditorPlace, EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorStartDate, ETrue );
+ iUnifiedEditor.DeleteLine( ECalenEditorEndDate, ETrue );
+ iUnifiedEditor.DeleteLine( ECalenEditorPlace, ETrue );
}
break;
case CCalEntry::ETodo:
{
- iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse );
- iUnifiedEditor.DeleteLine( ECalenEditorPriority, EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorStartDate, ETrue );
+ iUnifiedEditor.DeleteLine( ECalenEditorPriority, ETrue );
}
break;
default:
@@ -1075,15 +922,15 @@
if( alarmTimeCtrl )
{
- iUnifiedEditor.DeleteLine( ECalenEditorReminderTime, EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorReminderTime, ETrue );
}
if( alarmDateCtrl )
{
- iUnifiedEditor.DeleteLine( ECalenEditorReminderDate, EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorReminderDate, ETrue );
}
}
- iUnifiedEditor.DeleteLine( ECalenEditorReminder,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorReminder );
/*CCoeControl* PeopleFieldCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorPeople );
if( PeopleFieldCtrl )
@@ -1094,18 +941,18 @@
CCoeControl* dbNameCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorDBName );
if( dbNameCtrl )
{
- iUnifiedEditor.DeleteLine( ECalenEditorDBName,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorDBName );
}
// TODO: Uncomment this when enabling attachment support
- iUnifiedEditor.DeleteLine( ECalenEditorAttachment,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorAttachment );
- iUnifiedEditor.DeleteLine( ECalenEditorDescription,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorDescription );
// To-Do do not have place field
CCoeControl* editorPlaceCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorPlace );
if( editorPlaceCtrl )
{
- iUnifiedEditor.DeleteLine( ECalenEditorPlace,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorPlace );
}
// Anniversary & To-Do entry, do not have Repeat field
@@ -1117,11 +964,11 @@
CCoeControl* repeatUntilCtrl = iUnifiedEditor.ControlOrNull( ECalenEditorRepeatUntil );
if( repeatCtrl )
{
- iUnifiedEditor.DeleteLine( ECalenEditorRepeat,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorRepeat );
}
if( repeatUntilCtrl )
{
- iUnifiedEditor.DeleteLine( ECalenEditorRepeatUntil,EFalse );
+ iUnifiedEditor.DeleteLine( ECalenEditorRepeatUntil );
}
}
}
@@ -1214,16 +1061,6 @@
}
}
- if( iUnifiedEditor.GetEntryType() == CCalEntry::EAnniv
- && FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- CCoeControl* lunarcaltype = iUnifiedEditor.ControlOrNull( EKoreanLunarTypeSelectSolarLunarLeap );
- if( lunarcaltype )
- {
- iKoreanLunarTypeField->ReadDataFromFormL( aContinueOnError );
- }
- }
-
iDbField->ReadDataFromFormL( aContinueOnError );
TRACE_EXIT_POINT;
@@ -1414,20 +1251,6 @@
TTime CCalenUnifiedEditorControl::ReadTimeField( TInt aControlId )
{
TRACE_ENTRY_POINT;
-
- if(aControlId == ECalenEditorStartDate && FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() )
- {
- TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType();
- if( type != ESolar )
- {
- aControlId = EKoreanLunarAniversityStart;
- TRACE_EXIT_POINT;
- return static_cast<CKoreanLunarDateEditor*>( iUnifiedEditor.Control( aControlId ) )->Date();
- }
- }
- }
TRACE_EXIT_POINT;
return static_cast<CEikTTimeEditor*>( iUnifiedEditor.Control( aControlId ) )->GetTTime();
}
@@ -1440,21 +1263,6 @@
TTime CCalenUnifiedEditorControl::ReadDateField( TInt aControlId )
{
TRACE_ENTRY_POINT;
-
- if(aControlId == ECalenEditorStartDate && FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- if( CCalEntry::EAnniv == iUnifiedEditor.GetEntryType() )
- {
- TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType();
- if( type != ESolar )
- {
- aControlId = EKoreanLunarAniversityStart;
- TRACE_EXIT_POINT;
- return static_cast<CKoreanLunarDateEditor*>( iUnifiedEditor.Control( aControlId ) )->Date();
- }
- }
- }
-
TRACE_EXIT_POINT;
return static_cast<CEikDateEditor*>( iUnifiedEditor.Control( aControlId ) )->Date();
}
@@ -1547,23 +1355,14 @@
case CCalEntry::EAnniv:
{
- TLunarCalendarType type = iUnifiedEditor.Edited().CalendarType();
- if( type != ESolar && FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- iUnifiedEditor.DeleteLine( EKoreanLunarAniversityStart, EFalse );
- iUnifiedEditor.InsertFieldL( R_KOREAN_LUNAR_DATE_EDITOR_LINE,
- EKoreanLunarAniversityStart, EKoreanLunarTypeSelectSolarLunarLeap );
- }
- else
- {
- iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse );
- iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM,
- ECalenEditorStartDate, ECalenEditorEventType );
- // "Start Date" Label should be "Date of Birth" for Birthday
- iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate,
- R_QTN_CALEN_EDITOR_DATE_OF_BIRTH );
- }
-
+ iUnifiedEditor.DeleteLine( ECalenEditorStartDate, EFalse );
+ iUnifiedEditor.InsertFieldL( R_CALEN_EDITOR_START_DATE_ITEM,
+ ECalenEditorStartDate, ECalenEditorEventType );
+
+ // "Start Date" Label should be "Date of Birth" for Birthday
+ iUnifiedEditor.SetControlCaptionL( ECalenEditorStartDate,
+ R_QTN_CALEN_EDITOR_DATE_OF_BIRTH );
+
}
break;
@@ -1660,12 +1459,10 @@
return iDbField->GetCalendarNameForEntryL();
}
-
TInt CCalenUnifiedEditorControl::GetCalendarNameForEntryL(const TDesC& aCalendarFileName)
{
TRACE_ENTRY_POINT;
TRACE_EXIT_POINT;
-
return iDbField->GetCalendarNameForEntryL(aCalendarFileName);
}
@@ -1734,7 +1531,7 @@
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
-void CCalenUnifiedEditorControl::ReadRruleL(TTime& firstRdatestartTime, TTime& endTime)
+void CCalenUnifiedEditorControl::ReadRrule(TTime& firstRdatestartTime, TTime& endTime)
{
TRACE_ENTRY_POINT;
--- a/calendarui/globaldata/inc/calencontextimpl.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/globaldata/inc/calencontextimpl.h Wed Oct 13 14:30:35 2010 +0300
@@ -128,21 +128,6 @@
* this will be TCalenInstanceId::NullInstanceIdL()
*/
TCalenInstanceId InstanceId() const;
-
- /**
- * Sets the start and end time of the instance that has to be created.
- * @param aStartTime The start time of the instance that has to be created.
- * @param aEndTime The end time of the instance that has to be created.
- */
- void SetStartAndEndTimeForNewInstance( const TTime& aStartTime,
- const TTime& aEndTime );
-
- /**
- * Gets the start and end time of the instance that has to be created.
- * @param aStartTime The start time of the instance that has to be created.
- * @param aEndTime The end time of the instance that has to be created.
- */
- void GetStartAndEndTimeForNewInstance( TTime& aStartTime, TTime& aEndTime );
/**
* Gets the id of the currently active view.
@@ -270,10 +255,6 @@
HBufC* iCalenFileName;
HBufC* iCalAlarmEntryFileName;
TCalLocalUid iCalAlarmLocalUid;
-
- // The new instance's start and end time
- TTime iNewInstStartTime;
- TTime iNewInstEndTime;
};
#endif // CALENCONTEXTIMPL_H
--- a/calendarui/globaldata/inc/calenglobaldata.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/globaldata/inc/calenglobaldata.h Wed Oct 13 14:30:35 2010 +0300
@@ -423,11 +423,6 @@
void ConstructCalendarsListL();
/**
- * @brief Update calendarlist whenever CalendarInfoUpdated notification is received.
- */
- void UpdateCalendarListL();
-
- /**
* @brief gets default calendar information
*
* @return CCalCalendarInfo returns pointer to default calendar info
--- a/calendarui/globaldata/src/calencontextimpl.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/globaldata/src/calencontextimpl.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -309,36 +309,6 @@
}
// -----------------------------------------------------------------------------
-// CCalenContextImpl::SetStartAndEndTimeForNewInstance
-// Sets the start and end time of the instance that has to be created.
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CCalenContextImpl::SetStartAndEndTimeForNewInstance( const TTime& aStartTime,
- const TTime& aEndTime )
- {
- TRACE_ENTRY_POINT;
- iNewInstStartTime = aStartTime;
- iNewInstEndTime = aEndTime;
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenContextImpl::GetStartAndEndTimeForNewInstance
-// Gets the start and end time of the instance that has to be created.
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CCalenContextImpl::GetStartAndEndTimeForNewInstance( TTime& aStartTime,
- TTime& aEndTime )
- {
- TRACE_ENTRY_POINT;
- aStartTime = iNewInstStartTime;
- aEndTime = iNewInstEndTime;
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
// CCalenContextImpl::ViewId
// Returns the view id
// (other items were commented in a header).
@@ -505,14 +475,7 @@
{
TRACE_ENTRY_POINT
TRACE_EXIT_POINT
- if(iCalenFileName)
- {
- return *iCalenFileName;
- }
- else
- {
- return const_cast<TDesC&> (KNullDesC());
- }
+ return *iCalenFileName;
}
// -----------------------------------------------------------------------------
--- a/calendarui/globaldata/src/calenglobaldata.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/globaldata/src/calenglobaldata.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -1550,7 +1550,7 @@
resourceFile.ConfirmSignatureL( 0 );
for(TInt index=0;index < iCalendarInfoList.Count();index++)
{
-
+ CCalCalendarInfo* calendarInfo = iCalendarInfoList[index];
TPtrC calendarNamePtr = iCalendarInfoList[index]->NameL();
if(calendarNamePtr.Compare(KPersonal) == 0)
{
@@ -1562,9 +1562,34 @@
iCalendarInfoList[index]->SetNameL(*personalCalendar);
CleanupStack::PopAndDestroy( 2,personalBuffer );
}
-
-
+ TBuf8<KBuffLength> keyBuff;
+ // Mark the meta property as SoftDeleted
+ keyBuff.Zero();
+ keyBuff.AppendNum(EMarkAsDelete);
+ TBool softDelete = EFalse;
+ TPckgC<TBool> pkgSoftDelete( softDelete );
+ TRAPD(err,pkgSoftDelete.Set(calendarInfo->PropertyValueL(keyBuff)));
+ if( KErrNone == err )
+ {
+ softDelete = pkgSoftDelete();
+ }
+ if( !softDelete )
+ {
aCalendarInfoList.AppendL(iCalendarInfoList[index]);
+ }
+ else
+ {
+ iCalendarInfoList.Remove(index);
+ delete calendarInfo;
+
+ iHashDbidIndexMap.Close();
+
+ iFileMappingArray.Remove(index);
+ for(TInt index = 0; index < iFileMappingArray.Count(); index++)
+ {
+ iHashDbidIndexMap.InsertL(iFileMappingArray[index]->GetCollectionId(), index);
+ }
+ }
}
CleanupStack::PopAndDestroy(2);
@@ -1673,31 +1698,6 @@
}
// -----------------------------------------------------------------------------
-// CCalenGlobalData::UpdateCalendarListL
-// Update calendar list whenever CalendarInfoUpdated notification is received.
-// -----------------------------------------------------------------------------
-//
-void CCalenGlobalData::UpdateCalendarListL()
- {
- //Getting calendar name updated from calennotifier infochangednotification
- HBufC* calendarNameUpdated = iContext->GetCalendarFileNameL().AllocLC();
- TInt index = iFileMappingArray.Find( *calendarNameUpdated,
- CCalenGlobalData::CalenInfoIdentifierL);
-
- if(index != KErrNotFound)
- {
- CCalSession* session = iFileMappingArray[index]->GetSessionPtr();
- for(TInt i=0; i<iCalendarInfoList.Count() ;i++)
- {
- if( !iCalendarInfoList[i]->FileNameL().CompareF(calendarNameUpdated->Des()))
- {
- iCalendarInfoList[i] = session->CalendarInfoL();
- }
- }
- }
- CleanupStack::PopAndDestroy(calendarNameUpdated);
- }
-// -----------------------------------------------------------------------------
// CCalenGlobalData::GetDefaultCalendarInfoL
// Get default calendar info
// -----------------------------------------------------------------------------
@@ -1813,10 +1813,10 @@
void CCalenGlobalData::HandleCalendarInfoUpdatedL()
{
TRACE_ENTRY_POINT;
-
- //Update Calendar list.
- UpdateCalendarListL();
-
+
+ // reconstruct the calendar list using the iterator
+ ConstructCalendarsListL();
+
TRACE_EXIT_POINT;
}
--- a/calendarui/group/bld.inf Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/group/bld.inf Wed Oct 13 14:30:35 2010 +0300
@@ -59,10 +59,6 @@
../rom/CalenLunarVietnamese_Variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(CalenLunarVietnamese_Variant.iby)
../rom/CalenLunarChinese_Variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(CalenLunarChinese_Variant.iby)
-#ifdef FF_CALDAV_SUPPORT
-//caldav plugin
-../rom/caldav.iby CORE_APP_LAYER_IBY_EXPORT_PATH(caldav.iby)
-#endif //FF_CALDAV_SUPPORT
//stubsis is added to provide IAD
../stubsis/calendar_stub.sis /epoc32/data/z/system/install/calendar_stub.sis
@@ -136,10 +132,4 @@
// Calendar aiw provider.
#include "../calenaiwprovider/group/bld.inf"
-#include "../regionalplugins/KoreanLunar/group/bld.inf"
-
-#ifdef FF_CALDAV_SUPPORT
-//caldav ecom plugin
-#include "../caldav/group/bld.inf"
-#endif //FF_CALDAV_SUPPORT
//EOF
Binary file calendarui/help/data/xhtml.zip has changed
--- a/calendarui/inc/CalenUid.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/inc/CalenUid.h Wed Oct 13 14:30:35 2010 +0300
@@ -55,7 +55,6 @@
const TUid KCalenThaiImplUid = {0x102823A7};
const TUid KCalenChineseImplUid = {0x102823A5};
const TUid KCalenVietnameseImplUid = {0x102823A6};
-const TUid KCalenKoreanImplUid = {0x200100A2};
#endif // CALENUID_H
--- a/calendarui/multicaluidialog/inc/caluidialogimpl.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/multicaluidialog/inc/caluidialogimpl.h Wed Oct 13 14:30:35 2010 +0300
@@ -218,7 +218,7 @@
* @param aPtr
* @return TInt
*/
- static TInt DoAsyncExitL(TAny* aPtr);
+ static TInt DoAsyncExit(TAny* aPtr);
private: // data
--- a/calendarui/multicaluidialog/inc/multicaluidialogimpl.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/multicaluidialog/inc/multicaluidialogimpl.h Wed Oct 13 14:30:35 2010 +0300
@@ -254,7 +254,7 @@
/*
* Async exit for the dialog
*/
- static TInt DoAsyncExitL(TAny* aPtr);
+ static TInt DoAsyncExit(TAny* aPtr);
private: // data
--- a/calendarui/multicaluidialog/inc/multicaluidialogmodel.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/multicaluidialog/inc/multicaluidialogmodel.h Wed Oct 13 14:30:35 2010 +0300
@@ -52,7 +52,7 @@
* Setter function for calendar entry.
* @param aCalEntry. Calendar Entry.
*/
- void SetCalEntryL(const RPointerArray<CCalEntry>& aCalEntries);
+ void SetCalEntry(const RPointerArray<CCalEntry>& aCalEntries);
/**
* Stores the calendar entry into the calendars selected by the user.
--- a/calendarui/multicaluidialog/src/caluidialogimpl.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/multicaluidialog/src/caluidialogimpl.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -168,12 +168,12 @@
iMultiCalUiDialogModel = CMultiCalUiDialogModel::NewL();
- iMultiCalUiDialogModel->SetCalEntryL(aCalEntries);
+ iMultiCalUiDialogModel->SetCalEntry(aCalEntries);
// CAknDialog::ConstructL( R_CALEN_CALDB_MENUBAR );
CAknDialog::ConstructL( R_CALENDB_LIST_MENUBAR );
- TCallBack callBack(CCalUiDialogImpl::DoAsyncExitL,this);
+ TCallBack callBack(CCalUiDialogImpl::DoAsyncExit,this);
iAsyncExit = new(ELeave) CAsyncCallBack(callBack,CActive::EPriorityStandard);
TRACE_EXIT_POINT
@@ -776,7 +776,7 @@
// (other items were commented in a header).
// ----------------------------------------------------------------------------
//
-TInt CCalUiDialogImpl::DoAsyncExitL(TAny* aPtr)
+TInt CCalUiDialogImpl::DoAsyncExit(TAny* aPtr)
{
TRACE_ENTRY_POINT
CCalUiDialogImpl* self = static_cast<CCalUiDialogImpl*>(aPtr);
--- a/calendarui/multicaluidialog/src/multicaluidialogimpl.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/multicaluidialog/src/multicaluidialogimpl.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -162,7 +162,7 @@
iMultiCalUiDialogModel = CMultiCalUiDialogModel::NewL();
- iMultiCalUiDialogModel->SetCalEntryL(aCalEntries);
+ iMultiCalUiDialogModel->SetCalEntry(aCalEntries);
CAknDialog::ConstructL (R_CALENDB_LIST_MENUBAR);
TRACE_EXIT_POINT
@@ -905,7 +905,7 @@
// (other items were commented in a header).
// ----------------------------------------------------------------------------
//
-TInt CMultiCalUiDialogImpl::DoAsyncExitL(TAny* aPtr)
+TInt CMultiCalUiDialogImpl::DoAsyncExit(TAny* aPtr)
{
TRACE_ENTRY_POINT
CMultiCalUiDialogImpl* self = static_cast<CMultiCalUiDialogImpl*>(aPtr);
--- a/calendarui/multicaluidialog/src/multicaluidialogmodel.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/multicaluidialog/src/multicaluidialogmodel.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -111,7 +111,7 @@
// Rest of the details are commented in header.
// ----------------------------------------------------------------------------
//
-void CMultiCalUiDialogModel::SetCalEntryL(
+void CMultiCalUiDialogModel::SetCalEntry(
const RPointerArray<CCalEntry>& aCalEntries)
{
TRACE_ENTRY_POINT
--- a/calendarui/organizerplugin/aiagendapluginengine/src/CalenEngine.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/organizerplugin/aiagendapluginengine/src/CalenEngine.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -30,13 +30,14 @@
#include <calsession.h>
#include <calcalendarinfo.h>
#include <calcalendariterator.h>
+#include <calenmulticaluids.hrh>
enum TCalenEnginePanic
{
EMultipleCommands = 0
};
-
+const TInt KBuffLength = 24;
// -----------------------------------------------------------------------------
// ?implementation_description
@@ -188,7 +189,19 @@
for(CCalCalendarInfo* calendarInfo = calIter->FirstL() ;
calendarInfo != NULL ; calendarInfo = calIter->NextL() )
{
- if(calendarInfo->Enabled())
+ TBuf8<KBuffLength> keyBuff;
+ // Mark the meta property as SoftDeleted
+ keyBuff.Zero();
+ keyBuff.AppendNum(EMarkAsDelete);
+ TBool softDelete = EFalse;
+ TPckgC<TBool> pkgSoftDelete( softDelete );
+ TRAPD(err,pkgSoftDelete.Set(calendarInfo->PropertyValueL(keyBuff)));
+ if( KErrNone == err )
+ {
+ softDelete = pkgSoftDelete();
+ }
+
+ if(!softDelete && calendarInfo->Enabled() )
{
TCalInfo calInfo;
calInfo.iFileName = calendarInfo->FileNameL();
--- a/calendarui/organizerplugin/data/group/bld.inf Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/organizerplugin/data/group/bld.inf Wed Oct 13 14:30:35 2010 +0300
@@ -16,7 +16,7 @@
*/
-#include "../vga_tch/group/bld.inf" // Buzzidle
+#include "../vga/group/bld.inf" // Buzzidle
#include "../qhd_tch/group/bld.inf" // Flashidle
PRJ_PLATFORMS
--- a/calendarui/organizerplugin/data/vga_tch/group/bld.inf Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 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: Homescreen's Buzzidle (vga) widgets
-*
-*/
-
-#include "../organizer_2001f48d/group/bld.inf"
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-
-
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/group/bld.inf Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,77 +0,0 @@
-/*
-* Copyright (c) 2002-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: The information required for building
-*
-*/
-
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-// Support for productization and Carbide.Ui customization
-//********************************************************
-../hsps/00/manifest.dat /epoc32/data/z/resource/homescreen/organizer_2001f48d/hsps/manifest.dat
-../hsps/00/widgetconfiguration.xml /epoc32/data/z/resource/homescreen/organizer_2001f48d/hsps/widgetconfiguration.xml
-../hsps/00/organizerconfiguration.dtd /epoc32/data/z/resource/homescreen/organizer_2001f48d/hsps/organizerconfiguration.dtd
-
-../xuikon/00/organizer.dat /epoc32/data/z/resource/homescreen/organizer_2001f48d/xuikon/organizer_2001f48d.dat
-../xuikon/00/organizer.css /epoc32/data/z/resource/homescreen/organizer_2001f48d/xuikon/organizer.css
-../xuikon/00/organizer.xml /epoc32/data/z/resource/homescreen/organizer_2001f48d/xuikon/organizer.xml
-../xuikon/00/organizer.dtd /epoc32/data/z/resource/homescreen/organizer_2001f48d/xuikon/organizer.dtd
-
-// Arabic languages
-//*****************
-../xuikon/37/organizer.css /epoc32/data/z/resource/homescreen/organizer_2001f48d/xuikon/37/organizer.css
-../xuikon/50/organizer.css /epoc32/data/z/resource/homescreen/organizer_2001f48d/xuikon/50/organizer.css
-../xuikon/57/organizer.css /epoc32/data/z/resource/homescreen/organizer_2001f48d/xuikon/57/organizer.css
-../xuikon/94/organizer.css /epoc32/data/z/resource/homescreen/organizer_2001f48d/xuikon/94/organizer.css
-
-
-// Support for S60 localization
-//*****************************
-#ifndef __ORGANIZERCONFIGURATION_LOC__
-#define __ORGANIZERCONFIGURATION_LOC__
-../loc/organizerconfiguration.loc APP_LAYER_LOC_EXPORT_PATH(organizerconfiguration.loc)
-#endif // __ORGANIZERCONFIGURATION_LOC__
-
-#ifndef __ORGANIZER_LOC__
-#define __ORGANIZER_LOC__
-../loc/organizer.loc APP_LAYER_LOC_EXPORT_PATH(organizer.loc)
-#endif // __ORGANIZER_LOC__
-
-// Support for S60 builds
-//***********************
-../rom/organizer_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(organizer_2001f48d_resources.iby)
-../rom/organizer_customer.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(organizer_2001f48d_customer.iby)
-../rom/organizer_variant.iby CUSTOMER_APP_LAYER_IBY_EXPORT_PATH(organizer_2001f48d_variant.iby)
-../rom/organizer.iby CORE_APP_LAYER_IBY_EXPORT_PATH(organizer_2001f48d.iby)
-
-
-// Dtd-localization
-//*****************
-PRJ_EXTENSIONS
-START EXTENSION tools/dtd
-OPTION SWITCH_LOC_FILE_NAME organizer_2001f48d
-OPTION DTD_TYPE widget
-END
-
-
-PRJ_MMPFILES
-
-PRJ_TESTMMPFILES
-
-// End of File
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/hsps/00/manifest.dat Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,36 +0,0 @@
-<?xml version="1.0"?>
-<package version="2.0">
-
- <family>vga_tch</family>
-
- <type>widget</type>
-
- <!-- interface uid -->
- <interfaceuid>0x2001f48a</interfaceuid>
-
- <!-- vendor uid -->
- <provideruid>0x101fb657</provideruid>
-
- <!-- uid -->
- <configurationuid>0x2001f48d</configurationuid>
-
- <!-- description -->
- <fullname>&qtn_hs_large_cale;</fullname>
- <shortname>org</shortname>
- <version>1.0</version>
- <description>&qtn_organizer_widget_description;</description>
- <filelogo>uid(0x10005901)</filelogo>
-
- <!-- configuration -->
- <filexml>widgetconfiguration.xml</filexml>
-
- <!-- Name of the localization files -->
- <filedtd>organizerconfiguration.dtd</filedtd>
-
- <!-- Locale specific resources -->
- <localization>
- <fileresource tag="xuikon">orga.o0000</fileresource>
- </localization>
-
-
-</package>
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/hsps/00/organizerconfiguration.dtd Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-============================================================================
-<FileName: "organizerconfiguration.dtd">
-<PartOf : "organizerconfiguration">
-
-<FileDescription: "Localization strings for the configuration">
-<FileVersion : >
-
-<Copyright:
-"Copyright © 2007 Nokia Corporation.
-This material, including documentation and any related
-computer programs, is protected by copyright controlled by
-Nokia Corporation. All rights are reserved. Copying,
-including reproducing, storing, adapting or translating, any
-or all of this material requires the prior written consent of
-Nokia Corporation. This material also contains confidential
-information which may not be disclosed to others without the
-prior written consent of Nokia Corporation.">
-============================================================================
--->
-
-<!-- LOCALISATION STRINGS -->
-
-<!--
-qtn_organizer_configuration_name.attributes
-qtn_organizer_configuration_name.layout "listrow_wgtman_pane_t1"
-qtn_organizer_configuration_name.release "TB9.2"
-qtn_organizer_configuration_name.description "Calendar"
-qtn_organizer_configuration_name.parents ""
--->
-<!ENTITY qtn_hs_large_cale "Calendar">
-
-<!--
-qtn_organizer_widget_description.attributes
-qtn_organizer_widget_description.layout "listrow_wgtman_pane_t2"
-qtn_organizer_widget_description.release "TB9.2"
-qtn_organizer_widget_description.description "Organizer Widget"
-qtn_organizer_widget_description.parents ""
--->
-<!ENTITY qtn_organizer_widget_description "Organizer Widget">
-
-<!-- End of File-->
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/hsps/00/widgetconfiguration.xml Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-<configuration>
- <control>
- <settings/>
- </control>
-</configuration>
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/loc/organizer.loc Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2005-2006 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: Localization strings for project Active Idle 3
-*
-*/
-
-
-// d: No cale events for today or next 7 days
-// l: ai2_gene_pane_t1/opt1
-// w:
-// r: TB9.2
-#define qtn_ai_cale_no_eve_positive_short "No calendar events within next 7 days"
-
-// d: No more cale events for today or next 7 days
-// l: ai2_gene_pane_t1/opt1
-// w:
-// r: TB9.2
-#define qtn_ai_cale_no_more_ev_positive_short "No more calendar events within next 7 days"
-
-// d: Next event tomorrow
-// l: ai2_gene_pane_t1/opt1
-// w:
-// r: TB9.2
-#define qtn_hs_cale_next_tomorrow "Next event tomorrow"
\ No newline at end of file
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/loc/organizerconfiguration.loc Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,28 +0,0 @@
-/*
-* Copyright (c) 2005-2006 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: Localization strings for project Active Idle 3
-*
-*/
-
-// d: Calendar widget
-// l: listrow_wgtman_pane_t1
-// w:
-// r: TB9.2
-#define qtn_hs_large_cale "Calendar"
-
-// d: Calendar widget description
-// l: listrow_wgtman_pane_t2
-// w:
-// r: TB9.2
-#define qtn_organizer_widget_description "Informs you of calendar events. Provides quick access to calendar."
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/rom/organizer.iby Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2005-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: Organizer widget HSPS-plugin IBY file.
-*
-*/
-
-
-#ifndef __ORGANIZER_2001F48D_IBY__
-#define __ORGANIZER_2001F48D_IBY__
-
-#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3)
-
-// Enabled by DTD-localization tools
-data=ZPRIVATE\200159c0\install\organizer_2001f48d\hsps\00\manifest.dat \private\200159c0\install\organizer_2001f48d\hsps\00\manifest.dat
-
-#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3)
-
-#endif // __ORGANIZER_2001F48D_IBY__
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/rom/organizer_customer.iby Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2005-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: Organizer widget HSPS-plugin language specific IBY file.
-*
-*/
-
-
-#ifndef __ORGANIZER_2001F48D_CUSTOMER_IBY__
-#define __ORGANIZER_2001F48D_CUSTOMER_IBY__
-
-#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3)
-
-// Enabled by DTD-localization tools, language specific
-data=ZPRIVATE\200159c0\install\organizer_2001f48d\xuikon\00\orga.o0000 \private\200159c0\install\organizer_2001f48d\xuikon\00\orga.o0000
-data=ZPRIVATE\200159c0\install\organizer_2001f48d\hsps\00\organizerconfiguration.dtd \private\200159c0\install\organizer_2001f48d\hsps\00\organizerconfiguration.dtd
-
-#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3)
-
-#endif // __ORGANIZER_2001F48D_CUSTOMER_IBY__
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/rom/organizer_resources.iby Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-/*
-* Copyright (c) 2005-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: Organizer widget HSPS-plugin language specific IBY file.
-*
-*/
-
-
-#ifndef __ORGANIZER_2001F48D_RESOURCES_IBY__
-#define __ORGANIZER_2001F48D_RESOURCES_IBY__
-
-#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3)
-
-// Enabled by DTD-localization tools, language specific
-data=ZPRIVATE\200159c0\install\organizer_2001f48d\xuikon\00\orga.o0000 \private\200159c0\install\organizer_2001f48d\xuikon\00\orga.o0000
-data=ZPRIVATE\200159c0\install\organizer_2001f48d\hsps\00\organizerconfiguration.dtd \private\200159c0\install\organizer_2001f48d\hsps\00\organizerconfiguration.dtd
-
-#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3)
-
-#endif // __ORGANIZER_2001F48D_RESOURCES_IBY__
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/rom/organizer_variant.iby Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,29 +0,0 @@
-/*
-* Copyright (c) 2005-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: Organizer widget HSPS-plugin variant specific IBY file.
-*
-*/
-
-
-#ifndef __ORGANIZER_2001F48D_VARIANT_IBY__
-#define __ORGANIZER_2001F48D_VARIANT_IBY__
-
-#if defined (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3)
-
-// Enabled by variation tools, variant specific
-data=ZPRIVATE\200159c0\install\organizer_2001f48d\hsps\00\widgetconfiguration.xml \private\200159c0\install\organizer_2001f48d\hsps\00\widgetconfiguration.xml
-
-#endif // (FF_LAYOUT_480_640_VGA3) || defined (FF_LAYOUT_640_480_VGA3)
-
-#endif // __ORGANIZER_2001F48D_VARIANT_IBY__
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/xuikon/00/organizer.css Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,75 +0,0 @@
-widget#calendarPluginContainer {
- display: block;
- width: auto;
- height: auto;
- padding-left: 10px;
- padding-right: 10px;
- padding-top: 2%;
- padding-bottom: 2%;
- nav-index: appearance;
- block-progression: tb;
-}
-
-button.calendarEntryBox {
- display: none;
- visibility: visible;
- width: auto;
- height: 31%;
- margin-top: auto;
- margin-bottom: auto;
- block-progression: lr;
-}
-
-image.calendarEntryIcon { /* ai_gene_pane_1_g1 */
- display: block;
- visibility: visible;
- width: 24px;
- height: 24px;
-}
-
-text.calendarEntryText1 { /* ai_gene_pane_1_t1 */
- display: block;
- visibility: visible;
- position: static;
- height: auto;
- width: auto;
- padding-left: 5px;
- padding-right: 6px;
- font-family: EAknLogicalFontSecondaryFont;
- font-size: 23px;
- _s60-text-valign: top;
- color: "SKIN(268458534 13056 74)";
-}
-
-button.calendarInfoBox {
- display: none;
- visibility: visible;
- width: auto;
- height: auto;
- block-progression: rl;
-
-}
-
-text#calendarInfoText { /* ai_gene_pane_1_t1 */
- display: block;
- visibility: visible;
- position: static;
- height: adaptive;
- width: auto;
- padding-left: 5px;
- padding-right: 5px;
- margin-top: auto;
- margin-bottom: auto;
- font-family: EAknLogicalFontSecondaryFont;
- font-size: 23px;
- _s60-text-valign: top;
- color: "SKIN(268458534 13056 74)";
- max-line-amount: 2;
- text-overflow-mode: wrap;
-}
-
-image#calendarInfoIcon
-{
- margin-top: auto;
- margin-bottom: auto;
-}
\ No newline at end of file
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/xuikon/00/organizer.dat Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<data>
- <AppUid>E029CF57</AppUid>
- <Provideruid>101FB657</Provideruid>
- <ThemeUid>110012D9</ThemeUid>
- <ThemeFullName>Organizer</ThemeFullName>
- <ThemeShortName>orga</ThemeShortName>
- <ThemeVersion>1.0</ThemeVersion>
- <FileXML>organizer.xml</FileXML>
- <FileCSS>organizer.css</FileCSS>
- <FileDTD>organizer.dtd</FileDTD>
-</data>
\ No newline at end of file
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/xuikon/00/organizer.dtd Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-============================================================================
-<FileName: "organizerconfiguration.dtd">
-<PartOf : "organizerconfiguration">
-
-<FileDescription: "Localization strings for the configuration">
-<FileVersion : >
-
-<Copyright:
-"Copyright © 2007 Nokia Corporation.
-This material, including documentation and any related
-computer programs, is protected by copyright controlled by
-Nokia Corporation. All rights are reserved. Copying,
-including reproducing, storing, adapting or translating, any
-or all of this material requires the prior written consent of
-Nokia Corporation. This material also contains confidential
-information which may not be disclosed to others without the
-prior written consent of Nokia Corporation.">
-============================================================================
--->
-
-
-<!--
-qtn_ai_cale_no_eve_positive_short.attributes
-qtn_ai_cale_no_eve_positive_short.layout "ai2_gene_pane_t1/opt1"
-qtn_ai_cale_no_eve_positive_short.release "TB9.2"
-qtn_ai_cale_no_eve_positive_short.description "Indicates that there are no upcoming events in calendar."
-qtn_ai_cale_no_eve_positive_short.parents "ai2_gene_pane_t1"
--->
-<!ENTITY qtn_ai_cale_no_eve_positive_short "No calendar events within next 7 days">
-
-<!--
-qtn_ai_cale_no_more_ev_positive_short.attributes
-qtn_ai_cale_no_more_ev_positive_short.layout "ai2_gene_pane_t1/opt1"
-qtn_ai_cale_no_more_ev_positive_short.release "TB9.2"
-qtn_ai_cale_no_more_ev_positive_short.description "Indicates that there are no more upcoming events in calendar."
-qtn_ai_cale_no_more_ev_positive_short.parents "ai2_gene_pane_t1"
--->
-<!ENTITY qtn_ai_cale_no_more_ev_positive_short "No more calendar events within next 7 days">
-
-<!--
-qtn_hs_cale_next_tomorrow.attributes
-qtn_hs_cale_next_tomorrow.layout "ai2_gene_pane_t1/opt1"
-qtn_hs_cale_next_tomorrow.release "TB9.2"
-qtn_hs_cale_next_tomorrow.description "Indicates that next calendar event is tomorrow"
-qtn_hs_cale_next_tomorrow.parents "ai2_gene_pane_t1"
--->
-<!ENTITY qtn_hs_cale_next_tomorrow "Next event tomorrow">
-
-
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/xuikon/00/organizer.xml Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,171 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE xmluiml SYSTEM "organizer.dtd">
-<xmluiml xmlns="http://www.series60.com/xml/xmluiml/1" version="1.0">
-
- <!--######################################
- #### Organizer plugin ####
- ######################################-->
- <widget id="calendarPluginContainer" focusable="true" _s60-initial-focus="1">
-
- <!-- UI resources for Organizer -->
- <desc id="Organizer/NoEventsForToday">&qtn_ai_cale_no_eve_positive_short;</desc>
- <desc id="Organizer/NoMoreEventsForToday">&qtn_ai_cale_no_more_ev_positive_short;</desc>
- <desc id="Organizer/IconAnniv" path="SKIN(268458241 2)"/>
- <desc id="Organizer/IconAppt" path="SKIN(268458241 4)"/>
- <desc id="Organizer/IconMemo" path="SKIN(268458241 6)"/>
- <desc id="Organizer/IconTodo" path="SKIN(270501603 5126)"/>
- <desc id="Organizer/IconMeetAccepted" path="SKIN(270501603 5508)"/>
- <desc id="Organizer/IconMeetNotAnswered" path="SKIN(270501603 5511)"/>
- <desc id="Organizer/IconMeetTentative" path="SKIN(270501603 5514)"/>
-
- <contentsource name="Organizer" value="0x102750FE"/>
-
- <!-- #################################
- ## Organizer plug-in settings ##
- ################################# -->
-
- <!-- Item count and size settings -->
- <!-- Total line count -->
- <property class="Settings/Organizer" name="0x01" value="3"/>
-
- <!-- Timed item line count -->
- <property class="Settings/Organizer" name="0x02" value="1"/>
-
- <!-- Non Timed item line count -->
- <property class="Settings/Organizer" name="0x03" value="1"/>
-
- <!-- Line count reserved for non timed items -->
- <property class="Settings/Organizer" name="0x04" value="0"/>
-
- <!-- Publish end time for upcoming timed items -->
- <property class="Settings/Organizer" name="0x05" value="1"/>
-
- <!-- Use alternate publishing for upcoming and ongoing items -->
- <property class="Settings/Organizer" name="0x06" value="0"/>
-
- <!-- Open event to viewer 0 / editor 1 -->
- <property class="Settings/Organizer" name="0x07" value="0"/>
-
- <!-- Days to handle as not today. After which "Next event on DAY DATE" is displayed.
- Here one means tomorrow only. So we display detailed info for not today events for
- tomorrow only. -->
- <property class="Settings/Organizer" name="0x08" value="0"/>
-
- <!-- Open first valid event on launch event index 0 -->
- <property class="Settings/Organizer" name="0x09" value="1"/>
-
- <!-- Publish info text (no more events...) using InfoText and InfoIcon ids -->
- <property class="Settings/Organizer" name="0x0A" value="1"/>
-
-
- <actions>
- <action>
-
- <trigger name="activate"/>
-
- <event name="Organizer/ItemSelected(0)"/>
- </action>
- </actions>
- <!-- #1 -->
- <button id="calendarEntryBox1" class="calendarEntryBox" >
- <image id="calendarEntryIcon1" class="calendarEntryIcon" >
- <property class="Organizer/EventIcon" name="ordinal" value="0x01"/>
- <property class="policy/emptyContent" name="calendarEntryBox1" value="display: none;"/>
- <property class="policy/Content" name="calendarEntryBox1" value="display: block;"/>
- <!-- hide the infobox when we have some events to show -->
- <property class="policy/Content" name="calendarInfoTextBox" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoText" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoIcon" value="display: none;"/>
- </image>
- <text id="calendarEntryText1_1" class="calendarEntryText1" >
- <property class="Organizer/StartTimeAndSubject" name="ordinal" value="0x01"/>
- <!-- If there is no text, the entry box is not shown at all -->
- <property class="policy/Content" name="calendarEntryText1_1" value="display: block;"/>
- <property class="policy/emptyContent" name="calendarEntryText1_1" value="display: none;"/>
- <!-- hide the infobox when we have some events to show -->
- <property class="policy/Content" name="calendarInfoTextBox" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoText" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoIcon" value="display: none;"/>
-
- </text>
- </button>
-
- <!-- #2 -->
- <button id="calendarEntryBox2" class="calendarEntryBox" >
- <image id="calendarEntryIcon2" class="calendarEntryIcon" >
- <property class="Organizer/EventIcon" name="ordinal" value="0x02"/>
- <property class="policy/emptyContent" name="calendarEntryBox2" value="display: none;"/>
- <property class="policy/Content" name="calendarEntryBox2" value="display: block;"/>
- <!-- hide the infobox when we have some events to show -->
- <property class="policy/Content" name="calendarInfoTextBox" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoText" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoIcon" value="display: none;"/>
-
- </image>
- <text id="calendarEntryText2_1" class="calendarEntryText1" >
- <property class="Organizer/StartTimeAndSubject" name="ordinal" value="0x02"/>
- <!-- If there is no text, the entry box is not shown at all -->
- <property class="policy/Content" name="calendarEntryText2_1" value="display: block;"/>
- <property class="policy/emptyContent" name="calendarEntryText2_1" value="display: none;"/>
- <!-- hide the infobox when we have some events to show -->
- <property class="policy/Content" name="calendarInfoTextBox" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoText" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoIcon" value="display: none;"/>
-
-
- </text>
- </button>
-
- <!-- #3 -->
- <button id="calendarEntryBox3" class="calendarEntryBox" >
- <image id="calendarEntryIcon3" class="calendarEntryIcon" >
- <property class="Organizer/EventIcon" name="ordinal" value="0x03"/>
- <property class="policy/emptyContent" name="calendarEntryBox3" value="display: none;"/>
- <property class="policy/Content" name="calendarEntryBox3" value="display: block;"/>
- <!-- hide the infobox when we have some events to show -->
- <property class="policy/Content" name="calendarInfoTextBox" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoText" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoIcon" value="display: none;"/>
-
- </image>
- <text id="calendarEntryText3_1" class="calendarEntryText1" >
- <property class="Organizer/StartTimeAndSubject" name="ordinal" value="0x03"/>
- <!-- If there is no text, the entry box is not shown at all -->
- <property class="policy/Content" name="calendarEntryText3_1" value="display: block;"/>
- <property class="policy/emptyContent" name="calendarEntryText3_1" value="display: none;"/>
- <!-- hide the infobox when we have some events to show -->
- <property class="policy/Content" name="calendarInfoTextBox" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoText" value="display: none;"/>
- <property class="policy/Content" name="calendarInfoIcon" value="display: none;"/>
-
- </text>
- </button>
-
- <!-- Info text. Hidden by default, shown in case info text is shown. Then
- other buttons are hidden -->
- <button id="calendarInfoTextBox" class="calendarInfoBox" >
- <image id="calendarInfoIcon" class="calendarEntryIcon" >
- <property class="Organizer/InfoIcon"/>
- <!-- hide the above buttons and show just this info button -->
- <property class="policy/Content" name="calendarEntryBox1" value="display: none;"/>
- <property class="policy/Content" name="calendarEntryBox2" value="display: none;"/>
- <property class="policy/Content" name="calendarEntryBox3" value="display: none;"/>
-
- <property class="policy/Content" name="calendarInfoIcon" value="display: block;"/>
- <property class="policy/Content" name="calendarInfoTextBox" value="display: block;"/>
-
- <property class="policy/emptyContent" name="calendarInfoIcon" value="display: none;"/>
- </image>
- <text id="calendarInfoText" >
- <property class="Organizer/InfoText"/>
- <!-- hide the above buttons and show just this info button -->
- <property class="policy/Content" name="calendarEntryBox1" value="display: none;"/>
- <property class="policy/Content" name="calendarEntryBox2" value="display: none;"/>
- <property class="policy/Content" name="calendarEntryBox3" value="display: none;"/>
-
- <property class="policy/Content" name="calendarInfoText" value="display: block;"/>
- <property class="policy/Content" name="calendarInfoTextBox" value="display: block;"/>
- </text>
- </button>
- </widget> <!-- end calendarPluginContainer box -->
-</xmluiml>
\ No newline at end of file
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/xuikon/37/organizer.css Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-widget#calendarPluginContainer {
- display: block;
- width: auto;
- height: auto;
- padding-left: 10px;
- padding-right: 10px;
- padding-top: 2%;
- padding-bottom: 2%;
- nav-index: appearance;
- block-progression: tb;
-}
-
-button.calendarEntryBox {
- display: none;
- visibility: visible;
- width: auto;
- height: 31%;
- margin-top: auto;
- margin-bottom: auto;
- block-progression: rl;
- direction: rtl;
-}
-
-image.calendarEntryIcon { /* ai_gene_pane_1_g1 */
- display: block;
- visibility: visible;
- width: 24px;
- height: 24px;
-}
-
-text.calendarEntryText1 { /* ai_gene_pane_1_t1 */
- display: block;
- visibility: visible;
- position: static;
- height: auto;
- width: auto;
- padding-left: 6px;
- padding-right: 5px;
- font-family: EAknLogicalFontSecondaryFont;
- font-size: 23px;
- _s60-text-valign: top;
- color: "SKIN(268458534 13056 74)";
- text-align: right;
- direction: ltr;
-}
-
-button.calendarInfoBox {
- display: none;
- visibility: visible;
- width: auto;
- height: auto;
- block-progression: rl;
- direction: rtl;
-}
-
-text#calendarInfoText { /* ai_gene_pane_1_t1 */
- display: block;
- visibility: visible;
- position: static;
- height: adaptive;
- width: auto;
- padding-right: 5px;
- padding-left: 5px;
- margin-top: auto;
- margin-bottom: auto;
- font-family: EAknLogicalFontSecondaryFont;
- font-size: 23px;
- _s60-text-valign: top;
- color: "SKIN(268458534 13056 74)";
- max-line-amount: 2;
- text-overflow-mode: wrap;
- direction: lr;
- text-align: right;
-}
-
-image#calendarInfoIcon
-{
- margin-top: auto;
- margin-bottom: auto;
-}
\ No newline at end of file
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/xuikon/50/organizer.css Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-widget#calendarPluginContainer {
- display: block;
- width: auto;
- height: auto;
- padding-left: 10px;
- padding-right: 10px;
- padding-top: 2%;
- padding-bottom: 2%;
- nav-index: appearance;
- block-progression: tb;
-}
-
-button.calendarEntryBox {
- display: none;
- visibility: visible;
- width: auto;
- height: 31%;
- margin-top: auto;
- margin-bottom: auto;
- block-progression: rl;
- direction: rtl;
-}
-
-image.calendarEntryIcon { /* ai_gene_pane_1_g1 */
- display: block;
- visibility: visible;
- width: 24px;
- height: 24px;
-}
-
-text.calendarEntryText1 { /* ai_gene_pane_1_t1 */
- display: block;
- visibility: visible;
- position: static;
- height: auto;
- width: auto;
- padding-left: 6px;
- padding-right: 5px;
- font-family: EAknLogicalFontSecondaryFont;
- font-size: 23px;
- _s60-text-valign: top;
- color: "SKIN(268458534 13056 74)";
- text-align: right;
- direction: ltr;
-}
-
-button.calendarInfoBox {
- display: none;
- visibility: visible;
- width: auto;
- height: auto;
- block-progression: rl;
- direction: rtl;
-}
-
-text#calendarInfoText { /* ai_gene_pane_1_t1 */
- display: block;
- visibility: visible;
- position: static;
- height: adaptive;
- width: auto;
- padding-right: 5px;
- padding-left: 5px;
- margin-top: auto;
- margin-bottom: auto;
- font-family: EAknLogicalFontSecondaryFont;
- font-size: 23px;
- _s60-text-valign: top;
- color: "SKIN(268458534 13056 74)";
- max-line-amount: 2;
- text-overflow-mode: wrap;
- direction: lr;
- text-align: right;
-}
-
-image#calendarInfoIcon
-{
- margin-top: auto;
- margin-bottom: auto;
-}
\ No newline at end of file
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/xuikon/57/organizer.css Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-widget#calendarPluginContainer {
- display: block;
- width: auto;
- height: auto;
- padding-left: 10px;
- padding-right: 10px;
- padding-top: 2%;
- padding-bottom: 2%;
- nav-index: appearance;
- block-progression: tb;
-}
-
-button.calendarEntryBox {
- display: none;
- visibility: visible;
- width: auto;
- height: 31%;
- margin-top: auto;
- margin-bottom: auto;
- block-progression: rl;
- direction: rtl;
-}
-
-image.calendarEntryIcon { /* ai_gene_pane_1_g1 */
- display: block;
- visibility: visible;
- width: 24px;
- height: 24px;
-}
-
-text.calendarEntryText1 { /* ai_gene_pane_1_t1 */
- display: block;
- visibility: visible;
- position: static;
- height: auto;
- width: auto;
- padding-left: 6px;
- padding-right: 5px;
- font-family: EAknLogicalFontSecondaryFont;
- font-size: 23px;
- _s60-text-valign: top;
- color: "SKIN(268458534 13056 74)";
- text-align: right;
- direction: ltr;
-}
-
-button.calendarInfoBox {
- display: none;
- visibility: visible;
- width: auto;
- height: auto;
- block-progression: rl;
- direction: rtl;
-}
-
-text#calendarInfoText { /* ai_gene_pane_1_t1 */
- display: block;
- visibility: visible;
- position: static;
- height: adaptive;
- width: auto;
- padding-right: 5px;
- padding-left: 5px;
- margin-top: auto;
- margin-bottom: auto;
- font-family: EAknLogicalFontSecondaryFont;
- font-size: 23px;
- _s60-text-valign: top;
- color: "SKIN(268458534 13056 74)";
- max-line-amount: 2;
- text-overflow-mode: wrap;
- direction: lr;
- text-align: right;
-}
-
-image#calendarInfoIcon
-{
- margin-top: auto;
- margin-bottom: auto;
-}
\ No newline at end of file
--- a/calendarui/organizerplugin/data/vga_tch/organizer_2001f48d/xuikon/94/organizer.css Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,80 +0,0 @@
-widget#calendarPluginContainer {
- display: block;
- width: auto;
- height: auto;
- padding-left: 10px;
- padding-right: 10px;
- padding-top: 2%;
- padding-bottom: 2%;
- nav-index: appearance;
- block-progression: tb;
-}
-
-button.calendarEntryBox {
- display: none;
- visibility: visible;
- width: auto;
- height: 31%;
- margin-top: auto;
- margin-bottom: auto;
- block-progression: rl;
- direction: rtl;
-}
-
-image.calendarEntryIcon { /* ai_gene_pane_1_g1 */
- display: block;
- visibility: visible;
- width: 24px;
- height: 24px;
-}
-
-text.calendarEntryText1 { /* ai_gene_pane_1_t1 */
- display: block;
- visibility: visible;
- position: static;
- height: auto;
- width: auto;
- padding-left: 6px;
- padding-right: 5px;
- font-family: EAknLogicalFontSecondaryFont;
- font-size: 23px;
- _s60-text-valign: top;
- color: "SKIN(268458534 13056 74)";
- text-align: right;
- direction: ltr;
-}
-
-button.calendarInfoBox {
- display: none;
- visibility: visible;
- width: auto;
- height: auto;
- block-progression: rl;
- direction: rtl;
-}
-
-text#calendarInfoText { /* ai_gene_pane_1_t1 */
- display: block;
- visibility: visible;
- position: static;
- height: adaptive;
- width: auto;
- padding-right: 5px;
- padding-left: 5px;
- margin-top: auto;
- margin-bottom: auto;
- font-family: EAknLogicalFontSecondaryFont;
- font-size: 23px;
- _s60-text-valign: top;
- color: "SKIN(268458534 13056 74)";
- max-line-amount: 2;
- text-overflow-mode: wrap;
- direction: lr;
- text-align: right;
-}
-
-image#calendarInfoIcon
-{
- margin-top: auto;
- margin-bottom: auto;
-}
\ No newline at end of file
Binary file calendarui/regionalplugins/KoreanLunar/conf/KoreanLunar.confml has changed
Binary file calendarui/regionalplugins/KoreanLunar/conf/KoreanLunar_2001843E.crml has changed
--- a/calendarui/regionalplugins/KoreanLunar/data/CalenKoreanLunarPlugin.rss Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +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:
-*
-*/
-#include <CalenRegionalPluginUids.h>
-#include "CalenLunarPluginUids.hrh"
-
-#include <ecom/registryinfo.rh>
-#include <calenkoreanlunar.loc>
-
-RESOURCE REGISTRY_INFO registry_info
- {
- dll_uid = CALENKOREANLUNARPLUGIN_DLL_UID;
- interfaces =
- {
- INTERFACE_INFO
- {
- interface_uid = CALENUIPLUGININTERFACE_ECOM_INTERFACE_UID;
- implementations =
- {
- IMPLEMENTATION_INFO
- {
- implementation_uid = CALENKOREANLUNARPLUGIN_IMPLEMENTATION_UID;
- version_no = 1;
- display_name = qtn_kor_cale_lunar_calendar;
- // Supported languages can be inserted as follows:
- // "language(1)||language(14)||language(151)
- // Numbers can be Symbian language codes (TLanguage)
- // or S60 extensions (151,161...) to them
- //
- // Plugin is loaded only when current phone language
- // is one of the listed languages.
- //
- // If plugin should be loaded for all languages, then
- // language(*) can be defined,
- // 65 Korean
- // 1 English
- default_data = "language(65)||language(1)";
- opaque_data = "";
- }
- };
- }
- };
- }
-// End of file
--- a/calendarui/regionalplugins/KoreanLunar/data/CalenKoreanLunarPluginData.rss Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,297 +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:
-*
-*/
-
-#include <calenkoreanlunar.loc>
-
-#include <calendar.loc>
-#include <calendar.rsg>
-#include <eikon.rh>
-#include <avkon.hrh>
-#include <avkon.rh>
-#include <avkon.rsg>
-
-NAME KLU1
-RESOURCE RSS_SIGNATURE { }
-
-// ---------------------------------------------------------
-// ---------------------------------------------------------
-// one version exits in calendar.rsg
-RESOURCE TBUF R_CALEN_LUNAR_SETTING_TITLE2
- {
- buf = qtn_kor_cale_sett_lunar_cale;
- }
-
-// ---------------------------------------------------------
-// ---------------------------------------------------------
-//
-RESOURCE AVKON_SETTING_PAGE r_calen_lunar_setting_page
- {
- label = qtn_kor_cale_sett_lunar_cale;
- softkey_resource = R_AVKON_SOFTKEYS_OK_CANCEL;
- type = EAknCtPopupSettingList;
- editor_resource_id = R_CALEN_SETTING_LISTBOX;
- }
-
-// ---------------------------------------------------------
-// ---------------------------------------------------------
-//
-RESOURCE ARRAY r_calen_lunar_setting_choicelist
- {
- items =
- {
- LBUF
- {
- txt = qtn_kor_cale_lunar_cale_off;
- },
- LBUF
- {
- txt = qtn_kor_cale_lunar_cale_on;
- }
- };
- }
-
-//----------------------------------------------------
-//----------------------------------------------------
-//
-RESOURCE ARRAY r_calen_lunar_setting_array
- {
- items =
- {
- AVKON_ENUMERATED_TEXT
- {
- value = 0;
- text = qtn_kor_cale_lunar_cale_off;
- },
- AVKON_ENUMERATED_TEXT
- {
- value = 1;
- text = qtn_kor_cale_lunar_cale_on;
- }
- };
- }
-
-//----------------------------------------------------
-//----------------------------------------------------
-//
-RESOURCE AVKON_POPUP_SETTING_TEXTS r_calen_lunar_setting_texts
- {
- setting_texts_resource = r_calen_lunar_setting_array;
- popped_up_texts_resource = r_calen_lunar_setting_choicelist;
- }
-
-
-//----------------------------------------------------
-//----------------------------------------------------
-//
-RESOURCE DIALOG r_calen_lunar_details_dialog
- {
- flags = EGeneralQueryFlags;
- buttons = R_AVKON_SOFTKEYS_OK_EMPTY;
- items =
- {
- DLG_LINE
- {
- type = EAknCtPopupHeadingPane;
- id = EAknMessageQueryHeaderId;
- control = AVKON_HEADING
- {
- label = qtn_kor_cale_lunar_calendar;
- headinglayout = R_AVKON_LIST_HEADING_PANE;
- };
- },
- DLG_LINE
- {
- type = EAknCtMessageQuery;
- id = EAknMessageQueryContentId;
- control = AVKON_MESSAGE_QUERY
- {
- };
- }
- };
- }
-
-
-//----------------------------------------------------
-// Menu item text "Show lunar details"
-//----------------------------------------------------
-//
-RESOURCE TBUF r_calendar_show_lunar_data
- {
- buf = qtn_kor_cale_lunar_data;
- }
-
-
-//----------------------------------------------------
-// Details dialog item headers
-//----------------------------------------------------
-//
-RESOURCE TBUF r_calendar_lunar_info_festival
- {
- buf = qtn_cale_lunar_info_festival;
- }
-
-RESOURCE TBUF r_calendar_lunar_info_solar
- {
- buf = qtn_cale_lunar_info_solar;
- }
-
-RESOURCE TBUF r_calendar_lunar_info_date
- {
- buf = qtn_cale_info_lunar_date;
- }
-
-RESOURCE TBUF r_calendar_lunar_info_western_date
- {
- buf = qtn_cale_info_western_date;
- }
-
-RESOURCE TBUF r_kor_cale_extra_row_lunar
- {
- buf = qtn_kor_cale_extra_row_lunar;
- }
-
-RESOURCE TBUF r_cale_lunar_separator
- {
- buf = qtn_cale_lunar_separator;
- }
-
-RESOURCE TBUF r_cale_lunar_full_date
- {
- buf = qtn_cale_lunar_full_date;
- }
-
-RESOURCE TBUF r_cale_lunar_date
- {
- buf = qtn_cale_lunar_date;
- }
-
-RESOURCE TBUF r_cale_lunar_leap_date
- {
- buf = qtn_cale_lunar_leap_date;
- }
-
-RESOURCE TBUF r_cale_lunar_year
- {
- buf = qtn_cale_lunar_year;
- }
-
-//test
-RESOURCE TBUF r_cale_kor_lunar_date
- {
- buf = qtn_cale_kor_lunar_date;
- }
-
-RESOURCE TBUF r_cale_kor_lunar_indicator
- {
- buf = qtn_lunar_indicator;
- }
-
-RESOURCE TBUF r_cale_kor_leap_year_indicator
- {
- buf = qtn_lunar_leap_year_indicator;
- }
-
-// ---------------------------------------------------------
-//
-// r_calen_kor_festivals
-// Descriptor array for Korean festivals
-//
-// ---------------------------------------------------------
-//
-RESOURCE ARRAY r_calen_kor_festivals
- {
- items =
- {
- LBUF { txt = qtn_kor_cale_festival_name_1; },
- LBUF { txt = qtn_kor_cale_festival_name_2; },
- LBUF { txt = qtn_kor_cale_festival_name_3; },
- LBUF { txt = qtn_kor_cale_festival_name_4; },
- LBUF { txt = qtn_kor_cale_festival_name_5; },
- LBUF { txt = qtn_kor_cale_festival_name_6; },
- LBUF { txt = qtn_kor_cale_festival_name_7; },
- LBUF { txt = qtn_kor_cale_festival_name_8; },
- LBUF { txt = qtn_kor_cale_festival_name_9; },
- LBUF { txt = qtn_kor_cale_festival_name_10; },
- LBUF { txt = qtn_kor_cale_festival_name_11; }
- };
- }
-
-// ---------------------------------------------------------
-//
-// r_calen_kor_solar_items
-// Descriptor array for Korean solar items
-//
-// ---------------------------------------------------------
-//
-RESOURCE ARRAY r_calen_kor_solar_items
- {
- items =
- {
- LBUF { txt = qtn_kor_cale_solar_item_1; },
- LBUF { txt = qtn_kor_cale_solar_item_2; },
- LBUF { txt = qtn_kor_cale_solar_item_3; },
- LBUF { txt = qtn_kor_cale_solar_item_4; },
- LBUF { txt = qtn_kor_cale_solar_item_5; },
- LBUF { txt = qtn_kor_cale_solar_item_6; },
- LBUF { txt = qtn_kor_cale_solar_item_7; },
- LBUF { txt = qtn_kor_cale_solar_item_8; },
- LBUF { txt = qtn_kor_cale_solar_item_9; },
- LBUF { txt = qtn_kor_cale_solar_item_10; },
- LBUF { txt = qtn_kor_cale_solar_item_11; },
- LBUF { txt = qtn_kor_cale_solar_item_12; },
- LBUF { txt = qtn_kor_cale_solar_item_13; },
- LBUF { txt = qtn_kor_cale_solar_item_14; },
- LBUF { txt = qtn_kor_cale_solar_item_15; },
- LBUF { txt = qtn_kor_cale_solar_item_16; },
- LBUF { txt = qtn_kor_cale_solar_item_17; },
- LBUF { txt = qtn_kor_cale_solar_item_18; },
- LBUF { txt = qtn_kor_cale_solar_item_19; },
- LBUF { txt = qtn_kor_cale_solar_item_20; },
- LBUF { txt = qtn_kor_cale_solar_item_21; },
- LBUF { txt = qtn_kor_cale_solar_item_22; },
- LBUF { txt = qtn_kor_cale_solar_item_23; },
- LBUF { txt = qtn_kor_cale_solar_item_24; }
- };
- }
-
-// ---------------------------------------------------------
-//
-// r_calen_kor_solar_anniversary_items
-// Descriptor array for Korean solar anniversary items
-//
-// ---------------------------------------------------------
-//
-RESOURCE ARRAY r_calen_kor_solar_anniversary_items
- {
- items =
- {
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_1; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_2; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_3; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_4; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_5; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_6; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_7; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_8; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_9; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_10; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_11; },
- LBUF { txt = qtn_kor_cale_solar_anniversary_item_12; }
- };
- }
-
-
Binary file calendarui/regionalplugins/KoreanLunar/data/KoreanSolarItems has changed
--- a/calendarui/regionalplugins/KoreanLunar/group/CalenKoreanLunarPlugin.mmp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,90 +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:
-*
-*/
-#include <platform_paths.hrh>
-#include "..\inc\CalenLunarPluginUids.hrh"
-
-#include <data_caging_paths.hrh>
-
-// Target
-TARGET CalenKoreanLunarPlugin.dll
-TARGETTYPE PLUGIN
-UID SYMBIAN_ECOM_PLUGIN_UID CALENKOREANLUNARPLUGIN_DLL_UID
-
-// Includes
-USERINCLUDE ..\inc
-USERINCLUDE ..\..\..\cenrep
-
-//SYSTEMINCLUDE ..\..\interface
-SYSTEMINCLUDE ..\..\..\inc
-SYSTEMINCLUDE ..\..\calenregionalutil\inc
-
-APP_LAYER_SYSTEMINCLUDE
-
-SYSTEMINCLUDE \epoc32\include\ecom
-
-// Resources
-SOURCEPATH ..\data
-// Ecom Resource
-RESOURCE CalenKoreanLunarPlugin.rss
-// Normal resource
-START RESOURCE CalenKoreanLunarPluginData.rss
-HEADER
-TARGETPATH RESOURCE_FILES_DIR
-LANGUAGE_IDS
-END
-
-
-// Sources
-
-SOURCEPATH ..\src
-SOURCE CalenLunarPluginProxy.cpp
-SOURCE CalenKoreanLunarPlugin.cpp
-SOURCE CalenLunarSettingItem.cpp
-SOURCE CalenLunarInfo.cpp
-SOURCE CalenLunarInfoProvider.cpp
-SOURCE CalenSolarTerms.cpp
-SOURCE CalenLunarLocalizedInfo.cpp
-SOURCE CalenLunarLocalizer.cpp
-SOURCE CalenExtraRowFormatter.cpp
-
-
-// Libraries
-LIBRARY bafl.lib
-LIBRARY ccon.lib
-LIBRARY ecom.lib
-LIBRARY efsrv.lib
-LIBRARY estor.lib
-LIBRARY euser.lib
-LIBRARY calencommonutils.lib
-LIBRARY aknskins.lib
-
-// Libraries for view extension
-LIBRARY avkon.lib
-LIBRARY cone.lib
-LIBRARY gdi.lib
-LIBRARY eikcoctl.lib
-
-// Libraries for setting extension
-LIBRARY commonengine.lib
-LIBRARY centralrepository.lib
-
-LIBRARY calinterimapi.lib
-
-
-// Misc
-CAPABILITY CAP_ECOM_PLUGIN
-VENDORID VID_DEFAULT
--- a/calendarui/regionalplugins/KoreanLunar/group/bld.inf Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-/*
-* Copyright (c) 2006 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:
-*
-*/
-
-#include <platform_paths.hrh>
-
-PRJ_PLATFORMS
-DEFAULT
-
-PRJ_EXPORTS
-// ARMV5
-../loc/calenkoreanlunar.loc APP_LAYER_LOC_EXPORT_PATH(calenkoreanlunar.loc)
-../data/KoreanSolarItems /epoc32/data/z/private/10005901/KoreanSolarItems
-// WINSCW
-../data/KoreanSolarItems /epoc32/release/winscw/udeb/z/private/10005901/KoreanSolarItems
-../data/KoreanSolarItems /epoc32/release/winscw/urel/z/private/10005901/KoreanSolarItems
-
-../rom/KoreanCalPlugin.iby /epoc32/rom/include/customer/app/KoreanCalPlugin.iby
-
-../conf/KoreanLunar.confml APP_LAYER_CONFML(KoreanLunar.confml)
-../conf/KoreanLunar_2001843E.crml APP_LAYER_CRML(KoreanLunar_2001843E.crml)
-
-PRJ_MMPFILES
-CalenKoreanLunarPlugin.mmp
-
-// End of File
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenExtraRowFormatter.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,74 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-#ifndef __CALENEXTRAROWFORMATTER_H__
-#define __CALENEXTRAROWFORMATTER_H__
-
-// INCLUDES
-#include <e32base.h>
-
-#include "CalenLunarLocalizedInfo.h"
-#include "CalendarVariant.hrh"
-
-// FORWARD DECLARATION
-class CFont;
-
-/**
-* Class declaration for Extra row formatter
-*/
-class CCalenExtraRowFormatter : public CBase
- {
-public: // public API
- /**
- * Two phased constructor.
- */
- static CCalenExtraRowFormatter* NewL();
- /**
- * destructor
- */
- virtual ~CCalenExtraRowFormatter();
- /**
- * Formats lunar based information
- */
- TPtrC FormatExtraRowInformationL( CCalenLunarLocalizedInfo& aLocInfo,
- RArray<CCalenLunarLocalizedInfo::TField>& aPrioritizedFields,
- TInt aMaxWidth,
- const CFont& aFont
-#ifdef RD_CALENDAR_PREVIEW
- , TBool aTwoLines
-#endif // RD_CALENDAR_PREVIEW
- );
-
-private:
- TBool TryToFitL( const TDesC& aStr, TInt aMaxWidth, const CFont& aFont
-#ifdef RD_CALENDAR_PREVIEW
- , TBool aTwoLines
-#endif // RD_CALENDAR_PREVIEW
- );
-
-
-private: // own methods
- CCalenExtraRowFormatter();
-
- void ConstructL();
-
-
-private: // data
- TBuf<500> iText;
- };
-
-#endif // __CALENEXTRAROWFORMATTER_H__
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenKoreanLunarPlugin.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,162 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-#ifndef __CALENKOREANLUNARPLUGIN_H__
-#define __CALENKOREANLUNARPLUGIN_H__
-
-// INCLUDES
-#include <e32base.h>
-#include <coneresloader.h>
-#include <calencommandhandler.h>
-#include <calennotificationhandler.h>
-#include <calenservices.h>
-#include <calencustomisation.h>
-#include <eiklabel.h>
-#include <KoreanCalConv.h>
-
-// FORWARD DECLARATION
-class CCalenLunarInfoProvider;
-class CCalenLunarLocalizer;
-class CCalenExtraRowFormatter;
-class CCalenLunarLocalizedInfo;
-class CFont;
-
-/**
-* Class declaration for Korean lunar plugin
-*/
-class CCalenKoreanLunarPlugin : public CCalenCustomisation,
- public MCalenCommandHandler,
- public MCalenNotificationHandler
- {
-public: // public API
- static CCalenKoreanLunarPlugin* CreateKoreanPluginL( MCalenServices* aServices );
-
- virtual ~CCalenKoreanLunarPlugin();
-
-public: // Plugins internal Public API
-
- TBool LoadEnabledStatusL();
- void StoreEnabledStatusL( TBool aEnabled );
-
-protected://From CCalenCustomisation
-
- void GetCustomViewsL( RPointerArray<CCalenView>& aCustomViewArray );
- void GetCustomSettingsL( RPointerArray<CAknSettingItem>& aCustomSettingArray );
- CCoeControl* InfobarL( const TRect& aRect );
- const TDesC& InfobarL();
- CCoeControl* PreviewPaneL( TRect& aRect );
- MCalenCommandHandler* CommandHandlerL( TInt aCommand );
- void RemoveViewsFromCycle( RArray<TInt>& aViews );
- TBool CustomiseMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
- TBool CanBeEnabledDisabled();
- TAny* CalenCustomisationExtensionL( TUid aExtensionUid );
-
- /**
- * Gets the preview pane from the plugin to be shown at the
- * calendar view. Offers the rectangle for the preview pane,
- * which it can be used to draw the pane.
- *
- * @param aRect The area available for the Preview Pane
- * @return Preview pane interface
- */
- virtual MCalenPreview* CustomPreviewPaneL( TRect& aRect );
-
- // korean support to conversion as getting new api seems too difficult
- public:
- virtual void DateTimeToKoreanL( const TDateTime& aDateTime, TKoreanDate& aKoreanDate );
-
- /* Method converting korean lunar date to gregorian date,
- supported range is 1.1.1900 - 31.12.2099
- Leaves with KErrArgument if date is uncovertible.
- */
- virtual void KoreanToDateTimeL( TKoreanDate& aKoreanDate, TDateTime& aDateTime );
-
- /* Method getting supported gregorian date range
- */
- virtual void DateRange( TDateTime& aLower, TDateTime& aUpper );
-
- /* Method getting supported korean lunar date range
- */
- virtual void DateRange( TKoreanDate& aLower, TKoreanDate& aUpper );
-
-protected:// From MCalenCommandHandler
- TBool HandleCommandL( const TCalenCommand& aCommand );
- TAny* CalenCommandHandlerExtensionL( TUid aExtensionUid );
-
-protected://From MCalenNotificationHandler
- void HandleNotification( const TCalenNotification aNotification );
-
-private: // own methods
- CCalenKoreanLunarPlugin(TUint32 aCenRepLunarEnabledId, MCalenServices* aServices);
-
- void ConstructL();
- void SetLunarLocalizerL();
- void ShowDetailsL();
- TInt GetColor();
-
- void FormatExtraRowStringL( CEikLabel& aLabel );
- TPtrC GetExtraRowTextL( CCalenLunarLocalizedInfo& aLocInfo, TInt aMaxWidth, const CFont& aFont );
- void UpdateInfoBarL();
-
-private: // data
- /**
- * Tells, if lunar functionality is currently enabled by user.
- * If not, only setting item is provided by plugin
- */
- TBool iLunarEnabled;
-
- /**
- * Language independent provider of lunar calendar information
- */
- CCalenLunarInfoProvider* iInfoProvider;
-
- /**
- * Language specific localizer of lunar calendar information
- */
- CCalenLunarLocalizer* iLocalizer;
-
- /**
- * Localized lunar info for currently focused day
- */
- CCalenLunarLocalizedInfo* iLocInfo;
-
- /**
- * Currently displayed text for extra row
- */
- TPtrC iExtraRowText;
-
- RConeResourceLoader iResourceLoader;
-
- // Central repository Id for enabled setting
- // We have different setting for Chinese and Vietnamese
- // in case that in future they would be in same image
- TUint32 iCenRepLunarEnabledId;
- CEikLabel* iLabel;
- MCalenServices* iServices;
- TInt iStart;
- TInt iEnd;
-
- CKoreanCalConv* iConverter;
-
- // Infobar rect
- TRect iRect;
-
- // Skin color
- TRgb iSkinColor;
- };
-
-#endif // __CALENKOREANLUNARPLUGIN_H__
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenKoreanLunarPrivateCRKeys.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-
-#ifndef CALENKOREANLUNARPRIVATECRKEYS_H
-#define CALENKOREANLUNARPRIVATECRKEYS_H
-
-const TUid KCRUidCalenKoreanPlugin = {0x2001843E};
-const TUint32 KCalenKoreanPluginEnabled = 0x00000001;
-
-#endif // CALENKOREANLUNARPRIVATECRKEYS_H
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenLunarInfo.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,92 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-#ifndef __CALENLUNARINFO_H__
-#define __CALENLUNARINFO_H__
-
-// INCLUDES
-#include <e32def.h>
-#include <calendarconverter.h>
-
-/**
-* Class declaration for Lunar info
-*/
-class TCalenLunarInfo
- {
-public:
- enum TLunarFestival
- {
- ENoFestival = KErrNotFound,
- EFestivalNewYearDay,
- EFestivalBuddhaBirthDay,
- EFestivalHarvest,
- EFestivalFullMoonDay,
- EFestival3rdMarchDay,
- EFestivalDano,
- EFestivalUnknown_1,
- EFestival7thJulyDay,
- EFestivalUnknown_2,
- EFestivalUnknown_3,
- EFestival105thDayAfterWS
- };
-
- enum TSolarFestival
- {
- ENoSolarFestival = KErrNotFound,
- ESolarFestivalNewYearDay,
- ESolarFestivalIndependenceMovement,
- ESolarFestivalChildrensDay,
- ESolarFestivalMemorialDay,
- ESolarFestivalConstitutionDay,
- ESolarFestivalLiberationDay,
- ESolarFestivalFoundationDay,
- ESolarFestivalChristmasDay,
- ESolarFestivalHangulDay
- };
-
- typedef TInt TSolarTerm;
-
-public:
- TBool HasLunarFestival();
- TBool HasSolarFestival();
- TBool HasSolarTerm();
-
-public:
- /**
- * Lunar Festival.
- */
- TLunarFestival iLunarFestival;
- /**
- * Lunar Festival.
- */
- TSolarFestival iSolarFestival;
- /**
- * Lunar Festival.
- */
- TSolarTerm iSolarTerm;
- /**
- * Lunar Festival.
- */
- TChineseDate iLunarDate;
- /**
- * Lunar Festival.
- */
- TTime iGregorianDate;
- };
-
-
-#endif // __CALENLUNARINFO_H__
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenLunarInfoProvider.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,52 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-#ifndef __CALENLUNARINFOPROVIDER_H__
-#define __CALENLUNARINFOPROVIDER_H__
-
-// INCLUDES
-#include "CalenLunarInfo.h"
-#include <e32base.h>
-
-// FORWARD DECLARATION
-class CKoreanCalConv;
-class CCalenSolarTerms;
-class RFs;
-
-/**
-* Class declaration for Lunar info provider
-*/
-class CCalenLunarInfoProvider : public CBase
- {
-public: // public API
- static CCalenLunarInfoProvider* NewL(RFs& aFs);
-
- virtual ~CCalenLunarInfoProvider();
-
- TCalenLunarInfo GetLunarInfoL( const TTime& aDay );
-
-private: // own methods
- CCalenLunarInfoProvider();
- void ConstructL(RFs& aFs);
-
-private: // data
- CKoreanCalConv* iConverter;
- CCalenSolarTerms* iSolarTerms;
-
- };
-
-#endif // __CALENLUNARINFOPROVIDER_H__
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenLunarLocalizedInfo.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,78 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-#ifndef __CALENLUNARLOCALIZEDINFO_H__
-#define __CALENLUNARLOCALIZEDINFO_H__
-
-// INCLUDES
-#include <e32base.h>
-
-// FORWARD DECLARATION
-class CCalenLunarLocalizer;
-
-/**
-* Class declaration for Lunar localized info
-*/
-class CCalenLunarLocalizedInfo : public CBase
- {
-public:
- enum TField
- {
- ELunarFestival,
- ESolarFestival,
- ESolarTerm,
- ELunarMonthAndDay,
- EGregorianDate
- };
-
-
-public: // public API
- static CCalenLunarLocalizedInfo* NewL();
-
- virtual ~CCalenLunarLocalizedInfo();
-
- /**
- * Get specific field. This is useful, when you have ordered array of TFields
- * and you want to process them in a loop.
- * If day didn't had e.g. festival or solar term, KNullDesC is returned for those.
- */
- const TDesC& GetField( TField aField );
-
- const TDesC& LunarFestival() { return iLunarFestival; }
- const TDesC& SolarFestival() { return iSolarFestival; }
- const TDesC& SolarTerm() { return iSolarTerm; }
- const TDesC& LunarMonthAndDay() { return iLunarMonthAndDay; }
- const TDesC& GregorianDate() { return iGregorianDate; }
-
-private:
- CCalenLunarLocalizedInfo();
-
- void ConstructL();
-
-private:
-
- TPtrC iLunarFestival;
- TPtrC iSolarFestival;
- TPtrC iSolarTerm;
-
- TBuf<50> iLunarMonthAndDay;
- TBuf<50> iGregorianDate;
-private:
- friend class CCalenLunarLocalizer;
- };
-
-#endif // __CALENLUNARLOCALIZEDINFO_H__
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenLunarLocalizer.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,101 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-#ifndef __CALENLUNARLOCALIZER_H__
-#define __CALENLUNARLOCALIZER_H__
-
-// INCLUDES
-#include <e32base.h>
-#include <badesca.h>
-#include "CalenLunarLocalizedInfo.h"
-#include "CalendarVariant.hrh"
-
-// FORWARD DECLARATION
-class CEikonEnv;
-class TCalenLunarInfo;
-class TChineseDate;
-class CFont;
-class CCalenExtraRowFormatter;
-
-/**
-* Class declaration for Lunar localizer
-*/
-class CCalenLunarLocalizer : public CBase
- {
-public: // public API
- static CCalenLunarLocalizer* NewL();
-
- virtual ~CCalenLunarLocalizer();
-
- virtual CCalenLunarLocalizedInfo* LocalizeL( TCalenLunarInfo& aInfo );
-
- virtual TPtrC GetExtraRowTextL( CCalenLunarLocalizedInfo& aLocInfo,
- TInt aMaxWidth,
- const CFont& aFont
-#ifdef RD_CALENDAR_PREVIEW
- , TBool aTwoLines
-#endif // RD_CALENDAR_PREVIEW
- );
-
-protected:
- CCalenLunarLocalizer();
-
- void ConstructL();
-
- TBool TryToFitL( const TDesC& aStr );
- virtual void LocalizeMonthAndDayL(CCalenLunarLocalizedInfo* aLocInfo,
- TCalenLunarInfo& aInfo);
-private:
-
-protected: // data
- CEikonEnv* iEikEnv;
-
- /**
- * Localized names of lunar festivals
- * Own.
- */
- CDesCArray* iLunarFestivalNames;
-
- /**
- * Localized names of solar festivals
- * Own.
- */
- CDesCArray* iSolarFestivalNames;
-
- /**
- * Localized names of solar terms
- * Own.
- */
- CDesCArray* iSolarTermNames;
-
- /**
- * Format string for western date.
- * Own.
- */
- HBufC* iGregorianDateFormat;
-
- TBuf<1000> iLunarExtraRowText;
-
-
- /**
- * Language independent formatter of extra row information.
- */
- CCalenExtraRowFormatter* iRowFormatter;
-
- };
-
-#endif // __CALENLUNARLOCALIZER_H__
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenLunarPanic.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-#ifndef CALENLUNARPANIC_H
-#define CALENLUNARPANIC_H
-
-enum TCalenLunarPanic
- {
- EPanicLunarResourceLoading = 1
- };
-
-void Panic( TCalenLunarPanic aReason )
- {
- _LIT(KPanicText, "CalenLunarPlugin");
- User::Panic( KPanicText, aReason );
- }
-
-#endif
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenLunarPaths.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-
-#ifndef CALENLUNARPATHS_H
-#define CALENLUNARPATHS_H
-
-
-_LIT( KCalenLunarDllFile, "CalenLunar.dll" );
-
-_LIT( KCalenLunarResourceDrive, "z:" );
-
-_LIT( KCalenLunarResourceFile, "CalenLunar.rsc" );
-
-// search path for solar item file
-_LIT( KSolarTermsPath, "\\private\\10005901\\" );
-
-
-#endif // CALENLUNARPATHS_H
-
-// End of File
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenLunarPluginUids.hrh Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,23 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-#define SYMBIAN_ECOM_PLUGIN_UID 0x10009D8D
-#define CALENKOREANLUNARPLUGIN_DLL_UID 0x200100A1
-#define CALENKOREANLUNARPLUGIN_IMPLEMENTATION_UID 0x200100A2
-
-
-
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenLunarSettingItem.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,51 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-#ifndef __CALENLUNARSETTINGITEM_H__
-#define __CALENLUNARSETTINGITEM_H__
-
-// INCLUDES
-#include <e32def.h>
-#include <aknsettingitemlist.h>
-
-// FORWARD DECLARATION
-class CRepository;
-class CCalenKoreanLunarPlugin;
-
-/**
-* Class declaration for Lunar setting item
-*/
-NONSHARABLE_CLASS( CCalenLunarSettingItem )
- : public CAknBinaryPopupSettingItem
- {
-public:
- static CCalenLunarSettingItem* NewLC( TInt aOrdinal, CCalenKoreanLunarPlugin& aPlugin );
- virtual ~CCalenLunarSettingItem();
-
-private: // From CAknBinaryPopupSettingItem
- virtual void StoreL();
- virtual void LoadL();
-
-private:
- CCalenLunarSettingItem( CCalenKoreanLunarPlugin& aPlugin );
-
-private:
- CCalenKoreanLunarPlugin& iPlugin;
- TBool iLunarEnabled;
- };
-
-#endif // __CALENLUNARSETTINGITEM_H__
--- a/calendarui/regionalplugins/KoreanLunar/inc/CalenSolarTerms.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,98 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-
-#ifndef C_CALENSOLARTERMS_H
-#define C_CALENSOLARTERMS_H
-
-// INCLUDES
-#include <badesca.h>
-#include <e32base.h>
-
-// FORWARD DECLARATION
-class RFs;
-
-// CONSTANTS
-const TInt KSolarTermCount( 24 );
-
-
-/**
- * Provides Solar term dates for Lunar Calendar.
- *
- * Solar term dates are listed in special binary format file.
- * CCalenSolarTerms reads and caches this file one year at a time.
- *
- * @lib CalenLunar.dll
- * @since S60 v3.1
- */
-NONSHARABLE_CLASS( CCalenSolarTerms ) : public CBase
- {
-public:
- static CCalenSolarTerms* NewL( RFs& aFs );
-
- virtual ~CCalenSolarTerms();
-
- /**
- * Checks if date is solar term date. If it is, returns index to particular solar term, otherwise returns error code
- * Index can be then passed to GetSolarTermNameL function.
- *
- * @since S60 v3.1
- * @param aDateTime date that is checked
- * @return index of solar term, if date is solar term date.
- * KErrNone, if date is not solar term date
- * KErrNotSupported, if date is outside of supported
- * range for solar term data.
- */
- TInt CheckSolarTermDateL( const TDateTime& aDateTime );
-
-
-private:
- CCalenSolarTerms( RFs& aFs );
-
- void ConstructL();
-
- /**
- * Returns ETrue, if date fits into date range of available solar item
- * data.
- * @since 3.0
- */
- TBool HasSolarTermDataAvailable( const TDateTime& aDate ) const;
-
- /**
- * Reads and caches 24 solar term dates from "SolarItems" file
- */
- void ReadSolarTermsL( TDateTime aDate );
-
-private: // data
- /**
- * File server handle.
- */
- RFs& iFs;
-
- /**
- * Year that is currently cached from file to memory
- */
- TInt iCachedYear;
-
- /**
- * Table of solar term dates for currently cached year
- */
- TDateTime iSolarTermDates[KSolarTermCount];
-
- };
-
-#endif // C_CALENSOLARTERMS_H
--- a/calendarui/regionalplugins/KoreanLunar/loc/calenkoreanlunar.loc Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,393 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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:
-*
-*/
-
-
-// LOCALISATION STRINGS
-
-//d:
-//l:none
-//
-#define qtn_cale_kor_lunar_date "%0U%1U/%2U"
-
-
-//d:
-//l:none
-//
-#define qtn_kor_cale_extra_row_lunar "%1U%0U%2U%0U%3U%0U%4U"
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_1 "Lunar New Year's Day"
-
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_2 "Buddah's Birthday"
-
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_3 "Chuseok"
-
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_4 "Great Full Moon"
-
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_5 "Samjit-nal"
-
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_6 "Dano"
-
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_7 "Yudu"
-
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_8 "Chilwol chilseok"
-
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_9 "Baekjung"
-
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_10 "Jungyang"
-
-
-//d:A Korean lunar festival item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_festival_name_11 "Hansik"
-
-
-//d:Setting value. This is one of the available values of "qtn_kor_cale_lunar_calendar"
-//l:list_set_graphic_pane_t1
-//
-#define qtn_kor_cale_lunar_cale_off "Off"
-
-
-//d:Setting value. This is one of the available values of "qtn_kor_cale_lunar_calendar"
-//l:list_set_graphic_pane_t1
-//
-#define qtn_kor_cale_lunar_cale_on "On"
-
-
-//d:Setting label. The user can define whether activating or deactivating lunar calendar.
-//l:list_setting_pane_t1/opt1
-//
-#define qtn_kor_cale_lunar_calendar "Lunar calendar"
-
-
-//d:Options list item. This shows the users the lunar date as well as the corresponding gregorian date for a specific date.
-//l:list_single_pane_t1_cp2
-//
-#define qtn_kor_cale_lunar_data "Show lunar data"
-
-
-//d:Alarm offset item text of Anniversary editor form
-//l:form_field_popup_wide_pane_t1
-//
-#define qtn_kor_cale_note_alarm_offset "alarm offset"
-
-
-//d:Alarm time item text of Anniversary editor form
-//l:form_field_popup_wide_pane_t1
-//
-#define qtn_kor_cale_note_alarm_time "alarm time"
-
-
-//d:Alarm offset unit text of Anniversary editor form. Unit indicates that alarm is launched entered amount of days before the actual entry date.
-//l:form_field_popup_wide_pane_t1
-//
-#define qtn_kor_cale_note_offset_unit "days before"
-
-
-//d:Date entry type item text of Anniversary editor form
-//l:form_field_popup_wide_pane_t1
-//
-#define qtn_kor_cale_note_type "solar/lunar/leap"
-
-
-//d:Lunar calendar leap date entry text of Anniversary editor form
-//l:list_form_graphic_pane_t1
-//
-#define qtn_kor_cale_note_type_leap "Leap"
-
-
-//d:Lunar calendar date entry text of Anniversary editor form
-//l:list_form_graphic_pane_t1
-//
-#define qtn_kor_cale_note_type_lunar "Lunar"
-
-
-//d:Solar calendar leap date entry text of Anniversary editor form
-//l:list_form_graphic_pane_t1
-//
-#define qtn_kor_cale_note_type_solar "Solar"
-
-
-//d:List query heading. Heading of pop-up window that appears when a user select qtn_kor_cale_lunar_data.
-//l:
-//
-#define qtn_kor_cale_sett_lunar_cale "Lunar calendar"
-
-
-
-//d:A Korean national anniversary item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_anniversary_item_1 "New Year's Day"
-
-
-//d:A Korean national anniversary item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_anniversary_item_2 "Ind.Movement Day"
-
-
-//d:A Korean national anniversary item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_anniversary_item_3 "Children's Day"
-
-
-//d:A Korean national anniversary item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_anniversary_item_4 "Memorial Day"
-
-
-//d:A Korean national anniversary item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_anniversary_item_5 "Constitution Day"
-
-
-//d:A Korean national anniversary item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_anniversary_item_6 "Independance Day"
-
-
-//d:A Korean national anniversary item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_anniversary_item_7 "Foundation Day"
-
-
-//d:A Korean national anniversary item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_anniversary_item_8 "Christmas"
-
-
-//d:A Korean national anniversary item
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_anniversary_item_9 "HanGeul Day"
-
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_1 "Ipchoon"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_10 "Haji"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_11 "Soseo"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_12 "Daeseo"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_13 "Ipchoo"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_14 "Cheoseo"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_15 "Baekro"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_16 "Chooboon"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_17 "Hanro"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_18 "Sanggang"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_19 "Ipdong"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_2 "Usoo"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_20 "Soseol"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_21 "Daeseol"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_22 "Dongji"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_23 "Sohan"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_24 "Daehan"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_3 "Kyungchip"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_4 "Choonboon"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_5 "Chungmyoung"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_6 "Gogu"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_7 "Ipha"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_8 "Soman"
-
-
-//d:A Korean solar term
-//l:navi_text_pane_t1
-//
-#define qtn_kor_cale_solar_item_9 "Mangjong"
-
-
-//d:Alarm offset text in Anniversary viewer Indicates how many days before the actual entry date the alarm is launched %N is amount of days
-//l:popup_preview_text_window/opt1
-//
-#define qtn_kor_cale_viewer_alarm_offset "%N days before"
-
-//d:Alarm time and offset in Anniversary viewer %0U is the alarm time %1U is the alarm offset in days
-//l:popup_preview_text_window/opt1
-//
-#define qtn_kor_cale_viewer_alarm_offset_time "%0U, %1U"
-
-
-//d:Lunar indicator
-//l:navi_text_pane_t1
-//
-#define qtn_lunar_indicator "Lun."
-
-
-//d:Lunar indicator
-//l:navi_text_pane_t1
-//
-#define qtn_lunar_leap_year_indicator "Leap"
-
-
-// End of File
--- a/calendarui/regionalplugins/KoreanLunar/rom/KoreanCalPlugin.iby Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +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:
-*
-*/
-
-#ifndef KOREANCALPLUGIN_IBY
-#define KOREANCALPLUGIN_IBY
-
-#ifdef __SERIES60_LUNAR_CALENDAR
-
-#ifdef RD_CALENDAR_PLUGIN_FW
-
-#ifdef __LOCALES_65_IBY__
-
-ECOM_PLUGIN( CalenKoreanLunarPlugin.dll , CalenKoreanLunarPlugin.rsc )
-data=DATAZ_\private\10005901\KoreanSolarItems private\10005901\KoreanSolarItems
-
-// this cenrep file should be generated to image automatically by confml files but for some reason it is not so taken here
-// apparently it was generated with full s60 build so now it is removed
-//data=DATAZ_\private\10202be9\2001843E.txt private\10202be9\2001843E.txt
-
-//data=DATAZ_\resource\CalenKoreanLunarPluginData.rsc APP_RESOURCE_DIR\CalenKoreanLunarPluginData.rsc
-
-#define USER_RESOURCE_FILES_LOCALIZED CalenKoreanLunarPluginData
-#define LANGUAGE_01
-#define LANGUAGE_65
-#include <Variant/localized_resources.iby>
-//#include <..\..\..\Variant\localized_resources.iby>
-
-#endif //__LOCALES_65_IBY__
-
-#endif /* RD_CALENDAR_PLUGIN_FW */
-
-#endif /* __SERIES60_LUNAR_CALENDAR */
-
-#endif /* KOREANCALPLUGIN_IBY */
-
-// End of File
--- a/calendarui/regionalplugins/KoreanLunar/src/CalenExtraRowFormatter.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,359 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-//debug
-#include "calendarui_debug.h"
-#include "CalenExtraRowFormatter.h"
-
-#include <calenkoreanlunarplugindata.rsg>
-#include <aknbiditextutils.h>
-#include <badesca.h>
-#include <eikenv.h>
-#include <StringLoader.h>
-
-// CONSTANTS
-_LIT( KSeparatorFmt, "%0U" );
-const TInt KExtraRowLength = 1000;
-
-// ======== MEMBER FUNCTIONS ========
-
-
-// ---------------------------------------------------------------------------
-// CollapseDuplicatesL()
-// ---------------------------------------------------------------------------
-//
-void CollapseDuplicatesL( TDes& aStr, TInt aPos, const TDesC& aSub )
- {
- TRACE_ENTRY_POINT;
-
- const TInt sublen = aSub.Length();
- if ( aStr.Length() == 0 || sublen == 0 )
- {
- return;
- }
-
- TPtrC remaining = aStr.Mid( aPos );
- TInt fstInRemaining = remaining.Find( aSub );
-
- if ( fstInRemaining >= 0 )
- {
- TInt restPos = fstInRemaining + sublen;
- TPtrC rest = remaining.Mid( restPos );
- TInt sndInRest = rest.Find( aSub );
-
- // 1) two substrings found in sequence
- if ( sndInRest == 0 )
- {
- // replace second substring with empty string
- TInt fst = aPos + fstInRemaining;
- TInt snd = aPos + restPos + sndInRest;
- aStr.Replace( snd, sublen, KNullDesC);
- // continue collapsing from first
- CollapseDuplicatesL( aStr, fst, aSub );
- }
- // 2) substring found later in string
- else if ( sndInRest > 0 )
- {
- // continue collapsing from this second substring
- TInt snd = aPos + restPos + sndInRest;
- CollapseDuplicatesL( aStr, snd, aSub );
- }
- // 3) No second substring found -> nothing to collapse
- else
- {
- TRACE_EXIT_POINT;
- return;
- }
- }
- // No substring found
- else
- {
- TRACE_EXIT_POINT;
- return;
- }
- }
-
-// ---------------------------------------------------------------------------
-// RemoveLeadingAndTrailingL()
-// ---------------------------------------------------------------------------
-//
-void RemoveLeadingAndTrailingL( TDes& aStr, const TDesC& aSub )
- {
- TRACE_ENTRY_POINT;
-
- // Trailing
- const TInt sublen = aSub.Length();
- if ( aStr.Right( sublen ).Find( aSub ) == 0 )
- {
- aStr.Replace( aStr.Length() - sublen, sublen, KNullDesC );
- }
-
- // Leading
- if ( aStr.Left( sublen ).Find( aSub ) == 0 )
- {
- aStr.Replace( 0, sublen, KNullDesC );
- }
-
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenExtraRowFormatter::NewL()
-// ---------------------------------------------------------------------------
-//
-CCalenExtraRowFormatter* CCalenExtraRowFormatter::NewL()
- {
- TRACE_ENTRY_POINT;
-
- CCalenExtraRowFormatter* self = new (ELeave) CCalenExtraRowFormatter;
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
-
- TRACE_EXIT_POINT;
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenExtraRowFormatter::~CCalenExtraRowFormatter()
-// ---------------------------------------------------------------------------
-//
-CCalenExtraRowFormatter::~CCalenExtraRowFormatter()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenExtraRowFormatter::CCalenExtraRowFormatter()
-// ---------------------------------------------------------------------------
-//
-CCalenExtraRowFormatter::CCalenExtraRowFormatter()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenExtraRowFormatter::ConstructL()
-// ---------------------------------------------------------------------------
-//
-void CCalenExtraRowFormatter::ConstructL()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenExtraRowFormatter::FormatExtraRowInformationL()
-// ---------------------------------------------------------------------------
-//
-TPtrC CCalenExtraRowFormatter::FormatExtraRowInformationL(
- CCalenLunarLocalizedInfo& aLocInfo,
- RArray<CCalenLunarLocalizedInfo::TField>& aPrioritizedFields,
- TInt aMaxWidth,
- const CFont& aFont
-#ifdef RD_CALENDAR_PREVIEW
- ,TBool aTwoLines
-#endif // RD_CALENDAR_PREVIEW
- )
- {
- TRACE_ENTRY_POINT;
-
- if ( aPrioritizedFields.Count() == 0)
- {
- iText = KNullDesC;
-
- TRACE_EXIT_POINT;
- return iText;
- }
-
- // Initialize substring labels
- RArray<CCalenLunarLocalizedInfo::TField> subLabels;
- CleanupClosePushL( subLabels );
- subLabels.AppendL( CCalenLunarLocalizedInfo::ELunarMonthAndDay );
- subLabels.AppendL( CCalenLunarLocalizedInfo::ELunarFestival );
- subLabels.AppendL( CCalenLunarLocalizedInfo::ESolarFestival );
- subLabels.AppendL( CCalenLunarLocalizedInfo::ESolarTerm );
-
- // ASSERT that all prioritized fields can be found from subLabels
- for ( TInt i=0; i < aPrioritizedFields.Count(); i++)
- {
- ASSERT( subLabels.Find( aPrioritizedFields[i] ) >= 0 );
- }
-
- TBool fits = EFalse;
-
- do
- {
- // Initialize substring array
- CPtrCArray* subs = new (ELeave) CPtrCArray(10);
- CleanupStack::PushL( subs );
- for ( TInt i = 0; i < subLabels.Count(); i++)
- {
- subs->AppendL( TPtrC( KNullDesC ) );
- }
-
- // Set wanted fields to substring array
- for ( TInt i = 0; i < aPrioritizedFields.Count(); i++)
- {
- CCalenLunarLocalizedInfo::TField field = aPrioritizedFields[i];
- TInt subIx = subLabels.Find( field );
- // Replace
- subs->Delete(subIx);
- RDebug::Print( _L("A sub count %d"), subs->Count() );
- subs->InsertL(subIx, TPtrC( aLocInfo.GetField( field ) ) );
- RDebug::Print( _L("B sub count %d"), subs->Count() );
- RDebug::Print( _L("B field %S"), &(subs->At(subIx)) );
- }
-
- // Format all fields to extra row
- HBufC* extraRowFmt = StringLoader::LoadLC( R_KOR_CALE_EXTRA_ROW_LUNAR );
-
- RDebug::RawPrint( *extraRowFmt );
-
- TBuf<KExtraRowLength> fmt = *extraRowFmt;
- for ( TInt i=0; i < subLabels.Count(); i++ )
- {
- RDebug::Print( _L("Before Format") );
- RDebug::RawPrint( fmt );
- StringLoader::Format( iText,
- fmt,
- i + 1, // %0U is a separator
- subs->At( i ) );
- fmt = iText;
- RDebug::Print( _L("After Format") );
- RDebug::RawPrint( fmt );
- }
-
- // Now we have something like "Year of Dog%0U%0U6/11%0U%0U"
- // First We need to remove multiple occurences of %0U
- CollapseDuplicatesL( iText, 0, KSeparatorFmt );
- RDebug::Print( _L("After collapse") );
- RDebug::RawPrint( iText );
-
- // Remove leading and trailing %0U
- // By now, we are sure that there is max 1 %0U in the beginning
- // and in the end of string.
- RemoveLeadingAndTrailingL( iText, KSeparatorFmt );
- RDebug::Print( _L("After leading and trailing removal") );
- RDebug::RawPrint( iText );
-
- // If there are now separators anymore, then do not fill them
- TBool hasSeparators = iText.Find( KSeparatorFmt ) >= 0;
-
- if ( hasSeparators )
- {
- // fill in separators
- HBufC* separator = StringLoader::LoadLC( R_CALE_LUNAR_SEPARATOR );
- fmt = iText;
- StringLoader::Format( iText,
- fmt,
- 0, // %0U is a separator
- *separator );
-
- RDebug::Print( _L("After separator insert") );
- RDebug::RawPrint( iText );
- CleanupStack::PopAndDestroy( separator );
- }
-
- CleanupStack::PopAndDestroy( extraRowFmt );
- CleanupStack::PopAndDestroy( subs );
-
- do{
-
- fits = TryToFitL( iText, aMaxWidth, aFont
-#ifdef RD_CALENDAR_PREVIEW
- , aTwoLines
-#endif // RD_CALENDAR_PREVIEW
- );
-
- if( !fits )
- {
- iText.SetLength( iText.Length()-1 );
- }
- }while( !fits );
- if ( ! fits )
- {
- iText = KNullDesC;
- TInt last = aPrioritizedFields.Count() - 1;
- if ( last >= 0 )
- {
- aPrioritizedFields.Remove( last );
- }
- }
-
- } while ( ! fits && aPrioritizedFields.Count() );
-
- CleanupStack::PopAndDestroy( &subLabels );
-
- TRACE_EXIT_POINT;
- return iText;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenExtraRowFormatter::TryToFitL()
-// ---------------------------------------------------------------------------
-//
-TBool CCalenExtraRowFormatter::TryToFitL( const TDesC& aStr, TInt aMaxWidth, const CFont& aFont
-#ifdef RD_CALENDAR_PREVIEW
- , TBool aTwoLines
-#endif // RD_CALENDAR_PREVIEW
- )
- {
- TRACE_ENTRY_POINT;
-#ifdef RD_CALENDAR_PREVIEW
- TBool result(EFalse);
- if(aTwoLines)
- {
- CArrayFixFlat<TPtrC>* textLines = new(ELeave)CArrayFixFlat<TPtrC>( 3 );
- CleanupStack::PushL( textLines );
-
- CArrayFixFlat<TInt>* lineWidths = new( ELeave )CArrayFixFlat<TInt>( 1 );
- CleanupStack::PushL( lineWidths );
-
- lineWidths->AppendL( aMaxWidth );
-
- HBufC* visualText = AknBidiTextUtils::ConvertToVisualAndWrapToArrayWholeTextL(
- aStr,
- *lineWidths,
- aFont,
- *textLines);
-
- result = (textLines->Count() <= 2);
-
- CleanupStack::PopAndDestroy( lineWidths );
- CleanupStack::PopAndDestroy( textLines );
- delete visualText;
- }
- else
- {
- CFont::TMeasureTextInput::TFlags logicalOrder = static_cast<CFont::TMeasureTextInput::TFlags>(0);
- TInt textW = AknBidiTextUtils::MeasureTextBoundsWidth( aFont, aStr, logicalOrder );
- result = (textW <= aMaxWidth);
- }
- TRACE_EXIT_POINT;
- return result;
-#else
- CFont::TMeasureTextInput::TFlags logicalOrder = static_cast<CFont::TMeasureTextInput::TFlags>(0);
- TInt textW = AknBidiTextUtils::MeasureTextBoundsWidth( aFont, aStr, logicalOrder );
- TRACE_EXIT_POINT;
- return ( textW <= aMaxWidth );
-#endif
- }
-
-// End of file
--- a/calendarui/regionalplugins/KoreanLunar/src/CalenKoreanLunarPlugin.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,647 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-//debug
-#include "calendarui_debug.h"
-
-//user includes
-#include "CalenKoreanLunarPlugin.h"
-#include "CalenLunarInfoProvider.h"
-#include "CalenLunarLocalizedInfo.h"
-#include "CalenLunarLocalizer.h"
-#include "CalenLunarPanic.h"
-#include <CalenKoreanLunarPluginData.rsg>
-#include "CalenLunarSettingItem.h"
-#include "CalenKoreanLunarPrivateCRKeys.h"
-#include "CleanupResetAndDestroy.h"
-
-//system includes
-#include <AknMessageQueryDialog.h>
-#include <data_caging_path_literals.hrh>
-#include <eikenv.h>
-#include <eikmenup.h>
-#include <eiklabel.h>
-#include <CentralRepository.h>
-#include <StringLoader.h>
-#include <AknUtils.h>
-#include <aknsutils.h>
-#include <aknbiditextutils.h>
-#include <CalendarConverter.h>
-
-// CONSTANTS
-_LIT( KResourceDrive, "z:" );
-_LIT( KFieldSeparator, "\n" );
-_LIT( KHeaderSeparator, "\n ");
-_LIT( KResourceFile, "CalenKoreanLunarPluginData.rsc" );
-const TInt KFieldCount = 2;
-#define KResourcePath KDC_RESOURCE_FILES_DIR
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::CreateKoreanPluginL()
-// -----------------------------------------------------------------------------
-//
-CCalenKoreanLunarPlugin* CCalenKoreanLunarPlugin::CreateKoreanPluginL(
- MCalenServices* aServices )
- {
- TRACE_ENTRY_POINT;
-
- CCalenKoreanLunarPlugin* plugin = new (ELeave) CCalenKoreanLunarPlugin(
- KCalenKoreanPluginEnabled, aServices );
- CleanupStack::PushL( plugin );
- plugin->ConstructL();
- plugin->SetLunarLocalizerL();
- CleanupStack::Pop( plugin );
-
- TRACE_EXIT_POINT;
- return plugin;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::~CCalenKoreanLunarPlugin()
-// -----------------------------------------------------------------------------
-//
-CCalenKoreanLunarPlugin::~CCalenKoreanLunarPlugin()
- {
- TRACE_ENTRY_POINT;
-
- // Deregister services
- if ( iServices )
- {
- iServices->CancelNotifications( this );
- iServices->Release();
- }
-
- delete iLocInfo;
- delete iInfoProvider;
- if ( iLocalizer != NULL )
- delete iLocalizer;
-
- iResourceLoader.Close();
- delete iLabel;
- delete iConverter;
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::CCalenKoreanLunarPlugin()
-// -----------------------------------------------------------------------------
-//
-CCalenKoreanLunarPlugin::CCalenKoreanLunarPlugin(
- TUint32 aCenRepLunarEnabledId, MCalenServices* aServices )
- : iLocalizer( NULL ),
- iResourceLoader( *( CEikonEnv::Static() ) ),
- iCenRepLunarEnabledId( aCenRepLunarEnabledId ),
- iServices( aServices )
-
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::SetLunarLocalizerL()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::SetLunarLocalizerL()
- {
- TRACE_ENTRY_POINT;
-
- iLocalizer = CCalenLunarLocalizer::NewL();
-
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::CustomPreviewPaneL()
-// -----------------------------------------------------------------------------
-//
-MCalenPreview* CCalenKoreanLunarPlugin::CustomPreviewPaneL( TRect& aRect )
- {
- return NULL;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::ConstructL()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::ConstructL()
- {
- TRACE_ENTRY_POINT;
-
- TFileName resource( KResourceDrive );
- resource.Append( KResourcePath );
- resource.Append( KResourceFile );
-
- TInt err( iResourceLoader.Open( resource ) );
- __ASSERT_ALWAYS( err == KErrNone, Panic( EPanicLunarResourceLoading ) );
-
- LoadEnabledStatusL();
-
- iInfoProvider = CCalenLunarInfoProvider::NewL( CEikonEnv::Static()->FsSession() );
- iServices->RegisterForNotificationsL( this, ECalenNotifyContextChanged );
- iServices->GetCommandRange( iStart, iEnd );
- iConverter = CKoreanCalConv::NewL();
-
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::GetCustomViewsL()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::GetCustomViewsL( RPointerArray<CCalenView>&
- /*aCustomViewArray*/ )
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::GetCustomSettingsL()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::GetCustomSettingsL(
- RPointerArray<CAknSettingItem>& /*aCustomSettingArray*/ )
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::InfobarL()
-// -----------------------------------------------------------------------------
-//
-CCoeControl* CCalenKoreanLunarPlugin::InfobarL( const TRect& aRect )
- {
- TRACE_ENTRY_POINT;
-
- if ( !iLabel )
- {
- iLabel = new ( ELeave ) CEikLabel;
- }
- iRect = aRect;
- FormatExtraRowStringL( *iLabel );
- iLabel->SetTextL( iExtraRowText );
- iLabel->SetRect( aRect );
- iLabel->SetLabelAlignment( ELayoutAlignCenter );
-
- if ( !GetColor() )
- iLabel->OverrideColorL( EColorLabelText, iSkinColor );
-
- TRACE_EXIT_POINT;
- return iLabel;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::InfobarL()
-// -----------------------------------------------------------------------------
-//
-const TDesC& CCalenKoreanLunarPlugin::InfobarL()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- return iExtraRowText;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::GetColor()
-// -----------------------------------------------------------------------------
-//
-TInt CCalenKoreanLunarPlugin::GetColor()
- {
- TRACE_ENTRY_POINT;
- // Query the text colour based on the theme
- TInt err = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), iSkinColor,
- KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 );
-
- TRACE_EXIT_POINT;
- return err;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::PreviewPaneL()
-// -----------------------------------------------------------------------------
-//
-CCoeControl* CCalenKoreanLunarPlugin::PreviewPaneL( TRect& aRect )
- {
- TRACE_ENTRY_POINT;
-
-
- if (iLabel)
- {
- delete iLabel;
- iLabel = NULL;
- }
-
-
- if ( !iLabel )
- {
- iLabel = new ( ELeave ) CEikLabel;
- }
- FormatExtraRowStringL( *iLabel
- #ifdef RD_CALENDAR_PREVIEW
- , EFalse
- #endif // RD_CALENDAR_PREVIEW
- );
- iLabel->SetTextL( iExtraRowText );
- iLabel->SetRect( aRect );
- iLabel->SetLabelAlignment( ELayoutAlignCenter );
-
- if ( !GetColor() )
- iLabel->OverrideColorL( EColorLabelText, iSkinColor );
-
- TRACE_EXIT_POINT;
- return iLabel;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::RemoveViewsFromCycle()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::RemoveViewsFromCycle( RArray<TInt>& /*aViews*/ )
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::CustomiseMenuPaneL()
-// -----------------------------------------------------------------------------
-//
-TBool CCalenKoreanLunarPlugin::CustomiseMenuPaneL( TInt aResourceId,
- CEikMenuPane* aMenuPane )
- {
- TRACE_ENTRY_POINT;
-
- if ( iLunarEnabled )
- {
- CEikMenuPaneItem* item = new ( ELeave ) CEikMenuPaneItem();
- CleanupStack::PushL( item );
- item->iData.iCommandId = iStart;
-
- HBufC* tmp = StringLoader::LoadLC( R_CALENDAR_SHOW_LUNAR_DATA );
- item->iData.iText = *tmp;
- CleanupStack::PopAndDestroy( tmp );
-
- item->iData.iCascadeId = 0;
- item->iData.iFlags = 0;
-
- TInt pos = aMenuPane->NumberOfItemsInPane()-2;
- if ( pos < 1 )
- {
- pos = 1;
- }
-
- aMenuPane->InsertMenuItemL( item->iData, pos );
-
- CleanupStack::Pop( item );
- return ETrue;
- }
- TRACE_EXIT_POINT;
- return EFalse;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::CanBeEnabledDisabled()
-// -----------------------------------------------------------------------------
-//
-TBool CCalenKoreanLunarPlugin::CanBeEnabledDisabled()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- return ETrue;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::CalenCustomisationExtensionL()
-// -----------------------------------------------------------------------------
-//
-TAny* CCalenKoreanLunarPlugin::CalenCustomisationExtensionL( TUid aExtensionUid )
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- return NULL;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::CommandHandlerL()
-// -----------------------------------------------------------------------------
-//
-MCalenCommandHandler* CCalenKoreanLunarPlugin::CommandHandlerL( TInt aCommand )
- {
- TRACE_ENTRY_POINT;
-
- if ( aCommand == iStart )
- {
- return this;
- }
- else
- {
- return NULL;
- }
-
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::HandleCommandL()
-// -----------------------------------------------------------------------------
-//
-TBool CCalenKoreanLunarPlugin::HandleCommandL( const TCalenCommand& aCommand )
- {
- TRACE_ENTRY_POINT;
-
- TInt command( aCommand.Command() );
- if ( command == iStart )
- {
- ShowDetailsL();
- }
- TRACE_EXIT_POINT;
- return EFalse;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::CalenCommandHandlerExtensionL()
-// -----------------------------------------------------------------------------
-//
-TAny* CCalenKoreanLunarPlugin::CalenCommandHandlerExtensionL( TUid aExtensionUid )
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- return NULL;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::HandleNotification()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::HandleNotification(
- const TCalenNotification aNotification )
- {
- TRACE_ENTRY_POINT;
-
- if ( aNotification == ECalenNotifyContextChanged )
- {
- TRAP_IGNORE( UpdateInfoBarL() );
- }
-
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// GetCenRepIntL()
-// -----------------------------------------------------------------------------
-//
-TInt GetCenRepIntL( const TUid& aCRUid, TInt aKeyId )
- {
- TRACE_ENTRY_POINT;
-
- CRepository* repository = CRepository::NewL( aCRUid );
- CleanupStack::PushL( repository );
- TInt tmp = 0;
- TInt err = repository->Get( aKeyId, tmp );
- if ( err == KErrNotFound )
- {
- tmp = 0;
- }
- else
- {
- User::LeaveIfError( err );
- }
- CleanupStack::PopAndDestroy( repository );
-
- TRACE_EXIT_POINT;
- return tmp;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::LoadEnabledStatusL()
-// -----------------------------------------------------------------------------
-//
-TBool CCalenKoreanLunarPlugin::LoadEnabledStatusL()
- {
- TRACE_ENTRY_POINT;
-
- TInt enabled = 0;
- TRAPD( err, enabled = GetCenRepIntL( KCRUidCalenKoreanPlugin, iCenRepLunarEnabledId ) );
- if ( err == KErrNone )
- {
- iLunarEnabled = static_cast<TBool>( enabled );
- }
- else
- {
- iLunarEnabled = ETrue;
- }
-
- TRACE_EXIT_POINT;
- return iLunarEnabled;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::StoreEnabledStatusL()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::StoreEnabledStatusL( TBool aEnabled )
- {
- TRACE_ENTRY_POINT;
-
- CRepository* repository = CRepository::NewL( KCRUidCalenKoreanPlugin );
- CleanupStack::PushL( repository );
-
- User::LeaveIfError( repository->Set( iCenRepLunarEnabledId,
- static_cast<TInt>( aEnabled ) ) );
- CleanupStack::PopAndDestroy( repository );
-
- iLunarEnabled = aEnabled;
-
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::FormatExtraRowStringL()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::FormatExtraRowStringL( CEikLabel& aLabel
-#ifdef RD_CALENDAR_PREVIEW
- , TBool aTwoLines
-#endif // RD_CALENDAR_PREVIEW
- )
- {
- TRACE_ENTRY_POINT;
-
- // added hero to have always lates date
- TTime focusTime = iServices->Context().FocusDateAndTimeL().TimeLocalL();
- TCalenLunarInfo info = iInfoProvider->GetLunarInfoL( focusTime );
-
- if ( iLocInfo )
- {
- delete iLocInfo;
- iLocInfo = NULL;
- }
-
- iLocInfo = iLocalizer->LocalizeL( info );
- // add end
-
- const CFont* font = NULL;
- font = AknLayoutUtils::FontFromId( EAknLogicalFontPrimarySmallFont, NULL );
- aLabel.SetFont( font );
-
- TInt maxWidth = iRect.Size().iWidth;
-
- if ( font && iLocInfo )
- {
- iExtraRowText.Set( iLocalizer->GetExtraRowTextL( *iLocInfo,
- maxWidth,
- *font
-#ifdef RD_CALENDAR_PREVIEW
- , aTwoLines
-#endif // RD_CALENDAR_PREVIEW
- ) );
- }
- else
- {
- iExtraRowText.Set( KNullDesC );
- }
-
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::ShowDetailsL()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::ShowDetailsL( )
- {
- TRACE_ENTRY_POINT;
-
- HBufC* msg = HBufC::NewLC( 1000 );
-
- if ( iLocInfo )
- {
- // Headers
- TInt headerIds[KFieldCount] = {
- R_CALENDAR_LUNAR_INFO_DATE,
- R_CALENDAR_LUNAR_INFO_WESTERN_DATE
- };
-
- RPointerArray<HBufC> headers;
- CleanupResetAndDestroyPushL( headers );
-
- for ( TInt i = 0; i < KFieldCount; i++ )
- {
- headers.Append( StringLoader::LoadL( headerIds[i] ) );
- }
-
- CPtrCArray* fields = new ( ELeave ) CPtrCArray( KFieldCount );
- CleanupStack::PushL( fields );
- fields->AppendL( iLocInfo->LunarMonthAndDay() );
- fields->AppendL( iLocInfo->GregorianDate() );
-
- for ( TInt i = 0; i < KFieldCount; i++ )
- {
- TPtrC field = fields->At( i );
- if ( field != KNullDesC )
- {
- msg->Des().Append( *( headers[i] ) );
- msg->Des().Append( KHeaderSeparator );
- msg->Des().Append( field );
- if ( i < KFieldCount - 1 ) // not last
- {
- msg->Des().Append( KFieldSeparator );
- }
- }
- }
- CleanupStack::PopAndDestroy( fields );
- CleanupStack::PopAndDestroy( &headers );
- }
-
- TPtrC ptr( *msg );
- CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL( ptr );
- CleanupStack::PushL( dlg );
- dlg->PrepareLC( R_CALEN_LUNAR_DETAILS_DIALOG );
- CleanupStack::Pop( dlg );
-
- dlg->RunLD();
- CleanupStack::PopAndDestroy( msg );
-
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::DateTimeToKoreanL()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::DateTimeToKoreanL( const TDateTime& aDateTime,
- TKoreanDate& aKoreanDate )
- {
- TRACE_ENTRY_POINT;
- iConverter->DateTimeToKoreanL( aDateTime, aKoreanDate );
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::KoreanToDateTimeL()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::KoreanToDateTimeL( TKoreanDate& aKoreanDate,
- TDateTime& aDateTime )
- {
- TRACE_ENTRY_POINT;
- iConverter->KoreanToDateTimeL( aKoreanDate, aDateTime );
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::DateRange()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::DateRange( TDateTime& aLower, TDateTime& aUpper )
- {
- TRACE_ENTRY_POINT;
- iConverter->DateRange( aLower, aUpper );
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::DateRange()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::DateRange( TKoreanDate& aLower, TKoreanDate& aUpper )
- {
- TRACE_ENTRY_POINT;
- iConverter->DateRange( aLower, aUpper );
- TRACE_EXIT_POINT;
- }
-
-// -----------------------------------------------------------------------------
-// CCalenKoreanLunarPlugin::UpdateInfoBarL()
-// -----------------------------------------------------------------------------
-//
-void CCalenKoreanLunarPlugin::UpdateInfoBarL()
- {
- TRACE_ENTRY_POINT;
-
- if ( iLabel )
- {
- FormatExtraRowStringL( *iLabel );
- iLabel->SetTextL( iExtraRowText );
- }
-
- TRACE_EXIT_POINT;
- }
-
-// End of file
--- a/calendarui/regionalplugins/KoreanLunar/src/CalenLunarInfo.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,64 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-//debug
-#include "calendarui_debug.h"
-
-//user includes
-#include "CalenLunarInfo.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-
-// ---------------------------------------------------------------------------
-// TCalenLunarInfo::HasLunarFestival()
-// ---------------------------------------------------------------------------
-//
-TBool TCalenLunarInfo::HasLunarFestival()
- {
- TRACE_ENTRY_POINT;
-
- TRACE_EXIT_POINT;
- return iLunarFestival >= 0;
- }
-
-// ---------------------------------------------------------------------------
-// TCalenLunarInfo::HasSolarFestival()
-// ---------------------------------------------------------------------------
-//
-TBool TCalenLunarInfo::HasSolarFestival()
- {
- TRACE_ENTRY_POINT;
-
- TRACE_EXIT_POINT;
- return iSolarFestival >= 0;
- }
-
-// ---------------------------------------------------------------------------
-// TCalenLunarInfo::HasSolarTerm()
-// ---------------------------------------------------------------------------
-//
-TBool TCalenLunarInfo::HasSolarTerm()
- {
- TRACE_ENTRY_POINT;
-
- TRACE_EXIT_POINT;
- return iSolarTerm >= 0;
- }
-
-// End of file
-
--- a/calendarui/regionalplugins/KoreanLunar/src/CalenLunarInfoProvider.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,279 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-//debug
-#include "calendarui_debug.h"
-
-//user includes
-#include "CalenLunarInfoProvider.h"
-#include "CalenLunarInfo.h"
-#include "CalenSolarTerms.h"
-#include <calendarconverter.h>
-#include "CalenKoreanLunarPlugin.h"
-#include "KoreanCalConv.h"
-
-// CONSTANTS
-const TInt KDaysInJanuary = 31; // total day count of January
-const TInt KDaysInMarch = 31; // total day count of January
-const TInt KDaysInDecemberAfterWinterSolstice = 10; // day count of December starting from winter solstice (21.12)
-const TInt K105thDayAfterWinterSolstice = 105;
-
-// ======== MEMBER FUNCTIONS ========
-
-
-// ---------------------------------------------------------------------------
-// TCalenLunarInfo::TLunarFestival()
-// ---------------------------------------------------------------------------
-//
-static TCalenLunarInfo::TLunarFestival KoreanLunarFestival(
- const TKoreanDate& aDate,
- const TKoreanDate& aNextDate,
- const TTime& aDay )
- {
- TRACE_ENTRY_POINT;
-
- TCalenLunarInfo::TLunarFestival index = TCalenLunarInfo::ENoFestival;
-
- if (!aDate.iLeapMonth)
- {
- if (aDate.iMonth == 4 && aDate.iDay == 8)
- {
- index = TCalenLunarInfo::EFestivalBuddhaBirthDay;
- }
- else if (aDate.iMonth == 8 && aDate.iDay == 15)
- {
- index = TCalenLunarInfo::EFestivalHarvest;
- }
- else if(aDate.iMonth == 1 && aDate.iDay == 15)
- {
- // full moon day
- index = TCalenLunarInfo::EFestivalFullMoonDay;
- }
- else if(aDate.iMonth == 3 && aDate.iDay == 3)
- {
- // 3rd of March festival
- index = TCalenLunarInfo::EFestival3rdMarchDay;
- }
- else if(aDate.iMonth == 5 && aDate.iDay == 5)
- {
- // dano festival
- index = TCalenLunarInfo::EFestivalDano;
- }
- else if(aDate.iMonth == 6 && aDate.iDay == 15)
- {
- // ?? festival
- index = TCalenLunarInfo::EFestivalUnknown_1;
- }
- else if(aDate.iMonth == 7 && aDate.iDay == 7)
- {
- // 7th of July festival
- index = TCalenLunarInfo::EFestival7thJulyDay;
- }
- else if(aDate.iMonth == 7 && aDate.iDay == 15)
- {
- // ?? festival
- index = TCalenLunarInfo::EFestivalUnknown_2;
- }
- else if(aDate.iMonth == 9 && aDate.iDay == 9)
- {
- // ?? festival
- index = TCalenLunarInfo::EFestivalUnknown_3;
- }
- else
- {
- TDateTime date = aDay.DateTime();
- TMonth month = date.Month();
- TInt day = date.Day();
- TInt year = date.Year();
-
- if( month == EApril )
- {
- // Check if it's 105th hay after Dong Shi (winter solstice)
- TInt daysInFebruary;
- if(year%4 == 0)
- {
- // leap year
- daysInFebruary = 29;
- }
- else
- {
- daysInFebruary = 28;
- }
-
- // we need to count dates beginning from winter soltice (21.22) till end of march
- TInt daysBeforeApril =
- KDaysInDecemberAfterWinterSolstice + KDaysInJanuary + daysInFebruary + KDaysInMarch;
-
- if( daysBeforeApril + day == K105thDayAfterWinterSolstice )
- {
- index = TCalenLunarInfo::EFestival105thDayAfterWS;
- }
- }
- }
- }
- if (!aNextDate.iLeapMonth &&
- aDate.iMonth == 1 && aDate.iDay == 1)
- {
- index = TCalenLunarInfo::EFestivalNewYearDay;
- }
-
- TRACE_EXIT_POINT;
- return index;
- }
-
-// ---------------------------------------------------------------------------
-// TCalenLunarInfo::TSolarFestival()
-// ---------------------------------------------------------------------------
-//
-static TCalenLunarInfo::TSolarFestival KoreanSolarFestival(
- const TTime& aDay )
- {
- TRACE_ENTRY_POINT;
-
- TCalenLunarInfo::TSolarFestival index = TCalenLunarInfo::ENoSolarFestival;
-
- TDateTime date = aDay.DateTime();
- TMonth month = date.Month();
- TInt day = date.Day();
-
- if( month == EJanuary && day == 0 )
- {
- index = TCalenLunarInfo::ESolarFestivalNewYearDay;
- }
- else if( month == EMarch && day == 0 )
- {
- index = TCalenLunarInfo::ESolarFestivalIndependenceMovement;
- }
- else if( month == EMay && day == 4 )
- {
- index = TCalenLunarInfo::ESolarFestivalChildrensDay;
- }
- else if( month == EJune && day == 5 )
- {
- index = TCalenLunarInfo::ESolarFestivalMemorialDay;
- }
- else if( month == EJuly && day == 16 )
- {
- index = TCalenLunarInfo::ESolarFestivalConstitutionDay;
- }
- else if( month == EAugust && day == 14 )
- {
- index = TCalenLunarInfo::ESolarFestivalLiberationDay;
- }
- else if( month == EOctober && day == 2 )
- {
- index = TCalenLunarInfo::ESolarFestivalFoundationDay;
- }
- else if( month == EDecember && day == 24 )
- {
- index = TCalenLunarInfo::ESolarFestivalChristmasDay;
- }
- else if( month == EOctober && day == 8 )
- {
- index = TCalenLunarInfo::ESolarFestivalHangulDay;
- }
- TRACE_EXIT_POINT;
- return index;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarInfoProvider::NewL()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarInfoProvider* CCalenLunarInfoProvider::NewL( RFs& aFs )
- {
- TRACE_ENTRY_POINT;
-
- CCalenLunarInfoProvider* self = new (ELeave) CCalenLunarInfoProvider();
- CleanupStack::PushL(self);
- self->ConstructL(aFs);
- CleanupStack::Pop(self);
-
- TRACE_EXIT_POINT;
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarInfoProvider::~CCalenLunarInfoProvider()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarInfoProvider::~CCalenLunarInfoProvider()
- {
- TRACE_ENTRY_POINT;
-
- delete iSolarTerms;
- delete iConverter;
-
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarInfoProvider::CCalenLunarInfoProvider()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarInfoProvider::CCalenLunarInfoProvider()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarInfoProvider::ConstructL()
-// ---------------------------------------------------------------------------
-//
-void CCalenLunarInfoProvider::ConstructL( RFs& aFs )
- {
- TRACE_ENTRY_POINT;
-
- iConverter = CKoreanCalConv::NewL();
- iSolarTerms = CCalenSolarTerms::NewL( aFs );
-
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarInfoProvider::GetLunarInfoL()
-// ---------------------------------------------------------------------------
-//
-TCalenLunarInfo CCalenLunarInfoProvider::GetLunarInfoL( const TTime& aDay )
- {
- TRACE_ENTRY_POINT;
-
- TDateTime dayDt = aDay.DateTime();
-
- TTime nextDay = aDay + TTimeIntervalDays(1);
- TDateTime nextDayDt = nextDay.DateTime();
-
- TKoreanDate koreanDate;
- TKoreanDate nextKoreanDate;
-
- iConverter->DateTimeToKoreanL(dayDt, koreanDate);
- iConverter->DateTimeToKoreanL(nextDayDt, nextKoreanDate);
-
-
- TCalenLunarInfo info;
- info.iLunarDate = koreanDate;
- info.iGregorianDate = aDay;
- info.iLunarFestival = KoreanLunarFestival( koreanDate, nextKoreanDate, aDay);
- info.iSolarFestival = KoreanSolarFestival( aDay );
- info.iSolarTerm = iSolarTerms->CheckSolarTermDateL( dayDt );
-
- TRACE_EXIT_POINT;
- return info;
- }
-
-// End of file
--- a/calendarui/regionalplugins/KoreanLunar/src/CalenLunarLocalizedInfo.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,105 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-//debug
-#include "calendarui_debug.h"
-
-//user includes
-#include "CalenLunarLocalizedInfo.h"
-
-// ======== MEMBER FUNCTIONS ========
-
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizedInfo::NewL()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarLocalizedInfo* CCalenLunarLocalizedInfo::NewL()
- {
- TRACE_ENTRY_POINT;
-
- CCalenLunarLocalizedInfo* self = new (ELeave) CCalenLunarLocalizedInfo;
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop(self);
-
- TRACE_EXIT_POINT;
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizedInfo::~CCalenLunarLocalizedInfo()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarLocalizedInfo::~CCalenLunarLocalizedInfo()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizedInfo::CCalenLunarLocalizedInfo()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarLocalizedInfo::CCalenLunarLocalizedInfo()
- {
- TRACE_ENTRY_POINT;
-
- iLunarFestival.Set( KNullDesC );
- iSolarFestival.Set( KNullDesC );
- iSolarTerm.Set( KNullDesC );
- iLunarMonthAndDay = KNullDesC;
- iGregorianDate = KNullDesC;
-
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizedInfo::ConstructL()
-// ---------------------------------------------------------------------------
-//
-void CCalenLunarLocalizedInfo::ConstructL()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizedInfo::GetField()
-// ---------------------------------------------------------------------------
-//
-const TDesC& CCalenLunarLocalizedInfo::GetField( TField aField )
- {
- TRACE_ENTRY_POINT;
-
- switch ( aField )
- {
- case ELunarFestival: return LunarFestival();
- case ESolarFestival: return SolarFestival();
- case ESolarTerm: return SolarTerm();
- case ELunarMonthAndDay: return LunarMonthAndDay();
- case EGregorianDate: return GregorianDate();
- default:
- ASSERT( EFalse );
- return KNullDesC;
- }
-
- TRACE_EXIT_POINT;
- }
-
-// End of file
-
--- a/calendarui/regionalplugins/KoreanLunar/src/CalenLunarLocalizer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,212 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-//debug
-#include "calendarui_debug.h"
-#include "CalenLunarLocalizer.h"
-#include "CalenLunarInfo.h"
-#include "CalenLunarLocalizedInfo.h"
-#include "CalenExtraRowFormatter.h"
-#include <calenkoreanlunarplugindata.rsg>
-
-//system includes
-#include <aknbiditextutils.h>
-#include <avkon.rsg>
-#include <badesca.h>
-#include <eikenv.h>
-#include <StringLoader.h>
-
-// ======== MEMBER FUNCTIONS ========
-
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizer::NewL()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarLocalizer* CCalenLunarLocalizer::NewL()
- {
- TRACE_ENTRY_POINT;
-
- CCalenLunarLocalizer* self = new (ELeave) CCalenLunarLocalizer;
- CleanupStack::PushL(self);
- self->ConstructL();
- CleanupStack::Pop(self);
-
- TRACE_EXIT_POINT;
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizer::~CCalenLunarLocalizer()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarLocalizer::~CCalenLunarLocalizer()
- {
- TRACE_ENTRY_POINT;
-
- delete iLunarFestivalNames;
- delete iSolarFestivalNames;
- delete iSolarTermNames;
- delete iGregorianDateFormat;
- delete iRowFormatter;
-
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizer::CCalenLunarLocalizer()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarLocalizer::CCalenLunarLocalizer() : iEikEnv( CEikonEnv::Static() )
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizer::ConstructL()
-// ---------------------------------------------------------------------------
-//
-void CCalenLunarLocalizer::ConstructL()
- {
- TRACE_ENTRY_POINT;
-
- iRowFormatter = CCalenExtraRowFormatter::NewL();
-
- iLunarFestivalNames = iEikEnv->ReadDesCArrayResourceL(R_CALEN_KOR_FESTIVALS);
- iSolarFestivalNames = iEikEnv->ReadDesCArrayResourceL(R_CALEN_KOR_SOLAR_ANNIVERSARY_ITEMS);
- iSolarTermNames = iEikEnv->ReadDesCArrayResourceL(R_CALEN_KOR_SOLAR_ITEMS);
- iGregorianDateFormat = StringLoader::LoadL(R_QTN_DATE_USUAL_WITH_ZERO);
-
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizer::LocalizeL()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarLocalizedInfo* CCalenLunarLocalizer::LocalizeL( TCalenLunarInfo& aInfo )
- {
- TRACE_ENTRY_POINT;
-
- CCalenLunarLocalizedInfo* localized = CCalenLunarLocalizedInfo::NewL();
- CleanupStack::PushL( localized );
-
- if ( aInfo.HasLunarFestival() )
- {
- localized->iLunarFestival.Set( iLunarFestivalNames->MdcaPoint( aInfo.iLunarFestival ) );
- }
-
- if ( aInfo.HasSolarFestival() )
- {
- localized->iSolarFestival.Set( iSolarFestivalNames->MdcaPoint( aInfo.iSolarFestival ) );
- }
-
- if ( aInfo.HasSolarTerm() )
- {
- localized->iSolarTerm.Set( iSolarTermNames->MdcaPoint( aInfo.iSolarTerm ) );
- }
-
- LocalizeMonthAndDayL(localized, aInfo);
-
- aInfo.iGregorianDate.FormatL( localized->iGregorianDate,
- *iGregorianDateFormat );
- CleanupStack::Pop( localized );
-
- TRACE_EXIT_POINT;
- return localized;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizer::GetExtraRowTextL()
-// ---------------------------------------------------------------------------
-//
-TPtrC CCalenLunarLocalizer::GetExtraRowTextL( CCalenLunarLocalizedInfo& aLocInfo,
- TInt aMaxWidth, const CFont& aFont
-#ifdef RD_CALENDAR_PREVIEW
- , TBool aTwoLines
-#endif // RD_CALENDAR_PREVIEW
- )
- {
- TRACE_ENTRY_POINT;
-
- RArray<CCalenLunarLocalizedInfo::TField> fields;
- CleanupClosePushL( fields );
-
- fields.AppendL( CCalenLunarLocalizedInfo::ELunarMonthAndDay ); //1st priority
- fields.AppendL( CCalenLunarLocalizedInfo::ESolarFestival ); //2nd priority
- fields.AppendL( CCalenLunarLocalizedInfo::ELunarFestival ); //3rd priority
- fields.AppendL( CCalenLunarLocalizedInfo::ESolarTerm ); //4th priority
-
- TPtrC text = iRowFormatter->FormatExtraRowInformationL( aLocInfo, fields, aMaxWidth, aFont
-#ifdef RD_CALENDAR_PREVIEW
- , aTwoLines
-#endif // RD_CALENDAR_PREVIEW
- );
- CleanupStack::PopAndDestroy( &fields );
-
- TRACE_EXIT_POINT;
- return text;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarLocalizer::LocalizeMonthAndDayL()
-// ---------------------------------------------------------------------------
-//
-void CCalenLunarLocalizer::LocalizeMonthAndDayL( CCalenLunarLocalizedInfo* aLocInfo,
- TCalenLunarInfo& aInfo )
- {
- TRACE_ENTRY_POINT;
-
- TInt dateResource = R_CALE_KOR_LUNAR_DATE;
- HBufC* lunar_indicator_year = StringLoader::LoadLC( R_CALE_KOR_LUNAR_INDICATOR );
- HBufC* lunar_leap_year = StringLoader::LoadLC( R_CALE_KOR_LEAP_YEAR_INDICATOR );
-
- TBuf16<2> month;
- TBuf16<2> day;
- HBufC* lunar_indicator_buf = HBufC::NewLC(lunar_indicator_year->Length()+lunar_leap_year->Length());
- lunar_indicator_buf->Des().Append(*lunar_indicator_year);
- TPtr lunar_indicator = lunar_indicator_buf->Des();
-
- if ( aInfo.iLunarDate.iLeapMonth )
- {
- lunar_indicator.Append(*lunar_leap_year);
- }
-
- month.AppendNum( aInfo.iLunarDate.iMonth );
- day.AppendNum( aInfo.iLunarDate.iDay );
-
- CPtrCArray* monthAndDaySubs = new (ELeave) CPtrCArray(3);
- CleanupStack::PushL( monthAndDaySubs );
-
- monthAndDaySubs->AppendL( lunar_indicator );
- monthAndDaySubs->AppendL( month );
- monthAndDaySubs->AppendL( day );
-
- HBufC* tmp = StringLoader::LoadLC( dateResource, *monthAndDaySubs );
- aLocInfo->iLunarMonthAndDay = *tmp;
- CleanupStack::PopAndDestroy( tmp );
- CleanupStack::PopAndDestroy( monthAndDaySubs );
-
- CleanupStack::PopAndDestroy( lunar_indicator_buf );
- CleanupStack::PopAndDestroy( lunar_leap_year );
- CleanupStack::PopAndDestroy( lunar_indicator_year );
-
- TRACE_EXIT_POINT;
- }
-
-// End of file
--- a/calendarui/regionalplugins/KoreanLunar/src/CalenLunarPluginProxy.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,54 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-//debug
-#include "calendarui_debug.h"
-
-//user includes
-#include "CalenLunarPluginUids.hrh"
-#include "CalenKoreanLunarPlugin.h"
-
-//system includes
-#include <e32std.h>
-#include <ecom/implementationproxy.h>
-
-// ---------------------------------------------------------------------------
-// ImplementationTable()
-// ---------------------------------------------------------------------------
-//
-const TImplementationProxy ImplementationTable[] =
- {
- IMPLEMENTATION_PROXY_ENTRY( CALENKOREANLUNARPLUGIN_IMPLEMENTATION_UID,
- CCalenKoreanLunarPlugin::CreateKoreanPluginL )
- };
-
-// ---------------------------------------------------------------------------
-// ImplementationGroupProxy()
-// This should be only exported function of ECom plugin DLL
-// ---------------------------------------------------------------------------
-//
-EXPORT_C const TImplementationProxy* ImplementationGroupProxy( TInt& aTableCount )
- {
- TRACE_ENTRY_POINT;
-
- aTableCount = sizeof( ImplementationTable) / sizeof(TImplementationProxy);
-
- TRACE_EXIT_POINT;
- return ImplementationTable;
- }
-
-// End of file
--- a/calendarui/regionalplugins/KoreanLunar/src/CalenLunarSettingItem.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,106 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-//debug
-#include "calendarui_debug.h"
-//User includes
-#include "CalenLunarSettingItem.h"
-#include "CalenKoreanLunarPlugin.h"
-
-//system includes
-#include <CalenKoreanLunarPluginData.rsg>
-#include <StringLoader.h>
-
-const TInt KLunarSettingItemId = 55000; //FIXME does this has to be globally unique ?
-
-// ======== MEMBER FUNCTIONS ========
-
-
-// ---------------------------------------------------------------------------
-// CCalenLunarSettingItem::NewLC()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarSettingItem* CCalenLunarSettingItem::NewLC( TInt aOrdinal,
- CCalenKoreanLunarPlugin& aPlugin )
- {
- TRACE_ENTRY_POINT;
-
- CCalenLunarSettingItem* self = new (ELeave) CCalenLunarSettingItem( aPlugin );
- CleanupStack::PushL(self);
- // Construct setting item with parametrized values
- HBufC* itemTitle = StringLoader::LoadLC(R_CALEN_LUNAR_SETTING_TITLE2);
- self->ConstructL( EFalse, aOrdinal, *itemTitle, NULL,
- R_CALEN_LUNAR_SETTING_PAGE, EAknCtPopupSettingList,
- NULL, R_CALEN_LUNAR_SETTING_TEXTS);
- CleanupStack::PopAndDestroy( itemTitle );
- // no pop, because this is NewLC
-
- TRACE_EXIT_POINT;
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarSettingItem::CCalenLunarSettingItem()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarSettingItem::CCalenLunarSettingItem( CCalenKoreanLunarPlugin& aPlugin )
- : CAknBinaryPopupSettingItem( KLunarSettingItemId, iLunarEnabled ),
- iPlugin( aPlugin )
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarSettingItem::~CCalenLunarSettingItem()
-// ---------------------------------------------------------------------------
-//
-CCalenLunarSettingItem::~CCalenLunarSettingItem()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarSettingItem::StoreL()
-// ---------------------------------------------------------------------------
-//
-void CCalenLunarSettingItem::StoreL()
- {
- TRACE_ENTRY_POINT;
-
- CAknBinaryPopupSettingItem::StoreL();
- iPlugin.StoreEnabledStatusL( iLunarEnabled );
-
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenLunarSettingItem::LoadL()
-// ---------------------------------------------------------------------------
-//
-void CCalenLunarSettingItem::LoadL()
- {
- TRACE_ENTRY_POINT;
-
- iLunarEnabled = iPlugin.LoadEnabledStatusL();
- CAknBinaryPopupSettingItem::LoadL();
-
- TRACE_EXIT_POINT;
- }
-
-// End of file
--- a/calendarui/regionalplugins/KoreanLunar/src/CalenSolarTerms.cpp Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,197 +0,0 @@
-/*
-* Copyright (c) 2002-2004 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 : Class looking after alarm fields for forms.
-*
-*/
-
-//debug
-#include "calendarui_debug.h"
-
-//user includes
-#include "CalenSolarTerms.h"
-#include "CalenLunarPaths.h"
-
-//system includes
-#include <f32file.h>
-#include <s32file.h>
-
-
-// CONSTANTS
-_LIT( KSolarTermsFile, "KoreanSolarItems" );
-const TInt KFirstSolarTermYear( 1900 );
-const TInt KLastSolarTermYear( 2100 );
-
-
-// ======== MEMBER FUNCTIONS ========
-
-
-// ---------------------------------------------------------------------------
-// CCalenSolarTerms::NewL()
-// ---------------------------------------------------------------------------
-//
-CCalenSolarTerms* CCalenSolarTerms::NewL( RFs& aFs )
- {
- TRACE_ENTRY_POINT;
-
- CCalenSolarTerms* self = new (ELeave) CCalenSolarTerms(aFs);
- CleanupStack::PushL( self );
- self->ConstructL();
- CleanupStack::Pop( self );
-
- TRACE_EXIT_POINT;
- return self;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenSolarTerms::~CCalenSolarTerms()
-// ---------------------------------------------------------------------------
-//
-CCalenSolarTerms::~CCalenSolarTerms()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenSolarTerms::CheckSolarTermDateL()
-// ---------------------------------------------------------------------------
-//
-TInt CCalenSolarTerms::CheckSolarTermDateL( const TDateTime& aDate )
- {
- TRACE_ENTRY_POINT;
-
- ReadSolarTermsL( aDate );
- if ( HasSolarTermDataAvailable( aDate ) )
- {
- // Solar festival data is available for this date
- for ( TInt i( 0 ); i < KSolarTermCount; i++ )
- {
- TDateTime date = iSolarTermDates[i];
- if ( aDate.Month() == date.Month() && aDate.Day() == date.Day() )
- {
- // First item in iSolarTermNames is LiChun ("Spring begins")
- // occuring around 4.2 in western year.
- // It is first solar term in Chinese Lunar year, but it's
- // third term in western year.
- //
- // iSolarTermDates list terms from beginning of western year,
- // that's why we subtract 2 and take modulo 24 here, to convert
- // order from
- // Xiao Han (~ 6.1.), Da Han (~22.1), Li Chun (~4.2)...
- // to
- // Li Chun (~4.2.), ..., ..., Da Han (~22.1)
- i += KSolarTermCount - 2;
- TInt foundIndex = i % KSolarTermCount;
-
- TRACE_EXIT_POINT;
- return foundIndex;
- }
- }
- TRACE_EXIT_POINT;
- return KErrNotFound;
- }
- else
- {
- // Solar festival data is NOT available for this date
- TRACE_EXIT_POINT;
- return KErrNotSupported;
- }
- }
-
-// ---------------------------------------------------------------------------
-// CCalenSolarTerms::CCalenSolarTerms()
-// ---------------------------------------------------------------------------
-//
-CCalenSolarTerms::CCalenSolarTerms( RFs& aFs ) : iFs( aFs )
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenSolarTerms::ConstructL()
-// ---------------------------------------------------------------------------
-//
-void CCalenSolarTerms::ConstructL()
- {
- TRACE_ENTRY_POINT;
- TRACE_EXIT_POINT;
- }
-
-// ---------------------------------------------------------------------------
-// CCalenSolarTerms::HasSolarTermDataAvailable()
-// ---------------------------------------------------------------------------
-//
-TBool CCalenSolarTerms::HasSolarTermDataAvailable( const TDateTime& aDate ) const
- {
- TRACE_ENTRY_POINT;
-
- // Note: day parameter for TDateTime starts from 0, not from 1
- const TDateTime KMinAvailable( KFirstSolarTermYear, EJanuary, 0, 0, 0, 0, 0 );
- const TDateTime KMaxAvailable( KLastSolarTermYear, EDecember, 31 - 1, 23, 59, 59, 0 );
-
- TRACE_EXIT_POINT;
- return TTime( KMinAvailable ) <= TTime( aDate ) &&
- TTime( aDate ) <= TTime( KMaxAvailable );
- }
-
-// ---------------------------------------------------------
-// CCalenSolarTerms::ReadSolarTermsL()
-// Reads and caches 24 solar term dates for one year
-// from "SolarItems" file
-// ---------------------------------------------------------
-//
-void CCalenSolarTerms::ReadSolarTermsL( TDateTime aDate )
- {
- TRACE_ENTRY_POINT;
-
- // Caches one year of solar items
- if ( ! HasSolarTermDataAvailable( aDate ) )
- {
- return;
- }
-
- TInt year = aDate.Year();
-
- if ( iCachedYear != year )
- {
- RFile file;
- RFs& fs = iFs;
- TFindFile ffile( fs );
- User::LeaveIfError( ffile.FindByDir( KSolarTermsFile, KSolarTermsPath ) );
- User::LeaveIfError( file.Open( fs, ffile.File(), EFileRead ) );
- CleanupClosePushL( file );
-
- TInt seekPos =
- ( year - KFirstSolarTermYear ) * sizeof( TUint8 ) * KSolarTermCount;
-
- RFileReadStream readStream( file, seekPos );
- readStream.PushL();
-
- for ( TInt i( 0 ); i < KSolarTermCount; i++ )
- {
- TMonth month = static_cast<TMonth>( EJanuary + (i / 2) );
- TInt day = readStream.ReadUint8L();
- TDateTime dt( year, month, day-1, 0, 0, 0, 0 );
- iSolarTermDates[i] = dt;
- }
-
- CleanupStack::PopAndDestroy( 2 ); // readStream, file
- iCachedYear = year;
- }
-
- TRACE_EXIT_POINT;
- }
-
-// End of file
--- a/calendarui/rom/caldav.iby Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
-/*
- * This component and the accompanying materials are made available
- * under the terms of the License "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:
- * Maximilian Odendahl, Sun Microsystems, Inc.
- *
- * Contributors:
- *
- * Description: iby file to include Caldav into rom
- *
- */
-
-
-
-#ifndef CALDAV_IBY
-#define CALDAV_IBY
-
-#ifdef FF_CALDAV_SUPPORT
-file=ABI_DIR\BUILD_DIR\CalDavClient.dll SHARED_LIB_DIR\CalDavClient.dll
-file=ABI_DIR\BUILD_DIR\!CalDavServer.exe PROGRAMS_DIR\!CalDavServer.exe
-
-ECOM_PLUGIN( calencaldavplugin.dll , calencaldavplugin.rsc )
-
-data=DATAZ_\RESOURCE_FILES_DIR\calencaldavplugindata.rsc RESOURCE_FILES_DIR\calencaldavplugindata.rsc
-#endif //FF_CALDAV_SUPPORT
-
-#endif // CALDAV_IBY
-
-// End of File
\ No newline at end of file
--- a/calendarui/server/CalenSvr/src/CalenServer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/server/CalenSvr/src/CalenServer.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -655,7 +655,7 @@
TPckgC<TBool> pkgMarkAsDelete(markAsdelete);
TRAPD(err,pkgMarkAsDelete.Set(calendarInfo->PropertyValueL(keyBuff)));
markAsdelete = pkgMarkAsDelete();
- if( markAsdelete && (err == KErrNone))
+ if( markAsdelete && err == KErrNone )
{
// Mark the CalFile as visible.
calendarInfo->SetEnabled( ETrue );
@@ -692,4 +692,5 @@
}
TRACE_EXIT_POINT;
}
+
// End of File
--- a/calendarui/views/inc/caleneventviewcontainer.h Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/inc/caleneventviewcontainer.h Wed Oct 13 14:30:35 2010 +0300
@@ -349,11 +349,6 @@
void AddDateFieldL( TInt aHeadingResource, const TTime& aDate );
/**
- * Add a date field to the form.
- */
- void AddDateFieldL( const TDesC& aDate );
-
- /**
* Add a "date - date" field to the form.
*/
void AddDateDateFieldL( const TTime& aStartDate, const TTime& aEndDate );
@@ -488,7 +483,7 @@
* Checks if user has tapped on the attahcment names and then opens the corresponding
* attachment
*/
- void CheckAndOpenTappedAttachmentL(TTmPosInfo2* posInfo);
+ void CheckAndOpenTappedAttachment(TTmPosInfo2* posInfo);
/**
* Opens the respective atatchment tapped
@@ -587,11 +582,6 @@
CDocumentHandler* iDocHandler;
RArray<TTextPos> iAttachmentPosInfoArray; // Array of start and end positions of each attachment names on the viewer
- /**
- * True if FeatureManager is initialized.
- */
- TBool iFeatMgrInitialized;
-
};
#endif // CALENEVENTCONTAINER_H
\ No newline at end of file
--- a/calendarui/views/src/calencontainer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calencontainer.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -866,8 +866,7 @@
TBool hideItem(EFalse);
if( currentFocusedDayTime.Day() == todayDateTime.Day()
&& currentFocusedDayTime.Month() == todayDateTime.Month()
- && currentFocusedDayTime.Year() == todayDateTime.Year()
- && iView->Id() == KUidCalenDayView )
+ && currentFocusedDayTime.Year() == todayDateTime.Year() )
{
hideItem = ETrue;
}
--- a/calendarui/views/src/calendaycontainer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calendaycontainer.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -279,13 +279,7 @@
SetContextFromHighlightL();
DestroyInstanceListL();
-
- HBufC* emptyText = StringLoader::LoadLC(R_CALEN_QTN_CALE_NO_EVENTS,
- iEikonEnv);
- //Whenever listbox is empty, it will set with this empty text.
- iListBox->View()->SetListEmptyTextL( *emptyText );
- CleanupStack::PopAndDestroy(emptyText);
-
+
iListBox->HandleItemAdditionL(); // Is this causing unnecessary draw?
iListBox->View()->SetDisableRedraw(EFalse);
@@ -1860,22 +1854,30 @@
MCalenContext& context = iServices.Context();
TCalLocalUid instanceId = context.InstanceId().iEntryLocalUid;
- CCalEntry* entry = iServices.EntryViewL(context.InstanceId().iColId)->FetchL(instanceId);
- CleanupStack::PushL(entry);
- CCalGeoValue* geoValue = entry->GeoValueL();
- CleanupStack::PopAndDestroy(entry);
- if(geoValue)
- {
- delete geoValue;
- // Event has saved map location, put "Show on Map"
- TRACE_EXIT_POINT;
- return ETrue;
- }
+ if(instanceId > 0)
+ {
+ CCalEntry* entry = iServices.EntryViewL(context.InstanceId().iColId)->FetchL(instanceId);
+ CleanupStack::PushL(entry);
+ CCalGeoValue* geoValue = entry->GeoValueL();
+ CleanupStack::PopAndDestroy(entry);
+ if(geoValue)
+ {
+ delete geoValue;
+ // Event has saved map location, put "Show on Map"
+ TRACE_EXIT_POINT;
+ return ETrue;
+ }
+ else
+ {
+ TRACE_EXIT_POINT;
+ return EFalse;
+ }
+ }
else
- {
- TRACE_EXIT_POINT;
- return EFalse;
- }
+ {
+ TRACE_EXIT_POINT;
+ return EFalse;
+ }
}
// ----------------------------------------------------------------------------
@@ -1888,16 +1890,19 @@
MCalenContext& context = iServices.Context();
TCalLocalUid instanceId = context.InstanceId().iEntryLocalUid;
- CCalEntry* entry = iServices.EntryViewL(context.InstanceId().iColId)->FetchL(instanceId);
- CleanupStack::PushL(entry);
- TPtrC location = entry->LocationL();
+ TBool ret = EFalse;
+ if(instanceId > 0)
+ {
+ CCalEntry* entry = iServices.EntryViewL(context.InstanceId().iColId)->FetchL(instanceId);
+ CleanupStack::PushL(entry);
+ TPtrC location = entry->LocationL();
+ if(!location.Length())
+ {
+ ret = ETrue;
+ }
+ CleanupStack::PopAndDestroy(entry);
+ }
- TBool ret = EFalse;
- if(!location.Length())
- {
- ret = ETrue;
- }
- CleanupStack::PopAndDestroy(entry);
TRACE_EXIT_POINT;
return ret;
}
--- a/calendarui/views/src/calendaylistbox.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calendaylistbox.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -90,11 +90,14 @@
// FIXME: is this necessary ?
SetBorder(TGulBorder::ENone);
- //set NULL string so that "no entries" is not shown
- //until the list is populated
- View()->SetListEmptyTextL(KNullDesC);
-
- // Create scroll bar
+
+ // Set text for empty listbox
+ HBufC* emptyText = StringLoader::LoadLC(R_CALEN_QTN_CALE_NO_EVENTS,
+ iEikonEnv);
+ View()->SetListEmptyTextL(*emptyText); // ownership transferred
+ CleanupStack::PopAndDestroy(emptyText);
+
+ // Create scroll bar
CreateScrollBarFrameL(ETrue);
ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
--- a/calendarui/views/src/calendayview.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calendayview.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -44,7 +44,7 @@
#include "calendaycontainer.h"
#include "calensend.h"
#include "calentitlepane.h"
-#include <calenlocationutil.h>
+#include "calenlocationutil.h"
#include <CalenInterimUtils2.h>
#include "calendar.hrh"
#include "CalenUid.h"
--- a/calendarui/views/src/caleneventview.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/caleneventview.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -34,7 +34,7 @@
#include "caleneventviewcontainer.h"
#include <calenview.h>
#include "CalenUid.h"
-#include <calenlocationutil.h>
+#include "calenlocationutil.h"
#include "calenentryutil.h"
#include "calendar.hrh"
#include <finditem.hrh>
@@ -901,4 +901,3 @@
}
//end of file
-
--- a/calendarui/views/src/caleneventviewcontainer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/caleneventviewcontainer.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -70,8 +70,6 @@
#include <calcalendarinfo.h>
#include <DocumentHandler.h>
-#include <bldvariant.hrh> // for feature definitions
-
// user includes
#include "caleneventviewcontainer.h"
#include "caleneventview.h"
@@ -162,13 +160,6 @@
//Reset the attachment posiitons array
iAttachmentPosInfoArray.Reset();
- // Do not call UnInitializeLib() if InitalizeLib() leaves.
- if ( iFeatMgrInitialized )
- {
- // Frees the TLS. Must be done after FeatureManager is used.
- FeatureManager::UnInitializeLib();
- }
-
TRACE_EXIT_POINT;
}
@@ -208,12 +199,6 @@
iDocHandler->SetExitObserver( this );
iTextEditor->EnableKineticScrollingL(ETrue);
-
- // Sets up TLS, must be done before FeatureManager is used.
- FeatureManager::InitializeLibL();
- // Used in destructor.
- iFeatMgrInitialized = ETrue;
-
TRACE_EXIT_POINT;
}
@@ -540,7 +525,7 @@
textView->FindXyPosL(aPointerEvent.iPosition,*posInfo);
// Check if it is tapped on any attachment name, if yes then open that attachment
- CheckAndOpenTappedAttachmentL(posInfo);
+ CheckAndOpenTappedAttachment(posInfo);
delete posInfo;
}
}
@@ -827,14 +812,7 @@
case CCalEntry::EAnniv:
{
// date field
- if ( FeatureManager::FeatureSupported( KFeatureIdKorean ) )
- {
- AddDateFieldL( iServices.Infobar() );
- }
- else
- {
- AddDateFieldL( iEventViewData->StartDateTime() );
- }
+ AddDateFieldL(iEventViewData->StartDateTime());
// against the location field in the viewer
iTimeFieldLines = 1;
@@ -1554,29 +1532,6 @@
TRACE_EXIT_POINT;
}
-
-// -----------------------------------------------------------------------------
-// CCalenEventViewContainer::AddDateFieldL
-// Add a date field to the form.
-// (other items were commented in a header).
-// -----------------------------------------------------------------------------
-//
-void CCalenEventViewContainer::AddDateFieldL( const TDesC& aDate )
- {
- TRACE_ENTRY_POINT;
- if (FeatureManager::FeatureSupported( KFeatureIdKorean ))
- {
- TBuf<KMaxDateLength> formattedDate;
- if ( aDate.Length() < KMaxDateLength && aDate.Length() > 0 )
- {
- formattedDate.Copy( aDate );
- }
- AknTextUtils::DisplayTextLanguageSpecificNumberConversion( formattedDate );
- SetFormatAndAddBodyL( formattedDate );
- }
- TRACE_EXIT_POINT;
- }
-
// -----------------------------------------------------------------------------
// CCalenEventViewContainer::AddDateFieldL
// Add a field to the form in the format "DATE - DATE".
@@ -2656,7 +2611,7 @@
// (other items were commented in a header).
// ----------------------------------------------------------------------------
//
-void CCalenEventViewContainer::CheckAndOpenTappedAttachmentL(TTmPosInfo2* posInfo)
+void CCalenEventViewContainer::CheckAndOpenTappedAttachment(TTmPosInfo2* posInfo)
{
// iterate through iAttachmentPosInfoArray to see if posInfo falls in any of the range
TInt attachmentToBeOpened = -1;
--- a/calendarui/views/src/calenmissedalarmscontainer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calenmissedalarmscontainer.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -152,13 +152,6 @@
iListBox->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
iListBox->View()->SetListEmptyTextL( KNullDesC );
iFirstTap = EFalse;
-
- //Set toolbar visibility to false, bcoz this view is not using the ToolBar
- MCalenToolbar* toolbar = iServices.ToolbarOrNull();
- if(toolbar)
- {
- toolbar->SetToolbarVisibilityL(EFalse);
- }
TRACE_EXIT_POINT;
}
@@ -408,17 +401,17 @@
if ( aType == KAknsMessageSkinChange || aType == KEikDynamicLayoutVariantSwitch )
{
- SizeChanged();
- /*TRect main_pane;
- AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, main_pane );
- SetRect( main_pane );
- if(iListBox)
- {
- TRect mainPane;
- AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
- TRect bgContextRect( TPoint(0, 0), mainPane.Size() );
- iListBox->SetRect( bgContextRect );
- }*/
+// SizeChanged();
+ TRect main_pane;
+ AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, main_pane );
+ SetRect( main_pane );
+ if(iListBox)
+ {
+ TRect mainPane;
+ AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
+ TRect bgContextRect( TPoint(0, 0), mainPane.Size() );
+ iListBox->SetRect( bgContextRect );
+ }
// refresh
TRAPD(error,iView->BeginRepopulationL());
--- a/calendarui/views/src/calenmissedalarmsview.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calenmissedalarmsview.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -253,22 +253,12 @@
case EAknSoftkeyBack:
case EAknSoftkeyClose:
{
- MCalenToolbar* toolbar = iServices.ToolbarOrNull();
- if(toolbar)
- {
- toolbar->SetToolbarVisibilityL(ETrue);
- }
iHighlightedRowNumber = 0;
iServices.IssueNotificationL(ECalenNotifyMissedAlarmViewClosed);
}
break;
case EAknSoftkeyExit:
{
- MCalenToolbar* toolbar = iServices.ToolbarOrNull();
- if(toolbar)
- {
- toolbar->SetToolbarVisibilityL(ETrue);
- }
iServices.IssueNotificationL(ECalenNotifyClearMissedAlarms);
CCalenNativeView::HandleCommandL(aCommand);
}
@@ -328,11 +318,12 @@
void CCalenMissedAlarmsView::DoDeactivateImpl()
{
TRACE_ENTRY_POINT;
- /*MCalenToolbar* toolbar = iServices.ToolbarOrNull();
+ MCalenToolbar* toolbar = iServices.ToolbarOrNull();
if(toolbar)
{
toolbar->SetToolbarVisibilityL(ETrue);
- } */
+ }
+
TRACE_EXIT_POINT;
}
--- a/calendarui/views/src/calenmissedeventcontainer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calenmissedeventcontainer.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -63,7 +63,6 @@
#include <calencontext.h>
#include <caleninstanceid.h> // TCalenInstanceId
#include <calenservices.h>
-#include <calentoolbar.h>
// user includes
#include "calenmissedeventcontainer.h"
@@ -73,7 +72,7 @@
#include "calennotedatautil.h"
#include "calenentryutil.h"
#include "CalenUid.h" // KUidCalendar
-#include <calenlocationutil.h>
+#include "calenlocationutil.h"
// LOCAL CONSTANTS AND MACROS
_LIT( KWesternSummaryMarker, "\x200E" );
@@ -177,14 +176,6 @@
iTextEditor->EnableKineticScrollingL(ETrue);
-
- //Set toolbar visibility to false, bcoz this view is not using the ToolBar
- MCalenToolbar* toolbar = iServices.ToolbarOrNull();
- if(toolbar)
- {
- toolbar->SetToolbarVisibilityL(EFalse);
- }
-
TRACE_EXIT_POINT;
}
@@ -509,11 +500,11 @@
( aType == KUidValueCoeZoomChangeEvent ) ||
( aType == KUidValueCoeFontChangeEvent ))
{
- CEikAppUi* appUi = static_cast<CEikAppUi*>( ControlEnv()->AppUi() );
- SetRect( appUi->ClientRect() );
- /*TRect mainPane;
+// CEikAppUi* appUi = static_cast<CEikAppUi*>( ControlEnv()->AppUi() );
+// SetRect( appUi->ClientRect() );
+ TRect mainPane;
AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPane );
- SetRect( mainPane );*/
+ SetRect( mainPane );
}
if(aType == KAknsMessageSkinChange || aType == KEikDynamicLayoutVariantSwitch)
--- a/calendarui/views/src/calenmissedeventview.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calenmissedeventview.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -41,7 +41,7 @@
#include "calenmissedeventcontainer.h"
#include <calenview.h>
#include "CalenUid.h"
-#include <calenlocationutil.h>
+#include "calenlocationutil.h"
#include "calenentryutil.h"
#include "CleanupResetAndDestroy.h"
@@ -155,6 +155,13 @@
{
RedrawStatusPaneL();
}
+
+ //no tool bar in missed event view
+ MCalenToolbar* toolbar = iServices.ToolbarOrNull();
+ if(toolbar && toolbar->IsVisible())
+ {
+ toolbar->SetToolbarVisibilityL(EFalse);
+ }
nextStep = CCalenView::EDone;
}
break;
@@ -253,11 +260,11 @@
TRACE_ENTRY_POINT;
iPreviousViewId.iViewUid = KNullUid;
- /*MCalenToolbar* toolbar = iServices.ToolbarOrNull();
+ MCalenToolbar* toolbar = iServices.ToolbarOrNull();
if(toolbar)
{
toolbar->SetToolbarVisibilityL(ETrue);
- }*/
+ }
TRACE_EXIT_POINT;
@@ -317,30 +324,16 @@
CCalenNativeView::HandleCommandL(aCommand);
}
break;
- case EAknSoftkeyClose:
- {
- MCalenToolbar* toolbar = iServices.ToolbarOrNull();
- if(toolbar)
- {
- toolbar->SetToolbarVisibilityL(ETrue);
- }
- iServices.IssueNotificationL(ECalenNotifyMissedEventViewClosed);
- break;
- }
-
+ case EAknSoftkeyClose:
case EAknSoftkeyBack:
- {
+ {
+
iServices.IssueNotificationL(ECalenNotifyMissedEventViewClosed);
break;
}
case EAknSoftkeyExit:
{
- MCalenToolbar* toolbar = iServices.ToolbarOrNull();
- if (toolbar)
- {
- toolbar->SetToolbarVisibilityL(ETrue);
- }
CCalenNativeView::HandleCommandL(aCommand);
}
break;
--- a/calendarui/views/src/calenmonthcontainer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calenmonthcontainer.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -1228,7 +1228,7 @@
CleanupReleasePushL( *setting ) ;
- if( setting->WeekFormat() == EMonday && setting->WeekNumberEnable() == EWeekNumberOn )
+ if( setting->WeekFormat() == EMonday && setting->WeekNumberEnable() )
{
useWeeks = ETrue;
}
--- a/calendarui/views/src/calentodocontainer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calentodocontainer.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -369,12 +369,15 @@
/*// Save empty text and set null for list box.
// It is made not to display "No data".
- iEmptyListText = iListBox->View()->EmptyListText()->AllocL();*/
+ iEmptyListText = iListBox->View()->EmptyListText()->AllocL();
+ //iListBox->View()->SetListEmptyTextL( KNullDesC );*/
- //set NULL string so that "no entries" is not shown
- //until the list is populated
- iListBox->View()->SetListEmptyTextL( KNullDesC );
-
+ // Set text for empty listbox
+ HBufC* emptyText = StringLoader::LoadLC(R_CALEN_QTN_CALE_NO_EVENTS,
+ iEikonEnv);
+ iListBox->View()->SetListEmptyTextL( *emptyText ); //Whenever listbox is empty, it will set with this empty text.
+ CleanupStack::PopAndDestroy(emptyText);
+
TRACE_EXIT_POINT;
}
@@ -573,13 +576,7 @@
CleanupStack::PopAndDestroy( listDes );
CleanupStack::PopAndDestroy( &calendarInfoList );
iListBox->HandleItemAdditionL();
-
- //Whenever listbox is empty, it will set with this empty text.
- HBufC* emptyText = StringLoader::LoadLC(R_CALEN_QTN_CALE_NO_EVENTS,
- iEikonEnv);
- iListBox->View()->SetListEmptyTextL( *emptyText );
- CleanupStack::PopAndDestroy(emptyText);
-
+ //iListBox->View()->SetListEmptyTextL( *iEmptyListText );
TRACE_EXIT_POINT;
}
@@ -1251,7 +1248,6 @@
// Now we know if the view is empty or not we can update the CBA buttons.
static_cast<CCalenTodoView*>( iView )->UpdateCBAButtonsL();
UpdateStatusPaneAndExtensionsL();
- UpdateTodayToolbarItemL();
TRACE_EXIT_POINT;
}
--- a/calendarui/views/src/calentodoview.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calentodoview.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -584,7 +584,7 @@
{
if( Container()->MarkedCount() )
{
- aMenuPane->SetItemSpecific( ECalenDeleteCurrentEntry, EFalse );
+ aMenuPane->SetItemSpecific( ECalenDeleteCurrentEntry, ETrue );
if(Container()->IsCurrentItemSelected()) // If focused list item is marked
{
aMenuPane->DeleteMenuItem( ECalenViewCurrentEntry );
@@ -593,30 +593,24 @@
aMenuPane->DeleteMenuItem( ECalenCompleteTodo );
aMenuPane->DeleteMenuItem( ECalenRestoreTodo );
aMenuPane->DeleteMenuItem( ECalenSend );
-
+ aMenuPane->DeleteMenuItem(ECalenCopyToCalendars);
+
+ TBool crossout( EFalse );
+ //When mark as done, crossout is ETrue.
+ crossout = CheckMarkedItemCompletedL();
+ if( crossout )
+ {
+ aMenuPane->SetItemSpecific(ECalenMarkUnDone, ETrue);
+ }
+ else
+ {
+ aMenuPane->SetItemSpecific(ECalenMarkDone, ETrue);
+ }
+
if(Container()->MarkedCount() == 1)
{
aMenuPane->DeleteMenuItem( ECalenCmdComplete );
- TBool crossout( EFalse );
- crossout = CheckMarkedItemCompletedL();
- if( crossout )
- {
- aMenuPane->DeleteMenuItem( ECalenMarkDone );
- }
- else
- {
- aMenuPane->DeleteMenuItem( ECalenMarkUnDone );
- }
}
- else
- {
- aMenuPane->DeleteMenuItem( ECalenMarkDone );
- aMenuPane->DeleteMenuItem( ECalenMarkUnDone );
- }
- if(Container()->MarkedCount() > 1)
- {
- aMenuPane->DeleteMenuItem( ECalenCopyToCalendars );
- }
}
else
{
@@ -735,14 +729,14 @@
RedrawStatusPaneL(); // Set a text to title pane.
- /*MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull();
+ MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull();
if(toolbarImpl)
{
CAknToolbar& toolbar = toolbarImpl->Toolbar();
// dim clear and clear all toolbar buttons
toolbar.SetItemDimmed(ECalenGotoToday,ETrue,ETrue);
- }*/
+ }
iEventViewCommandHandled = EFalse;
TRACE_EXIT_POINT;
@@ -757,7 +751,7 @@
{
TRACE_ENTRY_POINT;
- /*MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull();
+ MCalenToolbar* toolbarImpl = iServices.ToolbarOrNull();
if(toolbarImpl)
{
CAknToolbar& toolbar = toolbarImpl->Toolbar();
@@ -767,7 +761,7 @@
// dim clear and clear all toolbar buttons
toolbar.SetItemDimmed(ECalenGotoToday,EFalse,ETrue);
}
- }*/
+ }
// Remove all markings when the view is deactivated.
static_cast< CCalenTodoContainer* > ( iContainer )->MarkAllL(
--- a/calendarui/views/src/calenweeklistboxdata.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/calendarui/views/src/calenweeklistboxdata.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -214,7 +214,7 @@
const TDesC* aText, // Drawing item text
const TRect& aItemRect, // Item rectangle
const TColors& aColors, // Item colors
- TBool /*aHighlight */) const
+ TBool aHighlight ) const
{
TRACE_ENTRY_POINT;
@@ -227,7 +227,7 @@
TInt lastSubCell(CellCount() - 1);
// mark highlight as "not done" only if we need to draw the highlight
-// TBool highlightDone( aHighlight ? EFalse : ETrue );
+ TBool highlightDone( aHighlight ? EFalse : ETrue );
if(!font)
{
@@ -277,12 +277,11 @@
aGc.SetBrushStyle(CGraphicsContext::ENullBrush);
}
- //Focus is removed in Week View
- /*if(!highlightDone && aHighlight
+ if(!highlightDone && aHighlight
&& subcell == iHilightedSubCell+1)
{
highlightDone = DrawHighlight( bRect, aGc, ETrue );
- }*/
+ }
switch(hourData.DataType())
{
@@ -298,12 +297,11 @@
break;
}
- //Focus is removed in Week View
// draw non-skinned highlight
- /*if(!highlightDone && aHighlight && subcell == iHilightedSubCell +1)
+ if(!highlightDone && aHighlight && subcell == iHilightedSubCell +1)
{
highlightDone = DrawHighlight( bRect, aGc, EFalse );
- }*/
+ }
}
break;
--- a/clock2/clockengines/clocknitzplugin/inc/clocknitzlistener.h Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockengines/clocknitzplugin/inc/clocknitzlistener.h Wed Oct 13 14:30:35 2010 +0300
@@ -70,6 +70,12 @@
* @return an error code
*/
TInt GetCurrentNITZInfoL( RMobilePhone::TMobilePhoneNITZ& aNitzInfo );
+
+ /**
+ * @brief Gets the available NITZ information.Notifiy any client in case NITZ info
+ * is already available with telephony server.
+ */
+ void FetchDataIfAlreadyAvailableL();
/**
* @brief Notifies the observer whenever the NITZ information changes
--- a/clock2/clockengines/clocknitzplugin/inc/clocknitzplugin.h Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockengines/clocknitzplugin/inc/clocknitzplugin.h Wed Oct 13 14:30:35 2010 +0300
@@ -74,6 +74,11 @@
TInt GetPluginUid();
/**
+ * @brief Get the data if available already.
+ */
+ void GetDataIfAlreadyAvailableL();
+
+ /**
* @brief Notifies any client in case NITZ info is received
*/
void NotifyNITZInfoChangeL();
--- a/clock2/clockengines/clocknitzplugin/inc/clocknitzpluginimpl.h Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockengines/clocknitzplugin/inc/clocknitzpluginimpl.h Wed Oct 13 14:30:35 2010 +0300
@@ -71,6 +71,11 @@
*/
void NotifyNITZInfoChangeL();
+ /**
+ * @brief Gets the available NITZ information
+ */
+ void GetDataIfAlreadyAvailableL();
+
private: // New functions
/**
--- a/clock2/clockengines/clocknitzplugin/src/clocknitzlistener.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockengines/clocknitzplugin/src/clocknitzlistener.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -139,6 +139,51 @@
}
// ---------------------------------------------------------
+// CClockNitzListener::FetchDataIfAlreadyAvailableL
+// rest of the details are commented in the header
+// ---------------------------------------------------------
+//
+void CClockNitzListener::FetchDataIfAlreadyAvailableL()
+ {
+
+ __PRINTS( "CClockNitzListener::FetchDataIfAlreadyAvailableL - Entry" );
+
+ //Get the NITZ information if it is already available
+ TInt retVal( KErrNone );
+ retVal = iPhone.GetNITZInfo(iNitzInfo);
+ __PRINT( "CClockNitzListener::FetchDataIfAlreadyAvailableL GetNITZInfo : errorVal %d", retVal);
+
+ if( KErrNone == retVal )
+ {
+ // Check if the contents of the NITZ packet are valid.
+ // i.e if you can construct a TDateTime object using NITZ info.
+ TDateTime dateTime;
+ dateTime.Set( iNitzInfo.Year(),
+ TMonth( iNitzInfo.Month() ),
+ iNitzInfo.Day(),
+ iNitzInfo.Hour(),
+ iNitzInfo.Minute(),
+ iNitzInfo.Second(),
+ iNitzInfo.MicroSecond() );
+
+ __PRINT( "CClockNitzListener::Nitz year %d",iNitzInfo.Year() );
+ __PRINT( "CClockNitzListener::Nitz month %d",iNitzInfo.Month() );
+ __PRINT( "CClockNitzListener::Nitz day %d",iNitzInfo.Day() );
+ __PRINT( "CClockNitzListener::Nitz Hour %d",iNitzInfo.Hour() );
+ __PRINT( "CClockNitzListener::Nitz Minute %d",iNitzInfo.Minute() );
+ __PRINT( "CClockNitzListener::Nitz Second %d",iNitzInfo.Second() );
+
+ if( KErrNone == CheckDateTimeVal( dateTime ) )
+ {
+ __PRINTS( "CClockNitzListener::FetchDataIfAlreadyAvailableL : Valid NitzInfo available. Notify the observer");
+ // We have valid NitzInfo. Notify the observer
+ NotifyObserverL();
+ }
+ }
+
+ __PRINTS( "CClockNitzListener::FetchDataIfAlreadyAvailableL - Exit" );
+ }
+// ---------------------------------------------------------
// CClockNitzListener::RunL
// rest of the details are commented in the header
// ---------------------------------------------------------
--- a/clock2/clockengines/clocknitzplugin/src/clocknitzplugin.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockengines/clocknitzplugin/src/clocknitzplugin.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -136,6 +136,25 @@
}
// ---------------------------------------------------------
+// CClockNitzPlugin::GetDataIfAvailable
+// rest of the details are commented in the header
+// ---------------------------------------------------------
+//
+void CClockNitzPlugin::GetDataIfAlreadyAvailableL()
+ {
+ __PRINTS( "CClockNitzPlugin::GetDataIfAlreadyAvailableL - Entry" );
+
+ if( iNitzPluginImpl )
+ {
+ // Get the Nitz data if it is available
+ iNitzPluginImpl->GetDataIfAlreadyAvailableL();
+ }
+
+ __PRINTS( "CClockNitzPlugin::GetDataIfAlreadyAvailableL - Exit" );
+
+ }
+
+// ---------------------------------------------------------
// CClockNitzPlugin::NotifyNITZInfoChangeL
// rest of the details are commented in the header
// ---------------------------------------------------------
--- a/clock2/clockengines/clocknitzplugin/src/clocknitzpluginimpl.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockengines/clocknitzplugin/src/clocknitzpluginimpl.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -246,6 +246,24 @@
}
// ---------------------------------------------------------
+// CClockNitzPluginImpl::GetDataIfAlreadyAvailable
+// rest of the details are commented in the header
+// ---------------------------------------------------------
+//
+void CClockNitzPluginImpl::GetDataIfAlreadyAvailableL()
+ {
+ __PRINTS( "CClockNitzPluginImpl::GetDataIfAlreadyAvailableL - Entry" );
+
+ // Fetch the Nitz information if it is already available
+ if( iNitzSrv )
+ {
+ iNitzSrv->FetchDataIfAlreadyAvailableL();
+ }
+
+ __PRINTS( "CClockNitzPluginImpl::GetDataIfAlreadyAvailableL - Exit" );
+ }
+
+// ---------------------------------------------------------
// CClockNitzPluginImpl::NotifyNITZInfoChange
// rest of the details are commented in the header
// ---------------------------------------------------------
--- a/clock2/clockengines/clockserver/server/src/clockserverimpl.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockengines/clockserver/server/src/clockserverimpl.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -174,6 +174,33 @@
for( TInt index( KZeroIndex ); index < count; index++ )
{
returnVal = ActivateProtocolL( plugInArray[ index ]->ImplementationUid().iUid );
+ if(returnVal == KErrNone)
+ {
+ // Let's fetch the data if already available.Here we are fetching the NITZ
+ // data from telephony server for first boot only, first time NITZ data is reliable.
+ // First Boot NITZ data would be used by adtupdater application.
+ // Get the first boot status from cenrep. If it is the first boot, get the NITZ packet already available
+ TBool staleBoot( EFalse );
+
+ CRepository* cenRep( NULL );
+
+ TRAPD( errorVal, cenRep = CRepository::NewL( KCRUidStartup ) );
+
+ if( errorVal == KErrNone )
+ {
+ errorVal = cenRep->Get( KStartupFirstBoot, staleBoot );
+ }
+
+ // Cleanup.
+ delete cenRep;
+ cenRep = NULL;
+
+ if(!staleBoot)
+ {
+ iTimeSourceObjArray[index]->GetDataIfAlreadyAvailableL();
+ }
+
+ }
}
// Cleanup.
plugInArray.ResetAndDestroy();
--- a/clock2/clockengines/clocktimesourceinterface/group/clocktimesourceinterface.mmp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockengines/clocktimesourceinterface/group/clocktimesourceinterface.mmp Wed Oct 13 14:30:35 2010 +0300
@@ -24,7 +24,7 @@
UID 0x1000008d 0x200159A3
// Capability and vendor info
-CAPABILITY CAP_GENERAL_DLL
+CAPABILITY ALL -TCB
VENDORID VID_DEFAULT
// Source files
--- a/clock2/clockengines/clocktimesourceinterface/inc/clocktimesourceinterface.h Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockengines/clocktimesourceinterface/inc/clocktimesourceinterface.h Wed Oct 13 14:30:35 2010 +0300
@@ -74,6 +74,11 @@
* @return TInt The Uid of the plugin.
*/
IMPORT_C virtual TInt GetPluginUid() = 0;
+
+ /**
+ * @brief Gets the time attributes if it is already available with source.
+ */
+ virtual void GetDataIfAlreadyAvailableL() = 0;
private: // New functions
--- a/clock2/clockengines/clocktimezoneresolver/group/clocktimezoneresolver.mmp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockengines/clocktimezoneresolver/group/clocktimezoneresolver.mmp Wed Oct 13 14:30:35 2010 +0300
@@ -24,7 +24,7 @@
UID 0x1000008d 0x200159A4
// Capability and vendor info
-CAPABILITY CAP_GENERAL_DLL
+CAPABILITY ALL -TCB
VENDORID VID_DEFAULT
// Source files
--- a/clock2/clockui/adtupdater/group/adtupdater.mmp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/adtupdater/group/adtupdater.mmp Wed Oct 13 14:30:35 2010 +0300
@@ -26,7 +26,7 @@
// Uid and Capability information
UID 0x100039CE 0x2001114C
-CAPABILITY CAP_APPLICATION
+CAPABILITY CAP_APPLICATION AllFiles SwEvent
// Stack options
EPOCSTACKSIZE 0x10000
--- a/clock2/clockui/adtupdater/inc/adtupdaterappui.h Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/adtupdater/inc/adtupdaterappui.h Wed Oct 13 14:30:35 2010 +0300
@@ -69,17 +69,10 @@
void ToggleAppViewL( TBool aForeground );
/**
- * @brief Checks whether adtupdater app is in background by window group id
+ * @brief Checks whether app is in background by window group id
* @return ETrue if the application is in background and EFalse if it is in foreground.
- */
+ */
TBool IsAppInBackground();
-
- /**
- * @brief Checks whether any high priority window like call is active.
- * @return ETrue if the high priority window is active and EFalse otherwise.
- */
- TBool IsHighPriorityWindowActive();
-
/**
* @brief Hides the status pane of the application.
* @param aHide ETrue if status pane has to be hidden.
@@ -100,13 +93,9 @@
* @brief The container object.
*/
CAdtUpdaterContainer* iContainer;
-
private:
+ // the id of the application's window group
- /**
- * @var iAdtWgId
- * @brief The id of the application's window group.
- */
TInt iAdtWgId;
};
--- a/clock2/clockui/adtupdater/inc/adtupdatercontainer.h Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/adtupdater/inc/adtupdatercontainer.h Wed Oct 13 14:30:35 2010 +0300
@@ -345,12 +345,6 @@
* @return TBool
*/
TBool PredictiveTimeEnabled();
-
- /**
- * @brief Checks if automatic time update is ON
- * @return TBool ETrue : if automatic time update is ON
- */
- TBool isAutomaticTimeUpdateON();
private: //Data members
@@ -446,6 +440,7 @@
*/
TBool iNitzTimerActive;
+
};
#endif // __ADTUPDATER_CONTAINER_H__
--- a/clock2/clockui/adtupdater/src/adtupdaterappui.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/adtupdater/src/adtupdaterappui.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -28,10 +28,6 @@
const TInt KOrdinalPosition( 0 );
const TInt KOrdinalPriority( 0 );
-// Uid of phoneapp
-const TUid KPhoneUid = {0x100058B3};
-
-
// Literals
// ---------------------------------------------------------
@@ -168,30 +164,6 @@
}
// ---------------------------------------------------------
-// CAdtUpdaterAppUi::IsHighPriorityWindowActive
-// rest of the details are commented in the header
-// ---------------------------------------------------------
-//
-TBool CAdtUpdaterAppUi::IsHighPriorityWindowActive()
- {
- __PRINTS( "CCAdtUpdaterAppUi::IsHighPriorityWindowActive - Entry" );
- // Gets the window group id of the app coming in foreground
- TInt activeWgId = iCoeEnv->WsSession().GetFocusWindowGroup();
- TApaTaskList taskList(iCoeEnv->WsSession());
-
- //In future, if any other high priority window will be there, then
- //add that particular UID in the below check.
- //Note: Key Lock and alarm are not handled here as these windows already
- //have high priority than CDT. In callui window group, the window - when
- //call is answered, has a low priority, that's why callui is handled here.
- __PRINTS( "CCAdtUpdaterAppUi::IsHighPriorityWindowActive - Exit" );
- if(activeWgId == taskList.FindApp(KPhoneUid).WgId())
- {
- return ETrue;
- }
- return EFalse;
- }
-// ---------------------------------------------------------
// CAdtUpdaterAppUi::ToggleAppViewL
// rest of the details are commented in the header
// ---------------------------------------------------------
--- a/clock2/clockui/adtupdater/src/adtupdatercontainer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/adtupdater/src/adtupdatercontainer.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -59,7 +59,7 @@
const TInt KFirstBootDone( 1 );
const TInt KTimeFormatLength( 16 ); // "20070000:090000."
const TInt KMaxMobileCountryCode( 4 );
-const TInt KCDTQueryTimer( 2000000 ); // 2 seconds
+const TInt KCDTQueryTimer( 5000000 ); // 5 seconds
const TInt KAppBackgroundInterval( 2000000 ); // 2 seconds
// Literals
@@ -178,7 +178,7 @@
iNitzTimerActive = EFalse;
- ActivateL();
+ ActivateL();
__PRINTS( "CAdtUpdaterContainer::ConstructL - Exit" );
}
@@ -407,19 +407,13 @@
}
else//CDT Query timer is active.
{
- if(selfObject->iAdtUpdaterAppUi->IsHighPriorityWindowActive())
+ //For every 2 sec, until ADTUpdater exits, we will check whether app is in background
+ //and bring to foreground.
+ if(selfObject->QueryDialogsInDisplay() && selfObject->iAdtUpdaterAppUi->IsAppInBackground())
{
- //If any high priority window is active, we push the CDT to background.
- selfObject->iAdtUpdaterAppUi->ToggleAppViewL(EFalse);
- }
- else if(selfObject->QueryDialogsInDisplay() && selfObject->iAdtUpdaterAppUi->IsAppInBackground()
- && !selfObject->iAdtUpdaterAppUi->IsHighPriorityWindowActive())
- {
- //For every 2 sec, until ADTUpdater exits, we will check whether app is in background
- //and bring to foreground.
selfObject->iAdtUpdaterAppUi->ToggleAppViewL(ETrue);
}
- }
+ }
__PRINTS( "CAdtUpdaterContainer::CallBackL - Exit" );
return KZero;
@@ -470,21 +464,10 @@
// Cancel all requests and timers.
CancelAllRequests();
- //set nitz info only if automatic time update is ON
- if(isAutomaticTimeUpdateON())
- {
- // Display the Nitz info.
- DisplayNitzInfoL();
- }
- else
- {
- //do not set the nitz info if the user has
- //set date/time or changed automatic time update
- //to OFF before 90 seconds
- // Marking this boot as first boot.
- MarkFirstBoot();
- }
-
+
+ // Display the Nitz info.
+ DisplayNitzInfoL();
+
// We're done. Exit the application.
iAdtUpdaterAppUi->Exit();
}
@@ -671,41 +654,35 @@
__PRINTS( "CAdtUpdaterContainer::DoContinueWithNormalBootL - Entry" );
// First bring the application to the foreground.
- if(!iAdtUpdaterAppUi->IsHighPriorityWindowActive())
- {
- iAdtUpdaterAppUi->ToggleAppViewL( ETrue );
- }
+ iAdtUpdaterAppUi->ToggleAppViewL( ETrue );
// Show in FSW.
iAdtUpdaterAppUi->HideApplicationFromFSW( EFalse );
// Hide the status pane.
iAdtUpdaterAppUi->HideStatusPane( ETrue );
-
- TBool timeSaved(ETrue);
- TBool dateSaved(ETrue);
- //show date/time queries only if automatic time update is ON
- if(isAutomaticTimeUpdateON())
- {
- //Deactivating Nitz
- DeActivateNitzPlugin();
-
- iQueryDialogsInDisplay = ETrue;
+
+ //Deactivating Nitz
+ DeActivateNitzPlugin();
+
+ TBool timeSaved;
+ TBool dateSaved;
+
+ iQueryDialogsInDisplay = ETrue;
- // First the country/city list.
- ShowCountryAndCityListsL();
- // Then query date.
- timeSaved = ShowDateQueryL();
- // Then query time.
- dateSaved = ShowTimeQueryL();
-
- iQueryDialogsInDisplay = EFalse;
-
- }
- // Modify the FirstBoot flag.
- if( timeSaved && dateSaved )
- {
- MarkFirstBoot();
- }
-
+ // First the country/city list.
+ ShowCountryAndCityListsL();
+ // Then query date.
+ timeSaved = ShowDateQueryL();
+ // Then query time.
+ dateSaved = ShowTimeQueryL();
+
+ iQueryDialogsInDisplay = EFalse;
+
+ // Modify the FirstBoot flag.
+ if( timeSaved && dateSaved )
+ {
+ MarkFirstBoot();
+ }
+
__PRINTS( "CAdtUpdaterContainer::ContinueWithNormalBootL - Exit" );
}
@@ -723,7 +700,6 @@
// Hide the status pane.
iAdtUpdaterAppUi->HideStatusPane( ETrue );
- iQueryDialogsInDisplay = ETrue;
// No first boot but RTCStatus is corrupted. Ask time and date"
// Showing Date query to user.
@@ -731,7 +707,7 @@
// Showing Time query to user.
ShowTimeQueryL();
- iQueryDialogsInDisplay = EFalse;
+
//Deactivate the plug-in as we are setting the date/time manually
DeActivateNitzPlugin();
@@ -1589,31 +1565,6 @@
__PRINTS( "CAdtUpdaterContainer::DeActivateNitzPlugin - Exit" );
}
-// ---------------------------------------------------------
-// CAdtUpdaterListener::isAutomaticTimeUpdateON
-// Check if automatic time update value is ON
-// ---------------------------------------------------------
-//
-
-TBool CAdtUpdaterContainer::isAutomaticTimeUpdateON()
- {
- __PRINTS( "CAdtUpdaterContainer::isAutomaticTimeUpdateON - Entry" );
-
- RClkSrvInterface clkSrvInterface;
-
- TBool timeUpdateOn( EFalse );
- if(KErrNone == clkSrvInterface.Connect())
- {
- __PRINTS( "connection to clock server was successful" );
- // get the value of AutoTimeUpdate setting
- clkSrvInterface.IsAutoTimeUpdateOn( timeUpdateOn );
- clkSrvInterface.Close();
- }
-
- __PRINTS( "CAdtUpdaterContainer::isAutomaticTimeUpdateON - Exit" );
- return timeUpdateOn;
- }
-
// -----------------------------------------------------
// CAdtUpdaterContainer::Listener
// rest of the details are commented in the header
@@ -1702,11 +1653,6 @@
return value;
}
-// ---------------------------------------------------------------------------
-// CAdtUpdaterContainer::PredictiveTimeEnabled()
-//
-// ---------------------------------------------------------------------------
-//
CPsKeyObserver::CPsKeyObserver( TUid aCategory, TUint aKey, TInt aTargetValue , MStartupUIPhaseObserver* aObsever)
: CActive( EPriorityStandard ), iCategory( aCategory ),
iKey( aKey ), iTargetValue(aTargetValue), iStartupUIPhaseObserver(aObsever)
--- a/clock2/clockui/uilayer/clockcityselectionlist/src/clockcityselectionlistimpl.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/uilayer/clockcityselectionlist/src/clockcityselectionlistimpl.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -344,7 +344,7 @@
__PRINTS( "CClockCitySelectionListImpl::OkToExitL - Exit" );
- return ETrue;
+ return EFalse;
}
__PRINTS( "CClockCitySelectionListImpl::OkToExitL - Exit" );
@@ -523,7 +523,11 @@
// Cleanup.
CleanupStack::PopAndDestroy( cityArray );
-
+ if( aTryExit )
+ {
+ // City is selected. We can exit the dialog now.
+ this->TryExitL( NULL );
+ }
}
// Cleanup.
CleanupStack::PopAndDestroy( localizedCityArray );
--- a/clock2/clockui/uilayer/clockworldview/src/clockworldcontainer.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/uilayer/clockworldview/src/clockworldcontainer.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -904,8 +904,6 @@
{
iWorldArray->UpdateTimeEntryList();
}
-
- SizeChanged();
DrawNow();
__PRINTS( "CClockWorldContainer::Refresh - Exit" );
--- a/clock2/clockui/uilayer/clockworldview/src/clockworldview.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/uilayer/clockworldview/src/clockworldview.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -1202,18 +1202,9 @@
iGalleryOpen = EFalse;
- TVwsViewId viewId;
- AppUi()->GetActiveViewId( viewId );
- if( viewId.iViewUid == KClockAppWorldViewId )
- {
- // Show the navigation pane.
- appUi->MakeNavigationPaneVisible( ETrue, EClockAppWorldViewId );
- }
- else if(viewId.iViewUid == KClockAppMainViewId )
- {
- //update the title text according to the active view
- ClockApplicationUi()->SetTitlePaneTextL( R_CLOCK_TITLE_MAIN_VIEW );
- }
+ // Show the navigation pane.
+ appUi->MakeNavigationPaneVisible( ETrue, EClockAppWorldViewId );
+
// If an image is selected by the user
if( result )
{
--- a/clock2/clockui/uilayer/group/clock.mmp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/uilayer/group/clock.mmp Wed Oct 13 14:30:35 2010 +0300
@@ -30,13 +30,7 @@
// Stack and heap options
EPOCSTACKSIZE 0x5000
-#ifdef WINSCW
- EPOCHEAPSIZE 0x20000 0x400000
-#else
- EPOCHEAPSIZE 0x20000 0x1000000
-#endif
-
-
+EPOCHEAPSIZE 0x20000 0x1000000
// Source information
SOURCEPATH ../clockmainview/src
--- a/clock2/clockui/uilayer/rom/clockresources.iby Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/uilayer/rom/clockresources.iby Wed Oct 13 14:30:35 2010 +0300
@@ -21,12 +21,12 @@
S60_APP_RESOURCE( clock )
S60_APP_RESOURCE( clock_loc )
-#ifdef __ROM_HIDE_JERUSALEM
+#ifdef FF_ROM_HIDE_FALKLAND
+data=DATAZ_\resource\TimeZoneLocalization\timezones_lta.rsc RESOURCE_FILES_DIR\TimeZoneLocalization\timezones.rsc
+#elif defined(__ROM_HIDE_JERUSALEM)
data=DATAZ_\resource\timezonelocalization\timezones_tel_aviv.rsc RESOURCE_FILES_DIR\timezonelocalization\timezones.rsc
-#elif defined(FF_ROM_HIDE_FALKLAND)
-data=DATAZ_\resource\TimeZoneLocalization\timezones_lta.rsc RESOURCE_FILES_DIR\TimeZoneLocalization\timezones.rsc
#else
-data=DATAZ_\resource\timezonelocalization\timezones.rsc RESOURCE_FILES_DIR\timezonelocalization\timezones.rsc
+data=DATAZ_\resource\timezonelocalization\timezones.rsc RESOURCE_FILES_DIR\timezonelocalization\timezones.rsc
#endif
#ifdef FF__ROM_HIDE_ISRAEL
@@ -34,7 +34,7 @@
#elif defined(FF_ROM_HIDE_FALKLAND)
data=DATAZ_\resource\TimeZoneLocalization\timezonegroups_lta.rsc RESOURCE_FILES_DIR\TimeZoneLocalization\timezonegroups.rsc
#else
-data=DATAZ_\resource\timezonelocalization\timezonegroups.rsc RESOURCE_FILES_DIR\timezonelocalization\timezonegroups.rsc
+data=DATAZ_\resource\timezonelocalization\timezonegroups.rsc RESOURCE_FILES_DIR\timezonelocalization\timezonegroups.rsc
#endif
// Alarm indicator resource file.
--- a/clock2/clockui/uilayer/src/clockappui.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/clock2/clockui/uilayer/src/clockappui.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -444,10 +444,10 @@
// rest of the details commented in the header
// ---------------------------------------------------------
//
-void CClockAppUi::UpdateComplete( TInt /*aErrorCode*/, CIAUpdateResult* aResult )
+void CClockAppUi::UpdateComplete( TInt aErrorCode, CIAUpdateResult* aResult )
{
__PRINTS( "CClockAppUi::UpdateComplete - Entry" );
- //Comment out the aErrorCode when Prints are enabled
+
__PRINT( "aErrorCode: %d", aErrorCode );
delete aResult; // Ownership was transferred, so this must be deleted by the client
Binary file clock2/help/data/xhtml.zip has changed
--- a/notepad/notepad1/LibSrc/NpdEditorDialog.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/notepad/notepad1/LibSrc/NpdEditorDialog.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -1206,7 +1206,6 @@
{
CFindItemDialog* dialog = CFindItemDialog::NewL( iEditor->Text()->Read( 0 ), aCase );
dialog->EnableSingleClick( ETrue );
- dialog->SetCallSubMenuVisibility( EFalse ); // Click-To-Call
TInt ret = dialog->ExecuteLD();
return ret;
}
--- a/notepad/notepad1/LibSrc/NpdExternalTextEditorDialog.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/notepad/notepad1/LibSrc/NpdExternalTextEditorDialog.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -413,15 +413,14 @@
// -----------------------------------------------------------------------------
//
TInt CNotepadExternalTextDialog::DoSearchL(CFindItemEngine::TFindItemSearchCase aCase)
- {
- CFindItemDialog* dialog = CFindItemDialog::NewL( iEditor->Text()->Read(0), aCase );
- dialog->EnableSingleClick( ETrue );
- dialog->SetCallSubMenuVisibility( EFalse ); // Click-To-Call
- TInt ret = dialog->ExecuteLD();
- TBuf<128> test = _L("FI returned: ");
- test.AppendNum(ret);
- iEikonEnv->InfoMsg(test);
- return ret;
+ {
+ CFindItemDialog* dialog = CFindItemDialog::NewL( iEditor->Text()->Read(0), aCase );
+ dialog->EnableSingleClick( ETrue );
+ TInt ret = dialog->ExecuteLD();
+ TBuf<128> test = _L("FI returned: ");
+ test.AppendNum(ret);
+ iEikonEnv->InfoMsg(test);
+ return ret;
}
// End of File
--- a/notepad/notepad1/LibSrc/NpdListDialog.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/notepad/notepad1/LibSrc/NpdListDialog.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -107,11 +107,6 @@
//
EXPORT_C CNotepadListDialog::~CNotepadListDialog()
{
- if ( iServiceHandler )
- {
- delete iServiceHandler;
- iServiceHandler = NULL;
- }
delete iIdle;
delete iProgressDialog; // *1*
delete iEditorDialog;
@@ -124,6 +119,12 @@
iSavedSelectedKeys.Close();
iSavedKeysAboveCurrent.Close();
delete iEnvironmentChangeNotifier;
+ if ( iServiceHandler )
+ {
+
+ delete iServiceHandler;
+ iServiceHandler = NULL;
+ }
}
// -----------------------------------------------------------------------------
@@ -976,7 +977,6 @@
TKeyArrayFix itemKey(0,ECmpTUint);
TInt ignore;
TInt itemMarked = iListBox->SelectionIndexes()->Find( currIndex, itemKey, ignore );
-
if ( memoCount > 0 &&
( markCount == 0 || IsNotepad() || IsTemplates()) )
{
@@ -984,21 +984,15 @@
InsertSendMenuItemAfterL( *iSendUi, *aMenuPane,
ENotepadCmdOpen );
}
-
if ( memoCount == 0 )
{
- aMenuPane->DeleteMenuItem( ENotepadCmdDelete );
+ aMenuPane->DeleteMenuItem(ENotepadCmdDelete);
}
-
- //delete 'Open' item from Option list at the following situations:
- //no memo,have item marked,user select the 'New note'
- if ( ( memoCount == 0 ) || ( markCount >= 1 ) ||
- ( ( currIndex == 0 ) && IsNotepad() ) )
+ if ( (memoCount == 0) || ( markCount >= 1 ) )
{
// this must after InsertSendMenuItemAfterL
- aMenuPane->DeleteMenuItem( ENotepadCmdOpen );
+ aMenuPane->DeleteMenuItem(ENotepadCmdOpen);
}
-
if ( markCount >= 1 && IsNoteListDialog() && ( memoCount > 0 ) )
{
aMenuPane->SetItemSpecific( ENotepadCmdSend, EFalse );
@@ -1077,7 +1071,7 @@
switch ( aCommandId )
{
case ENotepadCmdOpen: // Open memo
- OnCmdOpenL( iListBox->CurrentItemIndex() );
+ OnCmdOpenL(iListBox->CurrentItemIndex());
break;
case ENotepadCmdAdd:
OnCmdAddL();
--- a/notepad/notepad1/LibSrc/NpdViewerDialog.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/notepad/notepad1/LibSrc/NpdViewerDialog.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -90,7 +90,6 @@
iAutoFinder = CItemFinder::NewL();
iFindMenu = CFindItemMenu::NewL( EFindItemMenuPlaceHolder );
iFindMenu->AttachItemFinderMenuL(0);
- iFindMenu->SetCallSubMenuVisibility( EFalse ); // Click-To-Call
iForwardLocked = EFalse;
iReturnValue = KErrNone;
iFileExist = EFalse;
@@ -116,7 +115,7 @@
}
delete iFilename;
delete iSendUi;
- TRAP_IGNORE( iAutoFinder->SetItemFinderObserverL( 0 ) );
+ iAutoFinder->SetItemFinderObserverL (0);
delete iAutoFinder;
delete iFindMenu;
if( iNotifier )
--- a/organizer_plat/calendar_common_utils_api/group/bld.inf Wed Sep 15 12:11:35 2010 +0300
+++ b/organizer_plat/calendar_common_utils_api/group/bld.inf Wed Oct 13 14:30:35 2010 +0300
@@ -33,6 +33,5 @@
../inc/calenviewutils.h APP_LAYER_PLATFORM_EXPORT_PATH( calenviewutils.h )
../inc/calenmulticalutil.h APP_LAYER_PLATFORM_EXPORT_PATH( calenmulticalutil.h )
../inc/calenmulticaluids.hrh APP_LAYER_PLATFORM_EXPORT_PATH( calenmulticaluids.hrh )
-../inc/calenlocationutil.h APP_LAYER_PLATFORM_EXPORT_PATH( calenlocationutil.h )
// End of file
--- a/organizer_plat/calendar_common_utils_api/inc/calenlocationutil.h Wed Sep 15 12:11:35 2010 +0300
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,59 +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: Utility class to inform calendar components if any Nokia map
- * providers are available. Its a static API.
- *
- */
-
-
-#ifndef CALENLOCATIONUTIL_H
-#define CALENLOCATIONUTIL_H
-
-// System includes
-#include <e32base.h>
-#include <mnprovider.h>
-
-class CCalenLocationUtil : public CBase
- {
-
-public:
-
- /**
- * API to tell claendar modules if Nokia maps provider is available
- * in the device or not.
- *
- * @return ETrue if Nokia maps is installed on the device else EFalse.
- */
- static TBool IsMapProviderAvailableL();
-
- /**
- * Utility function to display list query with three strings.
- * This function will be used when user selects a map location
- * when there is already some invalidated location for the event.
- * First string will be a combination of lod text and newly
- * selected map locaiton. Second string will be newly selected map location.
- * Third strign will be old invalidated text.
- *
- * @params aStrings Array of three strings.
- * @return 0 for first string, 1 for second and 2 for third string when user
- * selects his choice. If cancelled, returns -1.
- */
- static TInt ShowLocationAppendOrReplaceL(
- RPointerArray< HBufC >& aStrings );
-
- };
-
-#endif // CALENLOCATIONUTIL_H
-
-// End of file --Don't remove this.
--- a/organizer_plat/calendar_custamization_api/inc/calencontext.h Wed Sep 15 12:11:35 2010 +0300
+++ b/organizer_plat/calendar_custamization_api/inc/calencontext.h Wed Oct 13 14:30:35 2010 +0300
@@ -131,21 +131,6 @@
*/
virtual TVwsViewId ViewId() const = 0;
- /**
- * Sets the start and end time of the instance that has to be created.
- * @param aStartTime The start time of the instance that has to be created.
- * @param aEndTime The end time of the instance that has to be created.
- */
- virtual void SetStartAndEndTimeForNewInstance( const TTime& aStartTime,
- const TTime& aEndTime ) = 0;
-
- /**
- * Gets the start and end time of the instance that has to be created.
- * @param aStartTime The start time of the instance that has to be created.
- * @param aEndTime The end time of the instance that has to be created.
- */
- virtual void GetStartAndEndTimeForNewInstance( TTime& aStartTime, TTime& aEndTime ) = 0;
-
public: // For Mutliple Context Support
--- a/pimappservices/calendar/bwins/agnmodelv3u.def Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/bwins/agnmodelv3u.def Wed Oct 13 14:30:35 2010 +0300
@@ -377,7 +377,4 @@
??0CAgnCalendarInfo@@IAE@XZ @ 376 NONAME ; CAgnCalendarInfo::CAgnCalendarInfo(void)
?ExternalizePropertiesL@CAgnCalendarInfo@@QBEXAAVCFileStore@@PBV1@@Z @ 377 NONAME ; void CAgnCalendarInfo::ExternalizePropertiesL(class CFileStore &, class CAgnCalendarInfo const *) const
?SetState@CAgnCalendarInfoProperty@@QAEXW4TState@1@@Z @ 378 NONAME ; void CAgnCalendarInfoProperty::SetState(enum CAgnCalendarInfoProperty::TState)
- ?UserDataInt@CAgnEntry@@QBEKXZ @ 379 NONAME ; unsigned long CAgnEntry::UserDataInt(void) const
- ?SetUserDataInt@CAgnEntry@@QAEXK@Z @ 380 NONAME ; void CAgnEntry::SetUserDataInt(unsigned long)
- ?ClearMRSpecificData@CAgnEntry@@QAEXXZ @ 381 NONAME ; void CAgnEntry::ClearMRSpecificData(void)
-
+
--- a/pimappservices/calendar/bwins/calinterimapiv3u.def Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/bwins/calinterimapiv3u.def Wed Oct 13 14:30:35 2010 +0300
@@ -338,7 +338,4 @@
?PropertyKeysL@CCalCalendarInfo@@QBEPAVCDesC8Array@@XZ @ 337 NONAME ; class CDesC8Array * CCalCalendarInfo::PropertyKeysL(void) const
?RemovePropertyL@CCalCalendarInfo@@QAEXABVTDesC8@@@Z @ 338 NONAME ; void CCalCalendarInfo::RemovePropertyL(class TDesC8 const &)
?PropertyValueL@CCalCalendarInfo@@QBEABVTDesC8@@ABV2@@Z @ 339 NONAME ; class TDesC8 const & CCalCalendarInfo::PropertyValueL(class TDesC8 const &) const
- ?SetUserInt32L@CCalEntry@@QAEXK@Z @ 340 NONAME ; void CCalEntry::SetUserInt32L(unsigned long)
- ?UserInt32L@CCalEntry@@QAEKXZ @ 341 NONAME ; unsigned long CCalEntry::UserInt32L(void)
- ?ClearMRSpecificDataL@CCalEntry@@QAEXXZ @ 342 NONAME ; void CCalEntry::ClearMRSpecificDataL(void)
--- a/pimappservices/calendar/client/inc/calentryimpl.h Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/client/inc/calentryimpl.h Wed Oct 13 14:30:35 2010 +0300
@@ -49,8 +49,7 @@
void SetPhoneOwnerL(const CCalUser* aOwner);
CCalUser* OrganizerL();
- CCalUser* PhoneOwnerL();
- void ClearMRSpecificDataL();
+ CCalUser* PhoneOwnerL();
void SetAlarmSoundNameL(const TDesC& aAlarmSoundName);
CTzRules* GetTzRulesL();
@@ -152,9 +151,6 @@
TUint8 ShortFileIdL();
- void SetUserInt32L( TUint32 aUserInt );
- TUint32 UserInt32L();
-
private:
CCalEntryImpl();
CCalEntryImpl(CAgnEntry& aEntry, CCalSessionImpl& aSessionImpl);
--- a/pimappservices/calendar/client/src/calentry.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/client/src/calentry.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -895,19 +895,6 @@
iImpl->SetPhoneOwnerL(aOwner);
}
-/** Clears the Organizer and phone owner.
-@pre None.
-@post The entry's organizer and phone owner is cleared.
-@publishedPartner
-@released
-@capability None
-*/
-EXPORT_C void CCalEntry::ClearMRSpecificDataL()
- {
- iImpl->ClearMRSpecificDataL();
- }
-
-
/** Gets the organizer for this entry.
This function creates a new CCalUser object containing the organizer data.
@@ -1156,30 +1143,6 @@
return iImpl->ShortFileIdL();
}
-/** Sets the user data field.
-
-@param aUserInt The userdata to be set
-@capability None
-@publishedAll
-@released
-*/
-EXPORT_C void CCalEntry::SetUserInt32L( TUint32 aUserInt )
- {
- iImpl->SetUserInt32L( aUserInt );
- }
-
-/** Fetches the userdata field
-
-@publishedAll
-@released
-@capability None
-@return The Userdata field.
-*/
-EXPORT_C TUint32 CCalEntry::UserInt32L()
- {
- return iImpl->UserInt32L();
- }
-
// CCalEntryId //
--- a/pimappservices/calendar/client/src/calentryimpl.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/client/src/calentryimpl.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -336,17 +336,6 @@
return iCalOrganizer;
}
-void CCalEntryImpl::ClearMRSpecificDataL()
- {
- LoadFullEntryL();
- iFullEntry->ClearMRSpecificData(); // Clear Organizer and Phone Owner.
- if( iCalOrganizer )
- {
- delete iCalOrganizer;
- iCalOrganizer = NULL;
- }
- }
-
CTzRules* CCalEntryImpl::GetTzRulesL()
{
CAgnRptDef* rptDef = SimpleEntry()->RptDef();
@@ -1677,15 +1666,6 @@
return SimpleEntry()->UserInt();
}
-void CCalEntryImpl::SetUserInt32L( TUint32 aUserInt )
- {
- iFullEntry->SetUserDataInt( aUserInt );
- }
-
-TUint32 CCalEntryImpl::UserInt32L()
- {
- return iFullEntry->UserDataInt();
- }
// CCalEntryIdImpl //
--- a/pimappservices/calendar/eabi/agnmodelv3u.def Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/eabi/agnmodelv3u.def Wed Oct 13 14:30:35 2010 +0300
@@ -422,7 +422,4 @@
_ZTV16CAgnCalendarInfo @ 421 NONAME
_ZTV24CAgnCalendarInfoProperty @ 422 NONAME
_ZNK24CAgnCalendarInfoProperty5StateEv @ 423 NONAME
- _ZN9CAgnEntry14SetUserDataIntEm @ 424 NONAME
- _ZNK9CAgnEntry11UserDataIntEv @ 425 NONAME
- _ZN9CAgnEntry19ClearMRSpecificDataEv @ 426 NONAME
--- a/pimappservices/calendar/eabi/calinterimapiv3u.def Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/eabi/calinterimapiv3u.def Wed Oct 13 14:30:35 2010 +0300
@@ -408,7 +408,4 @@
_ZN16CCalCalendarInfo15RemovePropertyLERK6TDesC8 @ 407 NONAME
_ZNK16CCalCalendarInfo13PropertyKeysLEv @ 408 NONAME
_ZNK16CCalCalendarInfo14PropertyValueLERK6TDesC8 @ 409 NONAME
- _ZN9CCalEntry10UserInt32LEv @ 410 NONAME
- _ZN9CCalEntry13SetUserInt32LEm @ 411 NONAME
- _ZN9CCalEntry20ClearMRSpecificDataLEv @ 412 NONAME
--- a/pimappservices/calendar/inc/calentry.h Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/inc/calentry.h Wed Oct 13 14:30:35 2010 +0300
@@ -274,7 +274,6 @@
IMPORT_C CCalUser* OrganizerL() const;
IMPORT_C void SetPhoneOwnerL(const CCalUser* aOwner);
IMPORT_C CCalUser* PhoneOwnerL() const;
- IMPORT_C void CCalEntry::ClearMRSpecificDataL();
// Attachments
IMPORT_C void AddAttachmentL(CCalAttachment& aAttachment);
@@ -319,9 +318,6 @@
IMPORT_C TCalTime FindRptUntilTimeL(TInt aCount);
- IMPORT_C void SetUserInt32L( TUint32 aUserInt );
- IMPORT_C TUint32 UserInt32L();
-
public:
// Internal APIs
static CCalEntry* NewL(CCalEntryImpl* aImpl);
--- a/pimappservices/calendar/server/inc/agsentrymodel.h Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/server/inc/agsentrymodel.h Wed Oct 13 14:30:35 2010 +0300
@@ -146,6 +146,7 @@
void NextAlarmForServerL(const TTime& aNow,CArrayFixFlat<TAgnSortInstance>& aAlarmedIds);
void NextFewAlarmsForServerL(const TTime& aStartDateTime,const TTime& aEndDateTime,CArrayFixFlat<TAgnSortInstance>& aAlarmedIds,const TInt aMaxNumberOfAlarms);
void FindAndQueueNextFewAlarmsL();
+ void QueueNextAlarmImmediatelyL();
void SetUpdateAlarmL(TBool aUpdateAlarm);
#ifdef SYMBIAN_SYSTEM_STATE_MANAGEMENT
void DeleteAlarmsAndRequeueSessionAlarmL();
--- a/pimappservices/calendar/server/src/agsalarm.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/server/src/agsalarm.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -438,6 +438,8 @@
if ( now < lastAlarm )
{
+ // We need to consider 2 sec window to make sure that same alarm
+ // is not queued again.
now += TTimeIntervalSeconds(2);
}
}
@@ -468,6 +470,9 @@
if ( now < lastAlarm )
{
+ // We need to consider 2 sec window to make sure that same alarm
+ // is not queued again.
+
now += TTimeIntervalSeconds(2);
}
}
--- a/pimappservices/calendar/server/src/agsattachmentindex.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/server/src/agsattachmentindex.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -281,7 +281,8 @@
{
// check every attachment
const CAgnAttachmentIndexItem* KAttachmentItem = iIndex[i];
- for (TInt j = 0; j < KAttachmentItem->Entries().Count(); ++j)
+ const TInt entryCount = KAttachmentItem->Entries().Count();
+ for (TInt j = 0; j < entryCount; ++j)
{
// check every entry associated with each attachment
if (KEntryLocalUid == (KAttachmentItem->Entries())[j])
--- a/pimappservices/calendar/server/src/agsentrymodel.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/server/src/agsentrymodel.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -3450,3 +3450,8 @@
{
return *iAlarm;
}
+
+void CAgnEntryModel::QueueNextAlarmImmediatelyL()
+ {
+ iAlarm->FindAndQueueNextAlarmL(EFalse);
+ }
--- a/pimappservices/calendar/server/src/agsfilemanager.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/server/src/agsfilemanager.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -1239,11 +1239,14 @@
fileName.Append(parser.NameAndExt());
if(iIsFileDisabled)
{
- iAgnServer.AlarmServer().SetAlarmStatusForCalendarFile(fileName, EAlarmStatusDisabled);
+ iAgnServer.AlarmServer().AlarmDeleteByCalendarFile(fileName, EAllAlarms);
}
else
{
- QueueAlarmsImmediately();
+ if (iStore && iModel)
+ {
+ TRAP_IGNORE(iModel->QueueNextAlarmImmediatelyL());
+ }
}
User::LeaveIfError(iStore->Commit());
--- a/pimappservices/calendar/shared/inc/agmentry.h Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/shared/inc/agmentry.h Wed Oct 13 14:30:35 2010 +0300
@@ -165,7 +165,6 @@
IMPORT_C CAgnAttendee* Organizer() const;
IMPORT_C void SetPhoneOwnerL(CAgnAttendee* aOwner); // takes ownership
IMPORT_C CAgnAttendee* PhoneOwner() const;
- IMPORT_C void ClearMRSpecificData();
void CreateAttendeeListL();
// attachments
@@ -204,10 +203,7 @@
// User integer.
IMPORT_C void SetUserInt( TUint32 aUserInt );
IMPORT_C TUint32 UserInt() const;
-
- IMPORT_C void SetUserDataInt( TUint32 aUserInt );
- IMPORT_C TUint32 UserDataInt() const;
-
+
private:
// following enums for internal use only
enum TFlags
@@ -255,8 +251,7 @@
TUint8 iReplicationStatus;
TUint16 iFlags;
TReal iLatitude;
- TReal iLongitude;
- TUint32 iUserDataInt;
+ TReal iLongitude;
};
#endif
--- a/pimappservices/calendar/shared/src/agmentry.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/shared/src/agmentry.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -29,7 +29,7 @@
#include <e32math.h>
#include <asshddefs.h>
-#define KUserDataInt 4
+
//---------------------------------- CAgnEntry ------------------------------------------
@@ -411,11 +411,6 @@
return EFalse;
}
- if ( UserDataInt() != aEntry.UserDataInt() )
- {
- return EFalse;
- }
-
return ETrue;
}
@@ -692,15 +687,9 @@
// Set the user integer of the stream.
aStream.WriteInt32L( UserInt() );
-
- TInt skipCount( 0 );
- //skip count(4) for UserDataInt is added
- //to read those many bytes after fixed length of agmentry.
- skipCount += KUserDataInt;
-
- // Number of bytes until end of entry
- aStream.WriteUint32L( skipCount );
- aStream.WriteInt32L( UserDataInt() );
+
+ // future DC proofing
+ aStream.WriteUint32L(0); // number of bytes until end of entry
}
@@ -839,18 +828,13 @@
// Set the user integer of this entry from the stream.
SetUserInt(aStream.ReadInt32L());
+ // future DC proofing
size = aStream.ReadUint32L(); // number of bytes until end of entry
-
- if ( size >= KUserDataInt )
- {
- SetUserDataInt( aStream.ReadInt32L() );
- size -= KUserDataInt;
- }
while (size > 0)
{
- aStream.ReadUint8L(); // ignore data
- size--;
- }
+ aStream.ReadUint8L(); // ignore data
+ size--;
+ }
}
EXPORT_C CAgnEntry* CAgnEntry::CloneL() const
@@ -1023,8 +1007,6 @@
HBufC8* guid = aSource.Guid().AllocL();
SetGuid(guid);
}
- // copy int
- iUserDataInt = aSource.UserDataInt();
}
EXPORT_C CCalEntry::TReplicationStatus CAgnEntry::ReplicationStatus() const
@@ -1252,27 +1234,6 @@
iPhoneOwner = aAttendee;
}
-EXPORT_C void CAgnEntry::ClearMRSpecificData()
- {
- // clears the iMeetingOrganizer and iAttendeeList.
- if( iMeetingOrganizer )
- {
- delete iMeetingOrganizer;
- iMeetingOrganizer = NULL;
-
- }
- if( iPhoneOwner )
- {
- iPhoneOwner = NULL;
- }
-
- if( iAttendeeList )
- {
- iAttendeeList->ResetAndDestroy();
- delete iAttendeeList;
- iAttendeeList = NULL;
- }
- }
EXPORT_C void CAgnEntry::SetDTStampUtcL(const TTime& aDTStampUtc)
/**
@@ -2125,13 +2086,3 @@
{
return (iFlags & aFlag);
}
-
-EXPORT_C void CAgnEntry::SetUserDataInt( TUint32 aUserInt )
- {
- iUserDataInt = aUserInt;
- }
-
-EXPORT_C TUint32 CAgnEntry::UserDataInt() const
- {
- return iUserDataInt;
- }
--- a/pimappservices/calendar/tsrc/T_VCAL2.CPP Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendar/tsrc/T_VCAL2.CPP Wed Oct 13 14:30:35 2010 +0300
@@ -388,27 +388,6 @@
"END:VTODO\r\n"
"END:VCALENDAR\r\n");
-_LIT8(KUserDataEntry,"BEGIN:VCALENDAR\r\n"
- "VERSION:1.0\r\n"
- "BEGIN:VEVENT\r\n"
- "UID:ZB0tN9634EH8l818X2GVU2\r\n"
- "SUMMARY:importing\r\n"
- "DTSTART:20090720T070000Z\r\n"
- "DTEND:20090720T070000Z\r\n"
- "X-EPOCAGENDAENTRYTYPE:APPOINTMENT\r\n"
- "CLASS:PRIVATE\r\n"
- "SEQUENCE:0\r\n"
- "X-METHOD:NONE\r\n"
- "LAST-MODIFIED:20090720T154714Z\r\n"
- "PRIORITY:2\r\n"
- "X-SYMBIAN-LUID:5\r\n"
- "TRANSP:0\r\n"
- "X-USERDATA-INT:125\r\n"
- "X-STRING:london\r\n"
- "X-TEXTPROPERTY:class property\r\n"
- "X-INTPROPERTY:521\r\n"
- "END:VEVENT\r\n"
- "END:VCALENDAR\r\n");
class CTestApp : public CBase , public MCalTestOomCallBack
{
public:
@@ -707,8 +686,6 @@
test.Printf(_L("Import a vcal with alarm information\n"));
testApp->DoImportL(KAlarmVCal);
- test.Printf(_L("Import with userdata attribute \n"));
- testApp->DoImportL( KUserDataEntry );
CleanupStack::PopAndDestroy(testApp);
}
--- a/pimappservices/calendarvcalplugin/src/agmvcali.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendarvcalplugin/src/agmvcali.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -379,15 +379,6 @@
CleanupStack::PopAndDestroy(geoString);
}
- TInt intProperty( 0 );
- //Import UserDataInt
- TBool integerFound = ImportIntegerPropertyL( aParser, KVersitExtUserInt,
- intProperty );
-
- if ( integerFound )
- {
- iEntry->SetUserInt32L( intProperty );
- }
CleanupStack::PopAndDestroy(properties);
aEntryArray.AppendL(iEntry); // takes ownership of entry
iEntry = NULL;
--- a/pimappservices/calendarvcalplugin/src/agmvcalx.cpp Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappservices/calendarvcalplugin/src/agmvcalx.cpp Wed Oct 13 14:30:35 2010 +0300
@@ -665,9 +665,6 @@
CCalAttachment* attach = aEntry->AttachmentL(ii);
AddAttachmentPropertyL(aParser, *attach);
}
-
- TInt userDataInt = aEntry->UserInt32L();
- AddIntegerPropertyL( aParser, KVersitExtUserInt, userDataInt );
}
--- a/pimappsupport/vcardandvcal/inc/VTOKEN.H Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappsupport/vcardandvcal/inc/VTOKEN.H Wed Oct 13 14:30:35 2010 +0300
@@ -359,6 +359,5 @@
_LIT8(KVersitTokenClass, "X-CLASS");
_LIT8(KVersitAttachLabel, "X-NAME");
_LIT8(KVersitAttachMimeType, "X-FMTTYPE");
-_LIT8(KVersitExtUserInt, "X-USERDATA-INT");
#endif
--- a/pimappsupport/vcardandvcal/src/VCAL.CPP Wed Sep 15 12:11:35 2010 +0300
+++ b/pimappsupport/vcardandvcal/src/VCAL.CPP Wed Oct 13 14:30:35 2010 +0300
@@ -567,8 +567,7 @@
{
uid.iUid = KVCalPropertyExtendedAlarmUid;
}
- else if ( !aToken.CompareF( KVersitTokenXLOCALUID ) ||
- !aToken.CompareF( KVersitExtUserInt ) )
+ else if (!aToken.CompareF(KVersitTokenXLOCALUID))
{
uid.iUid = KVersitPropertyIntUid;
}