epoc32/include/mw/seconsdkcrkeys.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2007 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:  A CenRep interface for last used sync solutions
    15 *
    16 */
    17 
    18 
    19 /*! \file seconsdkcrkeys.h  
    20       \brief A CenRep interface for last used sync solutions
    21 *
    22 * \b  Purpose:
    23 *
    24 *	Calendar/contact data easily gets corrupted if a user is using several remote synchronization solutions at the same time. 
    25 *         The purpose of this API is to provide the synchronization  solution vendors a way to 
    26 *		- Indicate that they’re active synchronization solution for some  content type
    27 *		- Detect that other synchronization solutions may be in use in the device.
    28 *		.
    29 * \b  API \b Description:
    30 *
    31 * 	Synchronizing content over several mechanisms from the device causes easily difficult problems, as the different protocols
    32 *	 and systems are not aware of each other. 
    33 *
    34 *	For example, a synchronization solution using standard OMA DS technology is not aware of the
    35  * 	simultaneous existence of some proprietary synchronization (aka. mobile PIM) solution,
    36  * 	and vice versa. This is likely to cause problems, as the users may not be aware of the side
    37  *	 effects that may occur from using several such solutions at the same time. Currently the
    38  *	 problem is recognized by the vendors, and device applications do their best to warn user
    39  * 	from using any other synchronization solution than the one being installed.
    40  * 	
    41  *	This API intends to enhance the warning mechanism in two ways:
    42  *   		-  Provide the way for different solutions to know about each other, and
    43  *		-  Offer a standard procedure how different solutions should behave when several solutions are used by the user
    44  *		.
    45  *	 This is achieved with a simple setting API utilizing Symbian OS Central Repository.
    46  
    47  * \b Use \b cases:
    48  *
    49  * 	The use cases supported by this API are:
    50  *  		-# Detect currently active synchronization solution
    51 *			- When a synchronization solution is about to take some supported content type into use,
    52  *        		 it should check whether there is some other Uid already present in the setting. If
    53  *         		there isn’t, the solution should put it’s own Uid into the setting value. If there is
    54  *        		 some unknown Uid, the setting should be aware that it’s changelog for that particular
    55  *         		content may be out-of-date, and a full re-sync should be issued. It’s up to the solution
    56  *        		 vendor to decide, whether the user should be notified about this. The user readable name
    57  *         		of the active solution is readable using Symbian AppArc API method  \code RApaLsSession::GetAppInfo() \endcode
    58 *			.
    59 *		-# Activate a synchronization solution for certain content type
    60  *		        - This use case allows the synchronization solution to register it’s Uid into the Central
    61  *         		Repository. This information is used by other compliant solutions to find out the active
    62  *         		solution for all supported content types
    63 *			.			
    64 *		.
    65 *\b Using \b the \b Synchronization \b Capability \b API:
    66  *  	-#  Detect currently active synchronization solution
    67  *     		- Before activating itself as the active solution, the client of this API should check
    68  *     		whether some other client has registered itself as the preferred solution for certain
    69  *     		content type synchronization. An example of the check is:
    70  *     		\code
    71 *		CRepository* repository = CRepository::NewL( KCRUidSecon );
    72  *     		TInt someSolutionInt; //Active solution UID
    73  *     		// Get last used calendar sync solution..
    74  *     		TInt ret = repository->Get( KSeconCalendarUid, someSolutionInt );
    75  *     		TUid someSolutionUid = TUid::Uid(someSolutionInt)
    76  *     		TUid mySolutionUid={0xf1f2f3f4}; //Application’s UID
    77  *     		if(someSolutionUid != mySolutionUid)
    78  *     		{
    79  *         		...//Solution specific actions
    80  *     		}		
    81  *    		\endcode
    82  *		.
    83  *     		- If some other synchronization solution is active for the intended content type, the
    84  *     		solution can still rewrite the old value, but it should note that a full resync may be
    85  *     		needed in order to maintain system wide data consistency. It is up to the solution UI
    86  *     		to decide, what kind of notification, if any, is given to the user.
    87  *		.
    88  *	-# Activate a solution for the content type
    89  *     		- This use case is executed either during solution installation/commissioning, or at least
    90  *     		before first synchronization. The activation is simple:	
    91  *    		\code
    92  *     		CRepository* repository = CRepository::NewL( KCRUidSecon );
    93  *     		TUid mySolutionUid={0xf1f2f3f4}; //Application’s UID
    94  *     		// Set mySolutionUid to last used calendar sync solution..
    95  *     		TInt ret = repository->Set( KSeconCalendarUid, (TInt) mySolutionUid.iUid );
    96  *		\endcode
    97 *		.
    98  *     		- Howto store also timestamp
    99  *		\code
   100  *     		// Timeformat is YYYYMMDDTHHMMSSZ (universal time),
   101  *     		// where MM=1..12, DD=1..number of days in month, HH=0..23, MM=0..59, SS=0..59
   102  *     		_LIT( KFormatDate, "%04d%02d%02dT%02d%02d%02dZ" );
   103  *     		TTime timeNow;
   104  *     		timeNow.UniversalTime(); // Store always universal time
   105  *     		TDateTime now = timeNow.DateTime();
   106  *     		TBuf<16> dateBuf;
   107  *     		dateBuf.Format( KFormatDate, now.Year(), now.Month() + 1,
   108  *     		now.Day() + 1, now.Hour(), now.Minute(), now.Second() );
   109  *     		repository->Set( KSeconCalendarTime, dateBuf );
   110  *     		\endcode
   111  *		.
   112  * 	-#  Error handling
   113  *     		- As defined in the Central Repository API.
   114  *		.
   115 */     
   116 
   117 #ifndef SECONSDKCRKEYS_H
   118 #define SECONSDKCRKEYS_H
   119 
   120 //! Repository Uid
   121 /*! Contains settings for the supported 
   122  * content types. Each setting is integer, which is to hold either the Application Uid or the
   123  * package Uid of the active solution. 
   124 */
   125 const TUid KCRUidSecon = {0x2000F83D};
   126 
   127 //! Calendar Uid Setting Integer
   128 const TUint32 KSeconCalendarUid = 0x00000001;
   129 
   130 //! Calendar Time Setting Integer
   131 const TUint32 KSeconCalendarTime = 0x00000002;
   132 
   133 //! Contacts Uid Setting Integer
   134 const TUint32 KSeconContactsUid = 0x00000003;
   135 
   136 //! Contacts Time Setting Integer
   137 const TUint32 KSeconContactsTime = 0x00000004;
   138 
   139 //! Sms Uid Setting Integer
   140 const TUint32 KSeconSmsUid = 0x00000005;
   141 
   142 //! Sms Time Setting Integer
   143 const TUint32 KSeconSmsTime = 0x00000006;
   144 
   145 //! Bookmark Uid Setting Integer
   146 const TUint32 KSeconBookmarkUid = 0x00000007;
   147 
   148 //! Bookmark Time Setting Integer
   149 const TUint32 KSeconBookmarkTime = 0x00000008;
   150 
   151 #endif // SECONSDKCRKEYS_H