williamr@2: /* williamr@2: * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: A CenRep interface for last used sync solutions williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: /*! \file seconsdkcrkeys.h williamr@2: \brief A CenRep interface for last used sync solutions williamr@2: * williamr@2: * \b Purpose: williamr@2: * williamr@2: * Calendar/contact data easily gets corrupted if a user is using several remote synchronization solutions at the same time. williamr@2: * The purpose of this API is to provide the synchronization solution vendors a way to williamr@2: * - Indicate that they’re active synchronization solution for some content type williamr@2: * - Detect that other synchronization solutions may be in use in the device. williamr@2: * . williamr@2: * \b API \b Description: williamr@2: * williamr@2: * Synchronizing content over several mechanisms from the device causes easily difficult problems, as the different protocols williamr@2: * and systems are not aware of each other. williamr@2: * williamr@2: * For example, a synchronization solution using standard OMA DS technology is not aware of the williamr@2: * simultaneous existence of some proprietary synchronization (aka. mobile PIM) solution, williamr@2: * and vice versa. This is likely to cause problems, as the users may not be aware of the side williamr@2: * effects that may occur from using several such solutions at the same time. Currently the williamr@2: * problem is recognized by the vendors, and device applications do their best to warn user williamr@2: * from using any other synchronization solution than the one being installed. williamr@2: * williamr@2: * This API intends to enhance the warning mechanism in two ways: williamr@2: * - Provide the way for different solutions to know about each other, and williamr@2: * - Offer a standard procedure how different solutions should behave when several solutions are used by the user williamr@2: * . williamr@2: * This is achieved with a simple setting API utilizing Symbian OS Central Repository. williamr@2: williamr@2: * \b Use \b cases: williamr@2: * williamr@2: * The use cases supported by this API are: williamr@2: * -# Detect currently active synchronization solution williamr@2: * - When a synchronization solution is about to take some supported content type into use, williamr@2: * it should check whether there is some other Uid already present in the setting. If williamr@2: * there isn’t, the solution should put it’s own Uid into the setting value. If there is williamr@2: * some unknown Uid, the setting should be aware that it’s changelog for that particular williamr@2: * content may be out-of-date, and a full re-sync should be issued. It’s up to the solution williamr@2: * vendor to decide, whether the user should be notified about this. The user readable name williamr@2: * of the active solution is readable using Symbian AppArc API method \code RApaLsSession::GetAppInfo() \endcode williamr@2: * . williamr@2: * -# Activate a synchronization solution for certain content type williamr@2: * - This use case allows the synchronization solution to register it’s Uid into the Central williamr@2: * Repository. This information is used by other compliant solutions to find out the active williamr@2: * solution for all supported content types williamr@2: * . williamr@2: * . williamr@2: *\b Using \b the \b Synchronization \b Capability \b API: williamr@2: * -# Detect currently active synchronization solution williamr@2: * - Before activating itself as the active solution, the client of this API should check williamr@2: * whether some other client has registered itself as the preferred solution for certain williamr@2: * content type synchronization. An example of the check is: williamr@2: * \code williamr@2: * CRepository* repository = CRepository::NewL( KCRUidSecon ); williamr@2: * TInt someSolutionInt; //Active solution UID williamr@2: * // Get last used calendar sync solution.. williamr@2: * TInt ret = repository->Get( KSeconCalendarUid, someSolutionInt ); williamr@2: * TUid someSolutionUid = TUid::Uid(someSolutionInt) williamr@2: * TUid mySolutionUid={0xf1f2f3f4}; //Application’s UID williamr@2: * if(someSolutionUid != mySolutionUid) williamr@2: * { williamr@2: * ...//Solution specific actions williamr@2: * } williamr@2: * \endcode williamr@2: * . williamr@2: * - If some other synchronization solution is active for the intended content type, the williamr@2: * solution can still rewrite the old value, but it should note that a full resync may be williamr@2: * needed in order to maintain system wide data consistency. It is up to the solution UI williamr@2: * to decide, what kind of notification, if any, is given to the user. williamr@2: * . williamr@2: * -# Activate a solution for the content type williamr@2: * - This use case is executed either during solution installation/commissioning, or at least williamr@2: * before first synchronization. The activation is simple: williamr@2: * \code williamr@2: * CRepository* repository = CRepository::NewL( KCRUidSecon ); williamr@2: * TUid mySolutionUid={0xf1f2f3f4}; //Application’s UID williamr@2: * // Set mySolutionUid to last used calendar sync solution.. williamr@2: * TInt ret = repository->Set( KSeconCalendarUid, (TInt) mySolutionUid.iUid ); williamr@2: * \endcode williamr@2: * . williamr@2: * - Howto store also timestamp williamr@2: * \code williamr@2: * // Timeformat is YYYYMMDDTHHMMSSZ (universal time), williamr@2: * // where MM=1..12, DD=1..number of days in month, HH=0..23, MM=0..59, SS=0..59 williamr@2: * _LIT( KFormatDate, "%04d%02d%02dT%02d%02d%02dZ" ); williamr@2: * TTime timeNow; williamr@2: * timeNow.UniversalTime(); // Store always universal time williamr@2: * TDateTime now = timeNow.DateTime(); williamr@2: * TBuf<16> dateBuf; williamr@2: * dateBuf.Format( KFormatDate, now.Year(), now.Month() + 1, williamr@2: * now.Day() + 1, now.Hour(), now.Minute(), now.Second() ); williamr@2: * repository->Set( KSeconCalendarTime, dateBuf ); williamr@2: * \endcode williamr@2: * . williamr@2: * -# Error handling williamr@2: * - As defined in the Central Repository API. williamr@2: * . williamr@2: */ williamr@2: williamr@2: #ifndef SECONSDKCRKEYS_H williamr@2: #define SECONSDKCRKEYS_H williamr@2: williamr@2: //! Repository Uid williamr@2: /*! Contains settings for the supported williamr@2: * content types. Each setting is integer, which is to hold either the Application Uid or the williamr@2: * package Uid of the active solution. williamr@2: */ williamr@2: const TUid KCRUidSecon = {0x2000F83D}; williamr@2: williamr@2: //! Calendar Uid Setting Integer williamr@2: const TUint32 KSeconCalendarUid = 0x00000001; williamr@2: williamr@2: //! Calendar Time Setting Integer williamr@2: const TUint32 KSeconCalendarTime = 0x00000002; williamr@2: williamr@2: //! Contacts Uid Setting Integer williamr@2: const TUint32 KSeconContactsUid = 0x00000003; williamr@2: williamr@2: //! Contacts Time Setting Integer williamr@2: const TUint32 KSeconContactsTime = 0x00000004; williamr@2: williamr@2: //! Sms Uid Setting Integer williamr@2: const TUint32 KSeconSmsUid = 0x00000005; williamr@2: williamr@2: //! Sms Time Setting Integer williamr@2: const TUint32 KSeconSmsTime = 0x00000006; williamr@2: williamr@2: //! Bookmark Uid Setting Integer williamr@2: const TUint32 KSeconBookmarkUid = 0x00000007; williamr@2: williamr@2: //! Bookmark Time Setting Integer williamr@2: const TUint32 KSeconBookmarkTime = 0x00000008; williamr@2: williamr@2: #endif // SECONSDKCRKEYS_H