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: Interface to receive notifications of SyncML session and synchronization progress events.
18 #ifndef __SYNCMLOBSERVERS_H__
19 #define __SYNCMLOBSERVERS_H__
25 ///////////////////////////////////////////////////////////////////////////////
26 // MSyncMLEventObserver
27 // Observer of session events.
28 ///////////////////////////////////////////////////////////////////////////////
29 class MSyncMLEventObserver
31 Interface to receive notifications of SyncML session events.
33 Notifications are requested through RSyncMLSession::RequestEventL().
40 /** SyncML session event types. */
42 /** Job has started. */
44 /** Job has failed to start. */
46 /** Job has stopped. */
48 /** Job could not be parsed, and will not be processed. */
50 /** A profile has been created. */
52 /** A profile has been changed. */
54 /** A profile has been deleted. */
56 /** A transport has timed-out. */
58 /** The SyncML Agent is suspended. This can occur when processing pauses in order to perform a back-up. */
60 /** The SyncML Agent has shutdown. */
65 Receives a SyncML session event.
67 The following table lists the meaning of the identifier and error parameters for the various event types.
69 TEvent aIdentifier aError aAdditionalData
70 EJobStart ID of the new job. KErrNone. KUnusedAdditionalData.
71 EJobStartFailed Unused. Reason for fail. KUnusedAdditionalData.
72 EJobStop ID of the job. Completion code. KUnusedAdditionalData.
73 EJobRejected Unused. Reason for rejection. KUnusedAdditionalData.
74 EProfileCreated ID of the profile. Unused. The usage type( either ESmlDataSync or ESmlDevMan) or an error code.
75 EProfileChanged ID of the profile. Unused. The usage type( either ESmlDataSync or ESmlDevMan) or an error code.
76 EProfileDeleted ID of the profile. Unused. KUnusedAdditionalData.
77 ETransportTimeout ID of the transport. KErrTimedOut. KUnusedAdditionalData.
78 EServerSuspended Non-zero if the server KErrNone when entering. When exiting,
79 is entering suspended any error encountered when reloading data. KUnusedAdditionalData.
80 state, zero on exiting.
81 EServerTerminated Unused. KErrServerTerminated. KUnusedAdditionalData.
84 @param aEvent Event type.
85 @param aIdentifier When the event relates to an object with an ID (job or profile), the ID.
86 @param aError When the event relates to an error, the error code.
87 @param aAdditionalData The value of this parameter can be:
88 KUnusedAdditionalData if additional data are unavailable,
89 ESmlDataSync if the event is generated during a Data Sync session,
90 ESmlDevMan if the event is generated during a Device Management session
92 virtual void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError, TInt aAdditionalData) = 0;
95 ///////////////////////////////////////////////////////////////////////////////
96 ///////////////////////////////////////////////////////////////////////////////
98 ///////////////////////////////////////////////////////////////////////////////
99 // MSyncMLProgressObserver
100 ///////////////////////////////////////////////////////////////////////////////
102 Interface to receive notifications of SyncML synchronisation progress events.
104 Notifications are requested through RSyncMLSession::RequestProgressL().
108 class MSyncMLProgressObserver
111 /** SyncML synchronisation progress events. */
114 /** Connecting to a SyncML server. */
116 /** Connected to a SyncML server. */
118 /** Logging on to a SyncML server. */
120 /** Logged on to a SyncML server. */
122 /** Disconnected from a SyncML server. */
124 /** Synchronisation has completed. */
127 /** Sending modifications to a SyncML server. DS only */
128 ESmlSendingModificationsToServer,
129 /** Receiving modifications from a SyncML server. DS only */
130 ESmlReceivingModificationsFromServer,
131 /** Sending mappings to a SyncML server. DS only */
132 ESmlSendingMappingsToServer,
133 /** Processing commands from a SyncML server. DM only*/
134 ESmlProcessingServerCommands,
135 /** Receiving commands from a SyncML server. DM only*/
136 ESmlReceivingServerCommands,
138 /** Sending data to a SyncML server. */
140 /** Receiving data from a SyncML server. */
144 /** SyncML error levels. */
147 /** Warning. A non-fatal error has occurred. Synchronisation continues.*/
149 /** Fatal error. A fatal error has occurred. The synchronisation is stopped. */
154 /** Container class for number of items added, replaced, moved, deleted and failed. */
155 class TSyncMLDataSyncModifications
169 Receives notification of a synchronisation error.
171 @param aErrorLevel The error level.
172 @param aError The type of error. This is one of the SyncMLError error values.
173 @param aTaskId The ID of the task for which the error occurred.
174 @param aInfo1 An integer that can contain additional information about the error. Normally 0.
175 @param aInfo2 An integer that can contain additional information about the error. Normally 0.
177 virtual void OnSyncMLSyncError(TErrorLevel aErrorLevel, TInt aError, TInt aTaskId, TInt aInfo1, TInt aInfo2)= 0 ;
180 Receives notification of synchronisation progress.
182 @param aStatus The current status, e.g. 'Connecting'.
183 @param aInfo1 An integer that can contain additional information about the progress.
184 @param aInfo2 An integer that can contain additional information about the progress.
186 virtual void OnSyncMLSyncProgress(TStatus aStatus, TInt aInfo1, TInt aInfo2)= 0;
189 Receives notification of modifications to synchronisation tasks.
191 @param aTaskId The ID of the task.
192 @param aClientModifications Modifications made on the clients Data Store.
193 @param aServerModifications Modifications made on the server Data Store.
195 virtual void OnSyncMLDataSyncModifications(TInt aTaskId,
196 const TSyncMLDataSyncModifications& aClientModifications,
197 const TSyncMLDataSyncModifications& aServerModifications)= 0;
200 Receives notification of modifications to synchronisation tasks.
202 @param aTaskId The ID of the task.
203 @param aNumAdded Number of items added.
204 @param aNumReplaced Number of items replaced.
205 @param aNumDeleted Number of items deleted.
207 virtual void OnSyncMLDataSyncModifications(TInt aTaskId, TInt aNumAdded, TInt aNumReplaced, TInt aNumDeleted)= 0;
213 ///////////////////////////////////////////////////////////////////////////////
214 ///////////////////////////////////////////////////////////////////////////////
216 ///////////////////////////////////////////////////////////////////////////////
217 ///////////////////////////////////////////////////////////////////////////////
218 ///////////////////////////////////////////////////////////////////////////////