phonebookengines_old/contactsmodel/inc/cntsync.h
changeset 40 b46a585f6909
equal deleted inserted replaced
37:fd64c38c277d 40:b46a585f6909
       
     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 "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.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 #include <e32base.h>
       
    20 #include <cntdef.h>
       
    21 
       
    22 class CContactICCEntry;
       
    23 class MContactSynchroniser
       
    24 /** 
       
    25 Abstract interface for a contacts phonebook synchroniser.
       
    26 
       
    27 It should be inherited by classes which implement the phonebook 
       
    28 synchroniser API. The plug-in should have a second UID of 
       
    29 0x101F4A6E (KUidContactSynchroniserDll).
       
    30 
       
    31 @publishedAll
       
    32 */
       
    33 	{
       
    34 public:
       
    35 	/**
       
    36 	@publishedAll
       
    37 	@released
       
    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 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
   101 
       
   102 /** The UID for the default phone book synchroniser ECom plugin interface.
       
   103 @publishedPartner
       
   104 */
       
   105 const TUid KUidEcomCntPhBkSyncInterface = {0x102035FD};
       
   106 	
       
   107 class CContactSynchroniser : public CBase, public MContactSynchroniser
       
   108 /** 
       
   109 Abstract interface for a ECom contacts phonebook synchroniser plugin
       
   110 
       
   111 It should be inherited by classes which implement the phonebook 
       
   112 synchroniser API in a platform secured environment. The ECom plug-in interface uid is 
       
   113 KUidEcomCntPhBkSyncInterface
       
   114 @publishedPartner
       
   115 */
       
   116 	{
       
   117 public:
       
   118 	// From MContactSynchroniser
       
   119 	virtual TInt ValidateContact(TValidateOperation aOp, TContactItemId aId) = 0;
       
   120 	virtual TInt ValidateWriteContact(CContactICCEntry& aContactItem) = 0;
       
   121 	virtual TInt DeleteContact(TContactItemId aId) = 0;
       
   122 	virtual void Release() = 0;
       
   123 	virtual void UpdatePostWriteL(const CContactICCEntry& aContactItem) = 0;
       
   124 	virtual TContactItemId ICCTemplateIdL(TUid aPhonebookUid) = 0;
       
   125 	virtual TContactItemId GroupIdL(TUid aPhonebookUid) = 0;
       
   126 	virtual void NotifySyncStateChange(TRequestStatus& aStatus, TUid aPhonebookUid) = 0;
       
   127 	virtual void CancelNotifyRequest(TUid aPhonebookUid) = 0;
       
   128 	virtual TBool IsSynchronisedL(TUid aPhonebookUid) = 0;
       
   129 	virtual TInt PhonebookList(RArray<TUid>& aPhonebookList) = 0;
       
   130 public:
       
   131 	static CContactSynchroniser* NewL();
       
   132 	IMPORT_C virtual ~CContactSynchroniser();
       
   133 private:
       
   134 	TUid iDtor_ID_Key;
       
   135 	};
       
   136 
       
   137 #endif
       
   138 	
       
   139 #endif