1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/SyncMLObservers.h Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -0,0 +1,219 @@
1.4 +/*
1.5 +* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* 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
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: Interface to receive notifications of SyncML session and synchronization progress events.
1.18 +*
1.19 +*/
1.20 +
1.21 +#ifndef __SYNCMLOBSERVERS_H__
1.22 +#define __SYNCMLOBSERVERS_H__
1.23 +#define SYNCML_V3
1.24 +//
1.25 +#include <e32std.h>
1.26 +//
1.27 +
1.28 +///////////////////////////////////////////////////////////////////////////////
1.29 +// MSyncMLEventObserver
1.30 +// Observer of session events.
1.31 +///////////////////////////////////////////////////////////////////////////////
1.32 +class MSyncMLEventObserver
1.33 +/**
1.34 + Interface to receive notifications of SyncML session events.
1.35 +
1.36 + Notifications are requested through RSyncMLSession::RequestEventL().
1.37 + @publishedAll
1.38 + @released
1.39 +*/
1.40 + {
1.41 +public:
1.42 + enum TEvent
1.43 + /** SyncML session event types. */
1.44 + {
1.45 + /** Job has started. */
1.46 + EJobStart,
1.47 + /** Job has failed to start. */
1.48 + EJobStartFailed,
1.49 + /** Job has stopped. */
1.50 + EJobStop,
1.51 + /** Job could not be parsed, and will not be processed. */
1.52 + EJobRejected,
1.53 + /** A profile has been created. */
1.54 + EProfileCreated,
1.55 + /** A profile has been changed. */
1.56 + EProfileChanged,
1.57 + /** A profile has been deleted. */
1.58 + EProfileDeleted,
1.59 + /** A transport has timed-out. */
1.60 + ETransportTimeout,
1.61 + /** The SyncML Agent is suspended. This can occur when processing pauses in order to perform a back-up. */
1.62 + EServerSuspended,
1.63 + /** The SyncML Agent has shutdown. */
1.64 + EServerTerminated
1.65 + };
1.66 +public:
1.67 +/**
1.68 +Receives a SyncML session event.
1.69 +
1.70 +The following table lists the meaning of the identifier and error parameters for the various event types.
1.71 +@code
1.72 +TEvent aIdentifier aError aAdditionalData
1.73 +EJobStart ID of the new job. KErrNone. KUnusedAdditionalData.
1.74 +EJobStartFailed Unused. Reason for fail. KUnusedAdditionalData.
1.75 +EJobStop ID of the job. Completion code. KUnusedAdditionalData.
1.76 +EJobRejected Unused. Reason for rejection. KUnusedAdditionalData.
1.77 +EProfileCreated ID of the profile. Unused. The usage type( either ESmlDataSync or ESmlDevMan) or an error code.
1.78 +EProfileChanged ID of the profile. Unused. The usage type( either ESmlDataSync or ESmlDevMan) or an error code.
1.79 +EProfileDeleted ID of the profile. Unused. KUnusedAdditionalData.
1.80 +ETransportTimeout ID of the transport. KErrTimedOut. KUnusedAdditionalData.
1.81 +EServerSuspended Non-zero if the server KErrNone when entering. When exiting,
1.82 + is entering suspended any error encountered when reloading data. KUnusedAdditionalData.
1.83 + state, zero on exiting.
1.84 +EServerTerminated Unused. KErrServerTerminated. KUnusedAdditionalData.
1.85 +@endcode
1.86 +
1.87 +@param aEvent Event type.
1.88 +@param aIdentifier When the event relates to an object with an ID (job or profile), the ID.
1.89 +@param aError When the event relates to an error, the error code.
1.90 +@param aAdditionalData The value of this parameter can be:
1.91 + KUnusedAdditionalData if additional data are unavailable,
1.92 + ESmlDataSync if the event is generated during a Data Sync session,
1.93 + ESmlDevMan if the event is generated during a Device Management session
1.94 +*/
1.95 + virtual void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError, TInt aAdditionalData) = 0;
1.96 + };
1.97 +
1.98 +///////////////////////////////////////////////////////////////////////////////
1.99 +///////////////////////////////////////////////////////////////////////////////
1.100 +
1.101 +///////////////////////////////////////////////////////////////////////////////
1.102 +// MSyncMLProgressObserver
1.103 +///////////////////////////////////////////////////////////////////////////////
1.104 +/**
1.105 + Interface to receive notifications of SyncML synchronisation progress events.
1.106 +
1.107 + Notifications are requested through RSyncMLSession::RequestProgressL().
1.108 + @publishedAll
1.109 + @released
1.110 +*/
1.111 +class MSyncMLProgressObserver
1.112 + {
1.113 +public:
1.114 + /** SyncML synchronisation progress events. */
1.115 + enum TStatus
1.116 + {
1.117 + /** Connecting to a SyncML server. */
1.118 + ESmlConnecting,
1.119 + /** Connected to a SyncML server. */
1.120 + ESmlConnected,
1.121 + /** Logging on to a SyncML server. */
1.122 + ESmlLoggingOn,
1.123 + /** Logged on to a SyncML server. */
1.124 + ESmlLoggedOn,
1.125 + /** Disconnected from a SyncML server. */
1.126 + ESmlDisconnected,
1.127 + /** Synchronisation has completed. */
1.128 + ESmlCompleted,
1.129 +#ifdef SYNCML_V3
1.130 + /** Sending modifications to a SyncML server. DS only */
1.131 + ESmlSendingModificationsToServer,
1.132 + /** Receiving modifications from a SyncML server. DS only */
1.133 + ESmlReceivingModificationsFromServer,
1.134 + /** Sending mappings to a SyncML server. DS only */
1.135 + ESmlSendingMappingsToServer,
1.136 + /** Processing commands from a SyncML server. DM only*/
1.137 + ESmlProcessingServerCommands,
1.138 + /** Receiving commands from a SyncML server. DM only*/
1.139 + ESmlReceivingServerCommands,
1.140 +#else // SYNCML_V3
1.141 + /** Sending data to a SyncML server. */
1.142 + ESmlSendingData,
1.143 + /** Receiving data from a SyncML server. */
1.144 + ESmlReceivingData
1.145 +#endif // SYNCML_V3
1.146 + };
1.147 + /** SyncML error levels. */
1.148 + enum TErrorLevel
1.149 + {
1.150 + /** Warning. A non-fatal error has occurred. Synchronisation continues.*/
1.151 + ESmlWarning,
1.152 + /** Fatal error. A fatal error has occurred. The synchronisation is stopped. */
1.153 + ESmlFatalError
1.154 + };
1.155 +
1.156 +#ifdef SYNCML_V3
1.157 + /** Container class for number of items added, replaced, moved, deleted and failed. */
1.158 + class TSyncMLDataSyncModifications
1.159 + {
1.160 + public:
1.161 + TInt iNumAdded;
1.162 + TInt iNumReplaced;
1.163 + TInt iNumMoved;
1.164 + TInt iNumDeleted;
1.165 + TInt iNumFailed;
1.166 + };
1.167 +#endif // SYNCML_V3
1.168 +
1.169 +public:
1.170 +
1.171 + /**
1.172 + Receives notification of a synchronisation error.
1.173 +
1.174 + @param aErrorLevel The error level.
1.175 + @param aError The type of error. This is one of the SyncMLError error values.
1.176 + @param aTaskId The ID of the task for which the error occurred.
1.177 + @param aInfo1 An integer that can contain additional information about the error. Normally 0.
1.178 + @param aInfo2 An integer that can contain additional information about the error. Normally 0.
1.179 + */
1.180 + virtual void OnSyncMLSyncError(TErrorLevel aErrorLevel, TInt aError, TInt aTaskId, TInt aInfo1, TInt aInfo2)= 0 ;
1.181 +
1.182 + /**
1.183 + Receives notification of synchronisation progress.
1.184 +
1.185 + @param aStatus The current status, e.g. 'Connecting'.
1.186 + @param aInfo1 An integer that can contain additional information about the progress.
1.187 + @param aInfo2 An integer that can contain additional information about the progress.
1.188 + */
1.189 + virtual void OnSyncMLSyncProgress(TStatus aStatus, TInt aInfo1, TInt aInfo2)= 0;
1.190 +#ifdef SYNCML_V3
1.191 + /**
1.192 + Receives notification of modifications to synchronisation tasks.
1.193 +
1.194 + @param aTaskId The ID of the task.
1.195 + @param aClientModifications Modifications made on the clients Data Store.
1.196 + @param aServerModifications Modifications made on the server Data Store.
1.197 + */
1.198 + virtual void OnSyncMLDataSyncModifications(TInt aTaskId,
1.199 + const TSyncMLDataSyncModifications& aClientModifications,
1.200 + const TSyncMLDataSyncModifications& aServerModifications)= 0;
1.201 +#else // SYNCML_V3
1.202 + /**
1.203 + Receives notification of modifications to synchronisation tasks.
1.204 +
1.205 + @param aTaskId The ID of the task.
1.206 + @param aNumAdded Number of items added.
1.207 + @param aNumReplaced Number of items replaced.
1.208 + @param aNumDeleted Number of items deleted.
1.209 + */
1.210 + virtual void OnSyncMLDataSyncModifications(TInt aTaskId, TInt aNumAdded, TInt aNumReplaced, TInt aNumDeleted)= 0;
1.211 +#endif // SYNCML_V3
1.212 +
1.213 + };
1.214 +
1.215 +
1.216 +///////////////////////////////////////////////////////////////////////////////
1.217 +///////////////////////////////////////////////////////////////////////////////
1.218 +
1.219 +///////////////////////////////////////////////////////////////////////////////
1.220 +///////////////////////////////////////////////////////////////////////////////
1.221 +///////////////////////////////////////////////////////////////////////////////
1.222 +#endif