epoc32/include/app/cntsync.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
equal deleted inserted replaced
2:2fe1408b6811 3:e1b950c65cb4
       
     1 // Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // 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
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CNTSYNC_H__
       
    17 #define __CNTSYNC_H__
       
    18 
       
    19 
       
    20 #include <e32base.h>
       
    21 #include <cntdef.h>
       
    22 
       
    23 class CContactICCEntry;
       
    24 class MContactSynchroniser
       
    25 /** 
       
    26 Abstract interface for a contacts phonebook synchroniser.
       
    27 
       
    28 It should be inherited by classes which implement the phonebook 
       
    29 synchroniser API. The plug-in should have a second UID of 
       
    30 0x101F4A6E (KUidContactSynchroniserDll).
       
    31 
       
    32 @internalAll
       
    33 */
       
    34 	{
       
    35 public:
       
    36 	/**
       
    37 	@internalAll
       
    38 	*/
       
    39 	enum TValidateOperation
       
    40 		{
       
    41 		ERead,		/** Check a cached ICC contact can be read */
       
    42 		ESearch,	/** Check a cached ICC contact can be searched */
       
    43 		EEdit		/** Check a cached ICC contact can be edited */
       
    44 		};
       
    45 public:
       
    46 	/*
       
    47 	A CContactICCEntry is wanted for read/search or edit.
       
    48 	*/
       
    49 	virtual TInt ValidateContact(TValidateOperation aOp, TContactItemId aId) = 0;
       
    50 	/*
       
    51 	A CContactICCEntry has being added/edited.
       
    52 	*/
       
    53 	virtual TInt ValidateWriteContact(CContactICCEntry& aContactItem) = 0;
       
    54 	/*
       
    55 	A CContactICCEntry is being deleted from the database.
       
    56 	*/
       
    57 	virtual TInt DeleteContact(TContactItemId aId) = 0;
       
    58 	/*
       
    59 	Release resources used by Phonebook Synchroniser. Called prior to unloading plug-in.
       
    60 	*/
       
    61 	virtual void Release() = 0;
       
    62 	/*
       
    63 	A new CContactICCEntry has been added to the database. 
       
    64 	(Called after ValidateWriteContact() and database write has completed.)
       
    65 	*/
       
    66 	virtual void UpdatePostWriteL(const CContactICCEntry& aContactItem) = 0;
       
    67 
       
    68 	/*
       
    69 	Id of template contact for specified phonebook
       
    70 	*/
       
    71 	virtual TContactItemId ICCTemplateIdL(TUid aPhonebookUid) = 0;
       
    72 
       
    73 	/*
       
    74 	Id of contact group for specified phonebook
       
    75 	*/
       
    76 	virtual TContactItemId GroupIdL(TUid aPhonebookUid) = 0;
       
    77 
       
    78 	/*
       
    79 	Request notifiction of Synchronisation state changes for specified phonebook
       
    80 	*/
       
    81 	virtual void NotifySyncStateChange(TRequestStatus& aStatus, TUid aPhonebookUid) = 0;
       
    82 	/*
       
    83 	Cancel notification of Synchronisation state changes for specified phonebook
       
    84 	*/
       
    85 	virtual void CancelNotifyRequest(TUid aPhonebookUid) = 0;
       
    86 	/*
       
    87 	Test Synchronisation state changes for specified phonebook
       
    88 	*/
       
    89 	virtual TBool IsSynchronisedL(TUid aPhonebookUid) = 0;
       
    90 
       
    91 	/*
       
    92 	List of Phonebooks supported by Phonebook Synchroniser that may be present on the ICC.
       
    93 	*/
       
    94 	virtual TInt PhonebookList(RArray<TUid>& aPhonebookList) = 0;
       
    95 
       
    96 private:
       
    97 	IMPORT_C virtual void MContactSynchroniser_Reserved_1();
       
    98 	};
       
    99 	
       
   100 
       
   101 /** The UID for the default phone book synchroniser ECom plugin interface
       
   102 */
       
   103 const TUid KUidEcomCntPhBkSyncInterface = {0x102035FD};
       
   104 	
       
   105 class CContactSynchroniser : public CBase, public MContactSynchroniser
       
   106 /** 
       
   107 Abstract interface for a ECom contacts phonebook synchroniser plugin
       
   108 
       
   109 It should be inherited by classes which implement the phonebook 
       
   110 synchroniser API in a platform secured environment. The ECom plug-in interface uid is 
       
   111 KUidEcomCntPhBkSyncInterface
       
   112 @internalAll
       
   113 */
       
   114 	{
       
   115 public:
       
   116 	// From MContactSynchroniser
       
   117 	virtual TInt ValidateContact(TValidateOperation aOp, TContactItemId aId) = 0;
       
   118 	virtual TInt ValidateWriteContact(CContactICCEntry& aContactItem) = 0;
       
   119 	virtual TInt DeleteContact(TContactItemId aId) = 0;
       
   120 	virtual void Release() = 0;
       
   121 	virtual void UpdatePostWriteL(const CContactICCEntry& aContactItem) = 0;
       
   122 	virtual TContactItemId ICCTemplateIdL(TUid aPhonebookUid) = 0;
       
   123 	virtual TContactItemId GroupIdL(TUid aPhonebookUid) = 0;
       
   124 	virtual void NotifySyncStateChange(TRequestStatus& aStatus, TUid aPhonebookUid) = 0;
       
   125 	virtual void CancelNotifyRequest(TUid aPhonebookUid) = 0;
       
   126 	virtual TBool IsSynchronisedL(TUid aPhonebookUid) = 0;
       
   127 	virtual TInt PhonebookList(RArray<TUid>& aPhonebookList) = 0;
       
   128 public:
       
   129 	static CContactSynchroniser* NewL();
       
   130 	IMPORT_C virtual ~CContactSynchroniser();
       
   131 private:
       
   132 	TUid iDtor_ID_Key;
       
   133 	};
       
   134 
       
   135 #endif