2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: SyncML APIs for data synchronization client.
19 #ifndef __SYNCMLCLIENTDS_H__
20 #define __SYNCMLCLIENTDS_H__
22 #include <SyncMLClient.h>
23 #include <SyncMLDataFilter.h>
25 class CClientSessionData;
28 ///////////////////////////////////////////////////////////////////////////////
30 ///////////////////////////////////////////////////////////////////////////////
31 class RSyncMLDataSyncJob : public RSyncMLJobBase
33 Handle to a data synchronisation job.
35 A job synchronises the data in one or more data stores, as defined by the list
42 IMPORT_C RSyncMLDataSyncJob();
43 IMPORT_C void CreateL(RSyncMLSession&, TSmlProfileId);
44 IMPORT_C void CreateL(RSyncMLSession&, TSmlProfileId, TSmlConnectionId);
45 IMPORT_C void CreateL(RSyncMLSession&, TSmlProfileId, TSmlSyncType);
46 IMPORT_C void CreateL(RSyncMLSession&, TSmlProfileId, TSmlConnectionId, TSmlSyncType);
47 IMPORT_C void CreateL(RSyncMLSession&, TSmlProfileId, const RArray<TSmlTaskId>&);
48 IMPORT_C void CreateL(RSyncMLSession&, TSmlProfileId, TSmlConnectionId, const RArray<TSmlTaskId>&);
49 IMPORT_C void CreateL(RSyncMLSession&, TSmlProfileId, TSmlSyncType, const RArray<TSmlTaskId>&);
50 IMPORT_C void CreateL(RSyncMLSession&, TSmlProfileId, TSmlConnectionId, TSmlSyncType, const RArray<TSmlTaskId>&);
51 IMPORT_C void OpenL(RSyncMLSession&, TSmlJobId);
52 IMPORT_C void StopL();
53 IMPORT_C const RArray<TSmlTaskId>& TaskIDs() const;
56 ///////////////////////////////////////////////////////////////////////////////
57 ///////////////////////////////////////////////////////////////////////////////
60 ///////////////////////////////////////////////////////////////////////////////
61 // RSyncMLDataSyncProfile
62 ///////////////////////////////////////////////////////////////////////////////
63 class RSyncMLDataSyncProfile : public RSyncMLProfileBase
65 Handle to a SyncML Data Synchronisation profile.
67 A profile encapsulates a relationship with a single SyncML remote server,
68 and contains a number of 'tasks' and 'connections'.
74 IMPORT_C RSyncMLDataSyncProfile();
75 IMPORT_C void CreateL(RSyncMLSession&);
76 IMPORT_C void OpenL(RSyncMLSession&, TSmlProfileId, TSmlOpenMode);
78 IMPORT_C void SetCreatorId(TSmlCreatorId);
79 IMPORT_C void SetDisplayNameL(const TDesC&);
80 IMPORT_C void SetUserNameL(const TDesC8&);
81 IMPORT_C void SetPasswordL(const TDesC8&);
83 IMPORT_C void DeleteConnectionL(TSmlTransportId);
85 IMPORT_C void ListTasksL(RArray<TSmlTaskId>&) const;
86 IMPORT_C void DeleteTaskL(TSmlTaskId);
88 IMPORT_C void UpdateL();
91 ///////////////////////////////////////////////////////////////////////////////
92 ///////////////////////////////////////////////////////////////////////////////
95 ///////////////////////////////////////////////////////////////////////////////
97 ///////////////////////////////////////////////////////////////////////////////
98 class RSyncMLTask : public RSubSessionBase
100 Represents a mapping between a local data store and a remote
101 data store on a SyncML server in the context of a profile.
107 IMPORT_C RSyncMLTask();
108 IMPORT_C void CreateL(RSyncMLDataSyncProfile&, TSmlDataProviderId,
109 const TDesC& aServerDataSource, const TDesC& aClientDataSource);
110 IMPORT_C void CreateL(RSyncMLDataSyncProfile&, TSmlDataProviderId,
111 const TDesC& aServerDataSource, const TDesC& aClientDataSource, RPointerArray<CSyncMLFilter>& aArray);
112 IMPORT_C void OpenL(RSyncMLDataSyncProfile&, TSmlTaskId);
114 IMPORT_C TSmlTaskId Identifier() const;
115 IMPORT_C TSmlProfileId Profile() const;
116 IMPORT_C TSmlCreatorId CreatorId() const;
117 IMPORT_C const TDesC& DisplayName() const;
118 IMPORT_C const TDesC& ServerDataSource() const;
119 IMPORT_C const TDesC& ClientDataSource() const;
120 IMPORT_C TSmlDataProviderId DataProvider() const;
121 IMPORT_C TSmlSyncType DefaultSyncType() const;
123 //IMPORT_C TInt ServerFilterCount() const;
124 //IMPORT_C const CSyncMLFilter& ServerFilterL(TInt aIndex) const; // Get the server filter at the specified index
125 IMPORT_C TSyncMLFilterMatchType FilterMatchType() const;
126 IMPORT_C TBool Enabled() const;
128 IMPORT_C void SetCreatorId(TSmlCreatorId);
129 IMPORT_C void SetDisplayNameL(const TDesC&);
130 IMPORT_C void SetDefaultSyncTypeL(TSmlSyncType);
131 //IMPORT_C void ReplaceServerFilterL(TInt aIndex, const CSyncMLFilter& aFilter); // Replaces the server filter at the specified index
132 //IMPORT_C TInt AddServerFilterL(const CSyncMLFilter& aFilter); // Adds the server filter, returns the index at which it was added
133 //IMPORT_C void DeleteServerFilterL(TInt aIndex); // Deletes the server filter at the specified index
134 //IMPORT_C void DeleteAllServerFiltersL(); // Deletes all server filters
135 //IMPORT_C void SetServerFilterEnabledL(TInt aIndex, TBool aEnable); // Changes the enabled flag for the server filter at the specified index
136 IMPORT_C void SetFilterMatchTypeL(TSyncMLFilterMatchType) const;
137 IMPORT_C void SetEnabledL(TBool);
139 /* Return the set of filters that can be used to send to the SyncML server. This will only contain filters which are
140 supported by the server, unless
141 1) no previous synchronisation with the server was done, or
142 2) the underlying Data Provider does not support this feature. In both cases the full list of filters supported by
143 the Data Provider will be returned. */
144 IMPORT_C RPointerArray<CSyncMLFilter>& SupportedServerFiltersL( TSyncMLFilterChangeInfo& aChangeInfo ) const;
145 IMPORT_C TBool SupportsUserSelectableMatchType() const;
147 IMPORT_C TBool IsReadOnly() const;
148 IMPORT_C void UpdateL();
149 IMPORT_C void Close();
152 mutable CClientSessionData* iData;
155 RSyncMLTask& operator=(const RSyncMLTask&);
156 RSyncMLTask(const RSyncMLTask&);
159 ///////////////////////////////////////////////////////////////////////////////
160 ///////////////////////////////////////////////////////////////////////////////
163 ///////////////////////////////////////////////////////////////////////////////
164 // RSyncMLDataProvider
165 ///////////////////////////////////////////////////////////////////////////////
166 class RSyncMLDataProvider : public RSubSessionBase
168 Handle to information about an available SyncML data provider.
174 IMPORT_C RSyncMLDataProvider();
175 IMPORT_C void OpenL(RSyncMLSession&, TSmlDataProviderId);
177 IMPORT_C TSmlDataProviderId Identifier() const;
178 IMPORT_C TVersion Version() const;
179 IMPORT_C const TDesC& DisplayName() const;
181 IMPORT_C TInt MimeTypeCount() const;
182 IMPORT_C const TDesC& MimeType(TInt aIndex) const;
183 IMPORT_C const TDesC& MimeVersion(TInt aIndex) const;
185 IMPORT_C const TDesC& DefaultDataStoreName() const;
186 IMPORT_C TBool AllowsMultipleDataStores() const;
187 IMPORT_C void GetDataStoreNamesL(CDesCArray&) const;
189 /* Return the set of filters that can be used to send to the SyncML server */
190 //IMPORT_C const RPointerArray<CSyncMLFilterDef>& SupportedServerFiltersL() const;
192 IMPORT_C TSmlProtocolVersion RequiredProtocolVersionL() const;
194 IMPORT_C void Close();
197 mutable CClientSessionData* iData;
200 RSyncMLDataProvider& operator=(const RSyncMLDataProvider&);
201 RSyncMLDataProvider(const RSyncMLDataProvider&);
204 ///////////////////////////////////////////////////////////////////////////////
205 ///////////////////////////////////////////////////////////////////////////////
207 ///////////////////////////////////////////////////////////////////////////////
208 ///////////////////////////////////////////////////////////////////////////////
209 ///////////////////////////////////////////////////////////////////////////////