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