calendarui/server/CalenSvr/src/CalenServer.cpp
changeset 0 f979ecb2b13e
child 5 42814f902fe6
equal deleted inserted replaced
-1:000000000000 0:f979ecb2b13e
       
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   Provides class methods for creating Db , boot and missed alarm manager
       
    15 *                implements CServer2 methods as part of IPC message interaction with client.
       
    16 *
       
    17 */
       
    18 
       
    19 #include <centralrepository.h>
       
    20 #include <CalendarInternalCRKeys.h>
       
    21 #include <calsession.h>
       
    22 #include <calcalendarinfo.h>
       
    23 #include <calenmulticalutil.h>
       
    24 #include <CalenInterimUtils2.h>
       
    25 
       
    26 //debug
       
    27 #include "calendarui_debug.h"
       
    28 
       
    29 // INCLUDES
       
    30 #include "CalenServer.h"
       
    31 
       
    32 #include "CalSvrSession.h"
       
    33 #include "CalSvrDef.h"
       
    34 //#include "CalenSvrAlarmManager.h"
       
    35 #include "CalenSvrBootManager.h"
       
    36 #include "CalenSvrDBManager.h"
       
    37 #include "calensvrmissedalarmmanager.h"
       
    38 
       
    39 // LOCAL CONSTANTS AND MACROS
       
    40 const TInt KCalenServerPriority(CActive::EPriorityStandard);
       
    41 _LIT( KCalendarDatabaseFilePath, "c:calendar" );
       
    42 const TInt KBufferStartingSize( 128 ); 
       
    43 const TInt KBufferSizeIncrement( 64 );
       
    44 const TInt KBuffLength = 128;
       
    45 
       
    46 const TInt KComma( ',' );
       
    47 
       
    48 // ================= MEMBER FUNCTIONS =======================
       
    49 //
       
    50 // Construction and destruction 
       
    51 //
       
    52 // -----------------------------------------------------------------------------
       
    53 // ?classname::?member_function
       
    54 // ?implementation_description
       
    55 // (other items were commented in a header).
       
    56 // -----------------------------------------------------------------------------
       
    57 //
       
    58 CCalenServer* CCalenServer::NewL()
       
    59     {
       
    60     TRACE_ENTRY_POINT;
       
    61     
       
    62     CCalenServer* server = new( ELeave )CCalenServer( KCalenServerPriority );
       
    63 
       
    64     CleanupStack::PushL(server);
       
    65     server->ConstructL();
       
    66     CleanupStack::Pop();
       
    67     
       
    68     TRACE_EXIT_POINT;
       
    69     return server;
       
    70     }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // ?classname::?member_function
       
    74 // ?implementation_description
       
    75 // (other items were commented in a header).
       
    76 // -----------------------------------------------------------------------------
       
    77 //
       
    78 CCalenServer::CCalenServer(TInt aPriority)
       
    79     : CServer2(aPriority, ESharableSessions)
       
    80     {
       
    81     TRACE_ENTRY_POINT;
       
    82     TRACE_EXIT_POINT;
       
    83     }
       
    84 
       
    85 // -----------------------------------------------------------------------------
       
    86 // ?classname::?member_function
       
    87 // ?implementation_description
       
    88 // (other items were commented in a header).
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 CCalenServer::~CCalenServer()
       
    92     {
       
    93     TRACE_ENTRY_POINT;
       
    94     
       
    95     //delete iAlarmManager;
       
    96     delete iDBManager;
       
    97     delete iBootManager;
       
    98     delete iMissedAlarmHandler;
       
    99     
       
   100     TRACE_EXIT_POINT;
       
   101     }
       
   102 
       
   103 // -----------------------------------------------------------------------------
       
   104 // ?classname::?member_function
       
   105 // ?implementation_description
       
   106 // (other items were commented in a header).
       
   107 // -----------------------------------------------------------------------------
       
   108 //
       
   109 void CCalenServer::ConstructL()
       
   110     {
       
   111     TRACE_ENTRY_POINT;
       
   112     
       
   113     TBool firstStartUp(EFalse);
       
   114     CheckForFirstStartUpL(firstStartUp);
       
   115     
       
   116     if(!firstStartUp)
       
   117         {
       
   118         TRAPD(error,CreateCalendarFilesL());
       
   119         if(error==KErrNone)
       
   120             {
       
   121             SetFirstStartUpL(ETrue);
       
   122             }
       
   123         }
       
   124 
       
   125     iBootManager = CCalenSvrBootManager::NewL( *this );
       
   126     iDBManager = CCalenSvrDBManager::NewL();
       
   127     //iAlarmManager = CCalenSvrAlarmManager::NewL();
       
   128     iMissedAlarmHandler = CCalenSvrMissedAlarmManager::NewL();
       
   129     StartL( KCalendarServerName );
       
   130     
       
   131     TRACE_EXIT_POINT;
       
   132     }
       
   133 
       
   134 //
       
   135 // CServer mandatory functions, e.g. session creation and error handling
       
   136 //
       
   137 
       
   138 // -----------------------------------------------------------------------------
       
   139 // ?classname::?member_function
       
   140 // ?implementation_description
       
   141 // (other items were commented in a header).
       
   142 // -----------------------------------------------------------------------------
       
   143 //
       
   144 CSession2* CCalenServer::NewSessionL(const TVersion& /*aVersion*/, const RMessage2& /*aMessage*/) const
       
   145     {
       
   146     TRACE_ENTRY_POINT;
       
   147 
       
   148     CCalSvrSession* session = new( ELeave )CCalSvrSession();
       
   149 
       
   150     CleanupStack::PushL( session );
       
   151     session->ConstructL( *const_cast<CCalenServer*>( this ) );
       
   152     CleanupStack::Pop( session );
       
   153     
       
   154     TRACE_EXIT_POINT;
       
   155     return session;
       
   156     }
       
   157 
       
   158 // -----------------------------------------------------------------------------
       
   159 // ?classname::?member_function
       
   160 // ?implementation_description
       
   161 // (other items were commented in a header).
       
   162 // -----------------------------------------------------------------------------
       
   163 //
       
   164 TInt CCalenServer::RunError(TInt aErr)
       
   165     /**
       
   166      * Handle leaves from ServiceL.
       
   167      * Any leave from a ServiceL() will land up here.
       
   168      **/
       
   169     {
       
   170     TRACE_ENTRY_POINT;
       
   171     
       
   172     // if it's a bad descriptor, panic the client
       
   173     if (aErr==KErrBadDescriptor)    // client had a bad descriptor
       
   174         {
       
   175         PanicClient(Message(), EBadDescriptor);
       
   176         // If client message is panicked, it is also completed.
       
   177         }
       
   178     else
       
   179         {
       
   180         // otherwise, complete the outstanding message with error
       
   181         Message().Complete(aErr);
       
   182         }
       
   183     ReStart(); // really means just continue reading client requests
       
   184     
       
   185     TRACE_EXIT_POINT;
       
   186     return KErrNone;
       
   187     }
       
   188 
       
   189 // -----------------------------------------------------------------------------
       
   190 // ?classname::?member_function
       
   191 // ?implementation_description
       
   192 // (other items were commented in a header).
       
   193 // -----------------------------------------------------------------------------
       
   194 //
       
   195 void CCalenServer::PanicClient(const RMessage2& aMessage, TInt aPanic) const
       
   196     {
       
   197     TRACE_ENTRY_POINT;
       
   198     
       
   199     // FIXME: should we Panic Client, if client is running in 
       
   200     // phone thread ?
       
   201     // ok, go for it
       
   202     _LIT(KCalenSvrClientPanic, "CalenServer");
       
   203     aMessage.Panic(KCalenSvrClientPanic, aPanic);
       
   204     
       
   205     TRACE_EXIT_POINT;
       
   206     }
       
   207 
       
   208 //
       
   209 // Calendar server specific functionality
       
   210 //
       
   211 
       
   212 // -----------------------------------------------------------------------------
       
   213 // ?classname::?member_function
       
   214 // ?implementation_description
       
   215 // (other items were commented in a header).
       
   216 // -----------------------------------------------------------------------------
       
   217 //
       
   218 void CCalenServer::BootReadyL()
       
   219     {
       
   220     TRACE_ENTRY_POINT;
       
   221     iDBManager->BootReadyL();
       
   222     TRACE_EXIT_POINT;
       
   223     }
       
   224 
       
   225 // -----------------------------------------------------------------------------
       
   226 // ?classname::?member_function
       
   227 // ?implementation_description
       
   228 // (other items were commented in a header).
       
   229 // -----------------------------------------------------------------------------
       
   230 //
       
   231 void CCalenServer::RegisterUserL(CCalenSvrDBManager::MCalenDBUser& aUser)
       
   232     {
       
   233     TRACE_ENTRY_POINT;
       
   234     iDBManager->RegisterUserL(aUser);
       
   235     TRACE_EXIT_POINT;
       
   236     }
       
   237 
       
   238 // -----------------------------------------------------------------------------
       
   239 // ?classname::?member_function
       
   240 // ?implementation_description
       
   241 // (other items were commented in a header).
       
   242 // -----------------------------------------------------------------------------
       
   243 //
       
   244 void CCalenServer::UnregisterUserL(CCalenSvrDBManager::MCalenDBUser& aUser)
       
   245     {
       
   246     TRACE_ENTRY_POINT;
       
   247     iDBManager->UnregisterUserL(aUser);
       
   248     TRACE_EXIT_POINT;
       
   249     }
       
   250 
       
   251 // -----------------------------------------------------------------------------
       
   252 // CCalenServer::ServerMessage
       
   253 // Returns the current IPC message.
       
   254 // (other items were commented in a header).
       
   255 // -----------------------------------------------------------------------------
       
   256 // 
       
   257 const RMessage2 CCalenServer::ServerMessage() const
       
   258     {
       
   259     TRACE_ENTRY_POINT;
       
   260 
       
   261     TRACE_EXIT_POINT;
       
   262     return Message();
       
   263     }
       
   264 
       
   265 // -----------------------------------------------------------------------------
       
   266 // CCalenServer::CheckForFirstStartUpL
       
   267 // checks for first start up by reading the information from cenrep key 
       
   268 // -----------------------------------------------------------------------------
       
   269 //
       
   270 void CCalenServer::CheckForFirstStartUpL(TBool& aFirstStartUp)
       
   271     {
       
   272     TRACE_ENTRY_POINT;
       
   273     CRepository* cenRep = CRepository::NewLC(KCRUidCalendar);
       
   274     User::LeaveIfError(cenRep->Get(KCalendarStartupStatus, aFirstStartUp));
       
   275     CleanupStack::PopAndDestroy(cenRep);
       
   276     TRACE_EXIT_POINT;
       
   277     }
       
   278 
       
   279 // -----------------------------------------------------------------------------
       
   280 // CCalenServer::SetFirstStartUpL
       
   281 // Sets first start up value to ETrue
       
   282 // -----------------------------------------------------------------------------
       
   283 //
       
   284 void CCalenServer::SetFirstStartUpL(TBool aFirstStartUp)
       
   285     {
       
   286     TRACE_ENTRY_POINT;
       
   287     CRepository* cenRep = CRepository::NewLC(KCRUidCalendar);
       
   288     User::LeaveIfError(cenRep->Set(KCalendarStartupStatus, aFirstStartUp));
       
   289     CleanupStack::PopAndDestroy(cenRep);
       
   290     TRACE_EXIT_POINT;
       
   291     }
       
   292 
       
   293 // -----------------------------------------------------------------------------
       
   294 // CCalenServer::CreateCalendarFilesL
       
   295 // Create default calendar files
       
   296 // -----------------------------------------------------------------------------
       
   297 //
       
   298 TInt CCalenServer::CreateCalendarFilesL()
       
   299     {
       
   300     TRACE_ENTRY_POINT;
       
   301     
       
   302     CDesC16ArrayFlat* calendarNamesList = new (ELeave) CDesC16ArrayFlat(2);
       
   303     CleanupStack::PushL(calendarNamesList);
       
   304     // read calendar names from central repository
       
   305     ReadCalendarNamesFromCenrepL(*calendarNamesList);
       
   306     
       
   307     RArray<TInt> calendarColors;
       
   308     // read calendar colors from central repository
       
   309     ReadCalendarColorsFromCenrepL(calendarColors);
       
   310     
       
   311     TInt calendarsCount = calendarNamesList->Count();
       
   312     TInt error(KErrNone);
       
   313     for (TInt index = 0; index < calendarsCount; index++)
       
   314         {
       
   315         // create cal session
       
   316         CCalSession* session = CCalSession::NewL();
       
   317         CleanupStack::PushL(session);
       
   318         
       
   319         // create and set metadata information from central repository
       
   320         CCalCalendarInfo* calendarInfo = CCalCalendarInfo::NewL();
       
   321         CleanupStack::PushL(calendarInfo);
       
   322         
       
   323         SetCalendarAddPropertiesL(*calendarInfo);
       
   324 		
       
   325 		calendarInfo->SetNameL(calendarNamesList->MdcaPoint(index));
       
   326         calendarInfo->SetColor(TRgb(calendarColors[index]));
       
   327         calendarInfo->SetEnabled(ETrue);
       
   328 
       
   329         if(!index)
       
   330             {
       
   331             TBuf<KMaxFileName> calendarFileName;
       
   332             calendarFileName.Append(KCalendarDatabaseFilePath);
       
   333             TRAPD(error,session->CreateCalFileL(calendarFileName,*calendarInfo));
       
   334 			User::LeaveIfError(error);
       
   335             }
       
   336         else
       
   337             {
       
   338             HBufC* calFileName = 
       
   339                     CCalenMultiCalUtil::GetNextAvailableCalFileL();
       
   340             CleanupStack::PushL(calFileName);
       
   341             TRAPD(error,session->CreateCalFileL( calFileName->Des(),
       
   342                                         *calendarInfo));
       
   343 			User::LeaveIfError(error);
       
   344             CleanupStack::PopAndDestroy(calFileName);
       
   345             }
       
   346         CleanupStack::PopAndDestroy(calendarInfo);
       
   347         CleanupStack::PopAndDestroy(session);
       
   348         }
       
   349     calendarColors.Close();
       
   350     CleanupStack::PopAndDestroy(calendarNamesList);
       
   351     TRACE_EXIT_POINT;
       
   352     return error;
       
   353     }
       
   354 
       
   355 // -----------------------------------------------------------------------------
       
   356 // CCalenServer::ReadCalendarNamesFromCenrepL
       
   357 // Read calendar names from central repository
       
   358 // -----------------------------------------------------------------------------
       
   359 //
       
   360 void CCalenServer::ReadCalendarNamesFromCenrepL(CDesC16ArrayFlat& aCalendarNames)
       
   361     {
       
   362     TRACE_ENTRY_POINT;
       
   363     
       
   364     CRepository* repository = CRepository::NewL( KCRUidCalendar );
       
   365     CleanupStack::PushL( repository );
       
   366     
       
   367     TInt bufSize( KBufferStartingSize );
       
   368     TBool wasRead( EFalse );
       
   369     do
       
   370         {
       
   371         RBuf buf;
       
   372         CleanupClosePushL(buf);
       
   373         buf.CreateL(bufSize);
       
   374         // read default calendars information from cenrep
       
   375         TInt err = repository->Get(KCalendarDefaultCalendars, buf);
       
   376         if (err == KErrNone)
       
   377             {
       
   378             wasRead = ETrue;
       
   379             PopulateCalendarNamesListL(buf, aCalendarNames);
       
   380             }
       
   381         else if (err == KErrOverflow)
       
   382             {
       
   383             bufSize += KBufferSizeIncrement;
       
   384             }
       
   385         else
       
   386             {
       
   387             User::Leave(err);
       
   388             }
       
   389         CleanupStack::PopAndDestroy(&buf);
       
   390         }
       
   391     while (!wasRead);
       
   392 
       
   393     CleanupStack::PopAndDestroy(repository);
       
   394     TRACE_EXIT_POINT;
       
   395     }
       
   396 
       
   397 // -----------------------------------------------------------------------------
       
   398 // CCalenServer::ReadCalendarColorsFromCenrepL
       
   399 // Read calendar colors from central repository
       
   400 // -----------------------------------------------------------------------------
       
   401 //
       
   402 void CCalenServer::ReadCalendarColorsFromCenrepL(RArray<TInt>& aCalendarColors)
       
   403     {
       
   404     TRACE_ENTRY_POINT;
       
   405     
       
   406     CRepository* repository = CRepository::NewL(KCRUidCalendar);
       
   407     CleanupStack::PushL(repository);
       
   408 
       
   409     TInt bufSize(KBufferStartingSize);
       
   410     TBool wasRead(EFalse);
       
   411     do
       
   412         {
       
   413         RBuf buf;
       
   414         CleanupClosePushL(buf);
       
   415         buf.CreateL(bufSize);
       
   416         // read calendar colors from cenrep
       
   417         TInt err = repository->Get(KCalendarDefaultColors, buf);
       
   418         if (err == KErrNone)
       
   419             {
       
   420             wasRead = ETrue;
       
   421             PopulateCalendarColorListL(buf, aCalendarColors);
       
   422             }
       
   423         else if (err == KErrOverflow)
       
   424             {
       
   425             bufSize += KBufferSizeIncrement;
       
   426             }
       
   427         else
       
   428             {
       
   429             User::Leave(err);
       
   430             }
       
   431         CleanupStack::PopAndDestroy(&buf);
       
   432         }
       
   433     while (!wasRead);
       
   434 
       
   435     CleanupStack::PopAndDestroy(repository);
       
   436     TRACE_EXIT_POINT;
       
   437     }
       
   438 
       
   439 // -----------------------------------------------------------------------------
       
   440 // CCalenServer::PopulateCalendarNamesListL
       
   441 // Populate calendar names list from central repository buffer
       
   442 // -----------------------------------------------------------------------------
       
   443 //
       
   444 void CCalenServer::PopulateCalendarNamesListL( const TDesC& aRepositoryBuffer,
       
   445                     CDesC16ArrayFlat& aCalendarNames)
       
   446     {
       
   447     TRACE_ENTRY_POINT;
       
   448     
       
   449     TPtrC marker = aRepositoryBuffer;
       
   450     TInt calendarNameOffset;
       
   451     while ((calendarNameOffset = marker.Locate(TChar(KComma)))
       
   452             != KErrNotFound)
       
   453         {
       
   454         // append calendar name to list
       
   455         aCalendarNames.AppendL(marker.Left(calendarNameOffset));
       
   456         marker.Set(marker.Mid(calendarNameOffset + 1));
       
   457 
       
   458         if (marker.Locate(TChar(KComma)) == KErrNotFound)
       
   459             {
       
   460             aCalendarNames.AppendL(marker.Left(marker.Length()));
       
   461             }
       
   462         }
       
   463     TRACE_EXIT_POINT;
       
   464     }
       
   465 
       
   466 // -----------------------------------------------------------------------------
       
   467 // CCalenServer::PopulateCalendarColorListL
       
   468 // Populate calendar colors list from central repository buffer
       
   469 // -----------------------------------------------------------------------------
       
   470 //
       
   471 void CCalenServer::PopulateCalendarColorListL( const TDesC& aRepositoryBuffer,
       
   472                         RArray<TInt>& aCalendarColors )
       
   473     {
       
   474     TRACE_ENTRY_POINT;
       
   475     
       
   476     TPtrC marker = aRepositoryBuffer;
       
   477     TInt calendarColorOffset;
       
   478     while ((calendarColorOffset = marker.Locate(TChar(KComma)))
       
   479             != KErrNotFound)
       
   480         {
       
   481         TLex lex(marker.Left(calendarColorOffset));
       
   482         TInt colorValue;
       
   483         User::LeaveIfError(lex.Val(colorValue));
       
   484         // append calendar color value to list
       
   485         aCalendarColors.Append(colorValue);
       
   486         // Set marker to one char after the comma.
       
   487         marker.Set(marker.Mid(calendarColorOffset + 1));
       
   488         if (marker.Locate(TChar(KComma)) == KErrNotFound)
       
   489             {
       
   490             lex = marker.Left(marker.Length());
       
   491             User::LeaveIfError(lex.Val(colorValue));
       
   492             aCalendarColors.Append(colorValue);
       
   493             }
       
   494         }
       
   495     TRACE_EXIT_POINT;
       
   496     }
       
   497 
       
   498 // ----------------------------------------------------------------------------
       
   499 // CCalenServer::SetCalendarAddPropertiesL
       
   500 // (other items were commented in a header).
       
   501 // ----------------------------------------------------------------------------
       
   502 //
       
   503 void CCalenServer::SetCalendarAddPropertiesL(CCalCalendarInfo& aCalendarInfo)
       
   504     {
       
   505     TRACE_ENTRY_POINT
       
   506 
       
   507     // EFolderLUID
       
   508     TBuf8<KBuffLength> keyBuff;
       
   509     keyBuff.AppendNum(EFolderLUID);
       
   510     TRAPD(err,aCalendarInfo.PropertyValueL(keyBuff));
       
   511 
       
   512     if (KErrNotFound == err)
       
   513         {
       
   514         TUint calValue = 0;
       
   515         //Get the available offset value and set as property value.
       
   516         calValue = CCalenMultiCalUtil::GetNextAvailableOffsetL();
       
   517         TPckgC<TUint> calValuePckg(calValue);
       
   518         aCalendarInfo.SetPropertyL(keyBuff, calValuePckg);
       
   519         }
       
   520     
       
   521     // ECreationTime
       
   522     TTime currentTime;
       
   523     currentTime.HomeTime();
       
   524     
       
   525     keyBuff.Zero();
       
   526     keyBuff.AppendNum(ECreationTime);
       
   527     TRAP( err, aCalendarInfo.PropertyValueL( keyBuff ) );
       
   528 
       
   529     if (KErrNotFound == err)
       
   530         {
       
   531         TPckgC<TTime> pkgCreationTime(currentTime);
       
   532         aCalendarInfo.SetPropertyL(keyBuff, pkgCreationTime);
       
   533         }
       
   534     
       
   535     // EModificationTime
       
   536     keyBuff.Zero();
       
   537     keyBuff.AppendNum(EModificationTime);
       
   538 
       
   539     //At creation modification time will be same as creation time
       
   540     TPckgC<TTime> pkgModificationTime(currentTime);
       
   541     aCalendarInfo.SetPropertyL(keyBuff, pkgModificationTime);
       
   542     
       
   543     
       
   544     // ESyncStatus
       
   545     keyBuff.Zero();
       
   546     keyBuff.AppendNum(ESyncStatus);
       
   547 
       
   548     TBool status = EFalse;
       
   549     TPckgC<TBool> pkgSyncStatus(status);
       
   550     aCalendarInfo.SetPropertyL(keyBuff, pkgSyncStatus);
       
   551     
       
   552     // EIsSharedFolder
       
   553     keyBuff.Zero();
       
   554     keyBuff.AppendNum(EIsSharedFolder);
       
   555 
       
   556     TPckgC<TBool> pkgIsSharedFolder(ETrue);
       
   557     aCalendarInfo.SetPropertyL(keyBuff, pkgIsSharedFolder);
       
   558     
       
   559     // EGlobalUUID
       
   560     keyBuff.Zero();
       
   561     keyBuff.AppendNum(EGlobalUUID);
       
   562     TRAP(err,aCalendarInfo.PropertyValueL(keyBuff));
       
   563     
       
   564     if (KErrNotFound == err)
       
   565         {
       
   566         CCalenInterimUtils2* interimUtils = CCalenInterimUtils2::NewL();
       
   567         CleanupStack::PushL( interimUtils );
       
   568         HBufC8* guuid = interimUtils->GlobalUidL();
       
   569         TPtr8 guuidPtr = guuid->Des();
       
   570         CleanupStack::PushL( guuid );
       
   571         aCalendarInfo.SetPropertyL(keyBuff, guuidPtr);
       
   572         CleanupStack::PopAndDestroy( guuid );
       
   573         CleanupStack::PopAndDestroy( interimUtils );
       
   574         }
       
   575 
       
   576     // EOwnerName
       
   577     keyBuff.Zero();
       
   578     keyBuff.AppendNum(EOwnerName);
       
   579     TRAP(err,aCalendarInfo.PropertyValueL(keyBuff));
       
   580     
       
   581     if (KErrNotFound == err)
       
   582         {
       
   583         _LIT8( KCalendarOwnerName, "myself" );
       
   584         aCalendarInfo.SetPropertyL(keyBuff, KCalendarOwnerName);
       
   585         }
       
   586     
       
   587     // EMarkAsDelete
       
   588     keyBuff.Zero();
       
   589     keyBuff.AppendNum(EMarkAsDelete);
       
   590     TPckgC<TBool> pkgMarkAsDelete(EFalse);
       
   591     aCalendarInfo.SetPropertyL(keyBuff, pkgMarkAsDelete);
       
   592 
       
   593     TRACE_EXIT_POINT    
       
   594     }
       
   595 
       
   596 // End of File