summaryrefslogtreecommitdiffstats
path: root/plugins/contacts/symbian/contactsmodel/inc/cntsync.h
blob: dff082dc328a46ae0d2644cf4373681d74dba0bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
/*
* Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
* Contact: http://www.qt-project.org/legal
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
*
*/


#ifndef __CNTSYNC_H__
#define __CNTSYNC_H__

#include <e32base.h>
#include <cntdef.h>

class CContactICCEntry;
class MContactSynchroniser
/** 
Abstract interface for a contacts phonebook synchroniser.

It should be inherited by classes which implement the phonebook 
synchroniser API. The plug-in should have a second UID of 
0x101F4A6E (KUidContactSynchroniserDll).

@publishedAll
*/
	{
public:
	/**
	@publishedAll
	@released
	*/
	enum TValidateOperation
		{
		ERead,		/** Check a cached ICC contact can be read */
		ESearch,	/** Check a cached ICC contact can be searched */
		EEdit		/** Check a cached ICC contact can be edited */
		};
public:
	/*
	A CContactICCEntry is wanted for read/search or edit.
	*/
	virtual TInt ValidateContact(TValidateOperation aOp, TContactItemId aId) = 0;
	/*
	A CContactICCEntry has being added/edited.
	*/
	virtual TInt ValidateWriteContact(CContactICCEntry& aContactItem) = 0;
	/*
	A CContactICCEntry is being deleted from the database.
	*/
	virtual TInt DeleteContact(TContactItemId aId) = 0;
	/*
	Release resources used by Phonebook Synchroniser. Called prior to unloading plug-in.
	*/
	virtual void Release() = 0;
	/*
	A new CContactICCEntry has been added to the database. 
	(Called after ValidateWriteContact() and database write has completed.)
	*/
	virtual void UpdatePostWriteL(const CContactICCEntry& aContactItem) = 0;

	/*
	Id of template contact for specified phonebook
	*/
	virtual TContactItemId ICCTemplateIdL(TUid aPhonebookUid) = 0;

	/*
	Id of contact group for specified phonebook
	*/
	virtual TContactItemId GroupIdL(TUid aPhonebookUid) = 0;

	/*
	Request notifiction of Synchronisation state changes for specified phonebook
	*/
	virtual void NotifySyncStateChange(TRequestStatus& aStatus, TUid aPhonebookUid) = 0;
	/*
	Cancel notification of Synchronisation state changes for specified phonebook
	*/
	virtual void CancelNotifyRequest(TUid aPhonebookUid) = 0;
	/*
	Test Synchronisation state changes for specified phonebook
	*/
	virtual TBool IsSynchronisedL(TUid aPhonebookUid) = 0;

	/*
	List of Phonebooks supported by Phonebook Synchroniser that may be present on the ICC.
	*/
	virtual TInt PhonebookList(RArray<TUid>& aPhonebookList) = 0;

private:
	IMPORT_C virtual void MContactSynchroniser_Reserved_1();
	};

#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS

/** The UID for the default phone book synchroniser ECom plugin interface.
@publishedPartner
*/
const TUid KUidEcomCntPhBkSyncInterface = {0x102035FD};
	
class CContactSynchroniser : public CBase, public MContactSynchroniser
/** 
Abstract interface for a ECom contacts phonebook synchroniser plugin

It should be inherited by classes which implement the phonebook 
synchroniser API in a platform secured environment. The ECom plug-in interface uid is 
KUidEcomCntPhBkSyncInterface
@publishedPartner
*/
	{
public:
	// From MContactSynchroniser
	virtual TInt ValidateContact(TValidateOperation aOp, TContactItemId aId) = 0;
	virtual TInt ValidateWriteContact(CContactICCEntry& aContactItem) = 0;
	virtual TInt DeleteContact(TContactItemId aId) = 0;
	virtual void Release() = 0;
	virtual void UpdatePostWriteL(const CContactICCEntry& aContactItem) = 0;
	virtual TContactItemId ICCTemplateIdL(TUid aPhonebookUid) = 0;
	virtual TContactItemId GroupIdL(TUid aPhonebookUid) = 0;
	virtual void NotifySyncStateChange(TRequestStatus& aStatus, TUid aPhonebookUid) = 0;
	virtual void CancelNotifyRequest(TUid aPhonebookUid) = 0;
	virtual TBool IsSynchronisedL(TUid aPhonebookUid) = 0;
	virtual TInt PhonebookList(RArray<TUid>& aPhonebookList) = 0;
public:
	static CContactSynchroniser* NewL();
	IMPORT_C virtual ~CContactSynchroniser();
private:
	TUid iDtor_ID_Key;
	};

#endif
	
#endif