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