williamr@2: /* williamr@2: * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Interface to receive notifications of SyncML session and synchronization progress events. williamr@2: * williamr@2: */ williamr@2: williamr@2: #ifndef __SYNCMLOBSERVERS_H__ williamr@2: #define __SYNCMLOBSERVERS_H__ williamr@2: #define SYNCML_V3 williamr@2: // williamr@2: #include williamr@2: // williamr@2: williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: // MSyncMLEventObserver williamr@2: // Observer of session events. williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: class MSyncMLEventObserver williamr@2: /** williamr@2: Interface to receive notifications of SyncML session events. williamr@2: williamr@2: Notifications are requested through RSyncMLSession::RequestEventL(). williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: { williamr@2: public: williamr@2: enum TEvent williamr@2: /** SyncML session event types. */ williamr@2: { williamr@2: /** Job has started. */ williamr@2: EJobStart, williamr@2: /** Job has failed to start. */ williamr@2: EJobStartFailed, williamr@2: /** Job has stopped. */ williamr@2: EJobStop, williamr@2: /** Job could not be parsed, and will not be processed. */ williamr@2: EJobRejected, williamr@2: /** A profile has been created. */ williamr@2: EProfileCreated, williamr@2: /** A profile has been changed. */ williamr@2: EProfileChanged, williamr@2: /** A profile has been deleted. */ williamr@2: EProfileDeleted, williamr@2: /** A transport has timed-out. */ williamr@2: ETransportTimeout, williamr@2: /** The SyncML Agent is suspended. This can occur when processing pauses in order to perform a back-up. */ williamr@2: EServerSuspended, williamr@2: /** The SyncML Agent has shutdown. */ williamr@2: EServerTerminated williamr@2: }; williamr@2: public: williamr@2: /** williamr@2: Receives a SyncML session event. williamr@2: williamr@2: The following table lists the meaning of the identifier and error parameters for the various event types. williamr@2: @code williamr@2: TEvent aIdentifier aError aAdditionalData williamr@2: EJobStart ID of the new job. KErrNone. KUnusedAdditionalData. williamr@2: EJobStartFailed Unused. Reason for fail. KUnusedAdditionalData. williamr@2: EJobStop ID of the job. Completion code. KUnusedAdditionalData. williamr@2: EJobRejected Unused. Reason for rejection. KUnusedAdditionalData. williamr@2: EProfileCreated ID of the profile. Unused. The usage type( either ESmlDataSync or ESmlDevMan) or an error code. williamr@2: EProfileChanged ID of the profile. Unused. The usage type( either ESmlDataSync or ESmlDevMan) or an error code. williamr@2: EProfileDeleted ID of the profile. Unused. KUnusedAdditionalData. williamr@2: ETransportTimeout ID of the transport. KErrTimedOut. KUnusedAdditionalData. williamr@2: EServerSuspended Non-zero if the server KErrNone when entering. When exiting, williamr@2: is entering suspended any error encountered when reloading data. KUnusedAdditionalData. williamr@2: state, zero on exiting. williamr@2: EServerTerminated Unused. KErrServerTerminated. KUnusedAdditionalData. williamr@2: @endcode williamr@2: williamr@2: @param aEvent Event type. williamr@2: @param aIdentifier When the event relates to an object with an ID (job or profile), the ID. williamr@2: @param aError When the event relates to an error, the error code. williamr@2: @param aAdditionalData The value of this parameter can be: williamr@2: KUnusedAdditionalData if additional data are unavailable, williamr@2: ESmlDataSync if the event is generated during a Data Sync session, williamr@2: ESmlDevMan if the event is generated during a Device Management session williamr@2: */ williamr@2: virtual void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError, TInt aAdditionalData) = 0; williamr@2: }; williamr@2: williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: // MSyncMLProgressObserver williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: /** williamr@2: Interface to receive notifications of SyncML synchronisation progress events. williamr@2: williamr@2: Notifications are requested through RSyncMLSession::RequestProgressL(). williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class MSyncMLProgressObserver williamr@2: { williamr@2: public: williamr@2: /** SyncML synchronisation progress events. */ williamr@2: enum TStatus williamr@2: { williamr@2: /** Connecting to a SyncML server. */ williamr@2: ESmlConnecting, williamr@2: /** Connected to a SyncML server. */ williamr@2: ESmlConnected, williamr@2: /** Logging on to a SyncML server. */ williamr@2: ESmlLoggingOn, williamr@2: /** Logged on to a SyncML server. */ williamr@2: ESmlLoggedOn, williamr@2: /** Disconnected from a SyncML server. */ williamr@2: ESmlDisconnected, williamr@2: /** Synchronisation has completed. */ williamr@2: ESmlCompleted, williamr@2: #ifdef SYNCML_V3 williamr@2: /** Sending modifications to a SyncML server. DS only */ williamr@2: ESmlSendingModificationsToServer, williamr@2: /** Receiving modifications from a SyncML server. DS only */ williamr@2: ESmlReceivingModificationsFromServer, williamr@2: /** Sending mappings to a SyncML server. DS only */ williamr@2: ESmlSendingMappingsToServer, williamr@2: /** Processing commands from a SyncML server. DM only*/ williamr@2: ESmlProcessingServerCommands, williamr@2: /** Receiving commands from a SyncML server. DM only*/ williamr@2: ESmlReceivingServerCommands, williamr@2: #else // SYNCML_V3 williamr@2: /** Sending data to a SyncML server. */ williamr@2: ESmlSendingData, williamr@2: /** Receiving data from a SyncML server. */ williamr@2: ESmlReceivingData williamr@2: #endif // SYNCML_V3 williamr@2: }; williamr@2: /** SyncML error levels. */ williamr@2: enum TErrorLevel williamr@2: { williamr@2: /** Warning. A non-fatal error has occurred. Synchronisation continues.*/ williamr@2: ESmlWarning, williamr@2: /** Fatal error. A fatal error has occurred. The synchronisation is stopped. */ williamr@2: ESmlFatalError williamr@2: }; williamr@2: williamr@2: #ifdef SYNCML_V3 williamr@2: /** Container class for number of items added, replaced, moved, deleted and failed. */ williamr@2: class TSyncMLDataSyncModifications williamr@2: { williamr@2: public: williamr@2: TInt iNumAdded; williamr@2: TInt iNumReplaced; williamr@2: TInt iNumMoved; williamr@2: TInt iNumDeleted; williamr@2: TInt iNumFailed; williamr@2: }; williamr@2: #endif // SYNCML_V3 williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: Receives notification of a synchronisation error. williamr@2: williamr@2: @param aErrorLevel The error level. williamr@2: @param aError The type of error. This is one of the SyncMLError error values. williamr@2: @param aTaskId The ID of the task for which the error occurred. williamr@2: @param aInfo1 An integer that can contain additional information about the error. Normally 0. williamr@2: @param aInfo2 An integer that can contain additional information about the error. Normally 0. williamr@2: */ williamr@2: virtual void OnSyncMLSyncError(TErrorLevel aErrorLevel, TInt aError, TInt aTaskId, TInt aInfo1, TInt aInfo2)= 0 ; williamr@2: williamr@2: /** williamr@2: Receives notification of synchronisation progress. williamr@2: williamr@2: @param aStatus The current status, e.g. 'Connecting'. williamr@2: @param aInfo1 An integer that can contain additional information about the progress. williamr@2: @param aInfo2 An integer that can contain additional information about the progress. williamr@2: */ williamr@2: virtual void OnSyncMLSyncProgress(TStatus aStatus, TInt aInfo1, TInt aInfo2)= 0; williamr@2: #ifdef SYNCML_V3 williamr@2: /** williamr@2: Receives notification of modifications to synchronisation tasks. williamr@2: williamr@2: @param aTaskId The ID of the task. williamr@2: @param aClientModifications Modifications made on the clients Data Store. williamr@2: @param aServerModifications Modifications made on the server Data Store. williamr@2: */ williamr@2: virtual void OnSyncMLDataSyncModifications(TInt aTaskId, williamr@2: const TSyncMLDataSyncModifications& aClientModifications, williamr@2: const TSyncMLDataSyncModifications& aServerModifications)= 0; williamr@2: #else // SYNCML_V3 williamr@2: /** williamr@2: Receives notification of modifications to synchronisation tasks. williamr@2: williamr@2: @param aTaskId The ID of the task. williamr@2: @param aNumAdded Number of items added. williamr@2: @param aNumReplaced Number of items replaced. williamr@2: @param aNumDeleted Number of items deleted. williamr@2: */ williamr@2: virtual void OnSyncMLDataSyncModifications(TInt aTaskId, TInt aNumAdded, TInt aNumReplaced, TInt aNumDeleted)= 0; williamr@2: #endif // SYNCML_V3 williamr@2: williamr@2: }; williamr@2: williamr@2: williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: /////////////////////////////////////////////////////////////////////////////// williamr@2: #endif