1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/mw/seconsdkcrkeys.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,151 @@
1.4 +/*
1.5 +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: A CenRep interface for last used sync solutions
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +/*! \file seconsdkcrkeys.h
1.23 + \brief A CenRep interface for last used sync solutions
1.24 +*
1.25 +* \b Purpose:
1.26 +*
1.27 +* Calendar/contact data easily gets corrupted if a user is using several remote synchronization solutions at the same time.
1.28 +* The purpose of this API is to provide the synchronization solution vendors a way to
1.29 +* - Indicate that they’re active synchronization solution for some content type
1.30 +* - Detect that other synchronization solutions may be in use in the device.
1.31 +* .
1.32 +* \b API \b Description:
1.33 +*
1.34 +* Synchronizing content over several mechanisms from the device causes easily difficult problems, as the different protocols
1.35 +* and systems are not aware of each other.
1.36 +*
1.37 +* For example, a synchronization solution using standard OMA DS technology is not aware of the
1.38 + * simultaneous existence of some proprietary synchronization (aka. mobile PIM) solution,
1.39 + * and vice versa. This is likely to cause problems, as the users may not be aware of the side
1.40 + * effects that may occur from using several such solutions at the same time. Currently the
1.41 + * problem is recognized by the vendors, and device applications do their best to warn user
1.42 + * from using any other synchronization solution than the one being installed.
1.43 + *
1.44 + * This API intends to enhance the warning mechanism in two ways:
1.45 + * - Provide the way for different solutions to know about each other, and
1.46 + * - Offer a standard procedure how different solutions should behave when several solutions are used by the user
1.47 + * .
1.48 + * This is achieved with a simple setting API utilizing Symbian OS Central Repository.
1.49 +
1.50 + * \b Use \b cases:
1.51 + *
1.52 + * The use cases supported by this API are:
1.53 + * -# Detect currently active synchronization solution
1.54 +* - When a synchronization solution is about to take some supported content type into use,
1.55 + * it should check whether there is some other Uid already present in the setting. If
1.56 + * there isn’t, the solution should put it’s own Uid into the setting value. If there is
1.57 + * some unknown Uid, the setting should be aware that it’s changelog for that particular
1.58 + * content may be out-of-date, and a full re-sync should be issued. It’s up to the solution
1.59 + * vendor to decide, whether the user should be notified about this. The user readable name
1.60 + * of the active solution is readable using Symbian AppArc API method \code RApaLsSession::GetAppInfo() \endcode
1.61 +* .
1.62 +* -# Activate a synchronization solution for certain content type
1.63 + * - This use case allows the synchronization solution to register it’s Uid into the Central
1.64 + * Repository. This information is used by other compliant solutions to find out the active
1.65 + * solution for all supported content types
1.66 +* .
1.67 +* .
1.68 +*\b Using \b the \b Synchronization \b Capability \b API:
1.69 + * -# Detect currently active synchronization solution
1.70 + * - Before activating itself as the active solution, the client of this API should check
1.71 + * whether some other client has registered itself as the preferred solution for certain
1.72 + * content type synchronization. An example of the check is:
1.73 + * \code
1.74 +* CRepository* repository = CRepository::NewL( KCRUidSecon );
1.75 + * TInt someSolutionInt; //Active solution UID
1.76 + * // Get last used calendar sync solution..
1.77 + * TInt ret = repository->Get( KSeconCalendarUid, someSolutionInt );
1.78 + * TUid someSolutionUid = TUid::Uid(someSolutionInt)
1.79 + * TUid mySolutionUid={0xf1f2f3f4}; //Application’s UID
1.80 + * if(someSolutionUid != mySolutionUid)
1.81 + * {
1.82 + * ...//Solution specific actions
1.83 + * }
1.84 + * \endcode
1.85 + * .
1.86 + * - If some other synchronization solution is active for the intended content type, the
1.87 + * solution can still rewrite the old value, but it should note that a full resync may be
1.88 + * needed in order to maintain system wide data consistency. It is up to the solution UI
1.89 + * to decide, what kind of notification, if any, is given to the user.
1.90 + * .
1.91 + * -# Activate a solution for the content type
1.92 + * - This use case is executed either during solution installation/commissioning, or at least
1.93 + * before first synchronization. The activation is simple:
1.94 + * \code
1.95 + * CRepository* repository = CRepository::NewL( KCRUidSecon );
1.96 + * TUid mySolutionUid={0xf1f2f3f4}; //Application’s UID
1.97 + * // Set mySolutionUid to last used calendar sync solution..
1.98 + * TInt ret = repository->Set( KSeconCalendarUid, (TInt) mySolutionUid.iUid );
1.99 + * \endcode
1.100 +* .
1.101 + * - Howto store also timestamp
1.102 + * \code
1.103 + * // Timeformat is YYYYMMDDTHHMMSSZ (universal time),
1.104 + * // where MM=1..12, DD=1..number of days in month, HH=0..23, MM=0..59, SS=0..59
1.105 + * _LIT( KFormatDate, "%04d%02d%02dT%02d%02d%02dZ" );
1.106 + * TTime timeNow;
1.107 + * timeNow.UniversalTime(); // Store always universal time
1.108 + * TDateTime now = timeNow.DateTime();
1.109 + * TBuf<16> dateBuf;
1.110 + * dateBuf.Format( KFormatDate, now.Year(), now.Month() + 1,
1.111 + * now.Day() + 1, now.Hour(), now.Minute(), now.Second() );
1.112 + * repository->Set( KSeconCalendarTime, dateBuf );
1.113 + * \endcode
1.114 + * .
1.115 + * -# Error handling
1.116 + * - As defined in the Central Repository API.
1.117 + * .
1.118 +*/
1.119 +
1.120 +#ifndef SECONSDKCRKEYS_H
1.121 +#define SECONSDKCRKEYS_H
1.122 +
1.123 +//! Repository Uid
1.124 +/*! Contains settings for the supported
1.125 + * content types. Each setting is integer, which is to hold either the Application Uid or the
1.126 + * package Uid of the active solution.
1.127 +*/
1.128 +const TUid KCRUidSecon = {0x2000F83D};
1.129 +
1.130 +//! Calendar Uid Setting Integer
1.131 +const TUint32 KSeconCalendarUid = 0x00000001;
1.132 +
1.133 +//! Calendar Time Setting Integer
1.134 +const TUint32 KSeconCalendarTime = 0x00000002;
1.135 +
1.136 +//! Contacts Uid Setting Integer
1.137 +const TUint32 KSeconContactsUid = 0x00000003;
1.138 +
1.139 +//! Contacts Time Setting Integer
1.140 +const TUint32 KSeconContactsTime = 0x00000004;
1.141 +
1.142 +//! Sms Uid Setting Integer
1.143 +const TUint32 KSeconSmsUid = 0x00000005;
1.144 +
1.145 +//! Sms Time Setting Integer
1.146 +const TUint32 KSeconSmsTime = 0x00000006;
1.147 +
1.148 +//! Bookmark Uid Setting Integer
1.149 +const TUint32 KSeconBookmarkUid = 0x00000007;
1.150 +
1.151 +//! Bookmark Time Setting Integer
1.152 +const TUint32 KSeconBookmarkTime = 0x00000008;
1.153 +
1.154 +#endif // SECONSDKCRKEYS_H
1.155 \ No newline at end of file