williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description: Interface to receive notifications of SyncML session and synchronization progress events.
|
williamr@2
|
15 |
*
|
williamr@2
|
16 |
*/
|
williamr@2
|
17 |
|
williamr@2
|
18 |
#ifndef __SYNCMLOBSERVERS_H__
|
williamr@2
|
19 |
#define __SYNCMLOBSERVERS_H__
|
williamr@2
|
20 |
#define SYNCML_V3
|
williamr@2
|
21 |
//
|
williamr@2
|
22 |
#include <e32std.h>
|
williamr@2
|
23 |
//
|
williamr@2
|
24 |
|
williamr@2
|
25 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
26 |
// MSyncMLEventObserver
|
williamr@2
|
27 |
// Observer of session events.
|
williamr@2
|
28 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
29 |
class MSyncMLEventObserver
|
williamr@2
|
30 |
/**
|
williamr@2
|
31 |
Interface to receive notifications of SyncML session events.
|
williamr@2
|
32 |
|
williamr@2
|
33 |
Notifications are requested through RSyncMLSession::RequestEventL().
|
williamr@2
|
34 |
@publishedAll
|
williamr@2
|
35 |
@released
|
williamr@2
|
36 |
*/
|
williamr@2
|
37 |
{
|
williamr@2
|
38 |
public:
|
williamr@2
|
39 |
enum TEvent
|
williamr@2
|
40 |
/** SyncML session event types. */
|
williamr@2
|
41 |
{
|
williamr@2
|
42 |
/** Job has started. */
|
williamr@2
|
43 |
EJobStart,
|
williamr@2
|
44 |
/** Job has failed to start. */
|
williamr@2
|
45 |
EJobStartFailed,
|
williamr@2
|
46 |
/** Job has stopped. */
|
williamr@2
|
47 |
EJobStop,
|
williamr@2
|
48 |
/** Job could not be parsed, and will not be processed. */
|
williamr@2
|
49 |
EJobRejected,
|
williamr@2
|
50 |
/** A profile has been created. */
|
williamr@2
|
51 |
EProfileCreated,
|
williamr@2
|
52 |
/** A profile has been changed. */
|
williamr@2
|
53 |
EProfileChanged,
|
williamr@2
|
54 |
/** A profile has been deleted. */
|
williamr@2
|
55 |
EProfileDeleted,
|
williamr@2
|
56 |
/** A transport has timed-out. */
|
williamr@2
|
57 |
ETransportTimeout,
|
williamr@2
|
58 |
/** The SyncML Agent is suspended. This can occur when processing pauses in order to perform a back-up. */
|
williamr@2
|
59 |
EServerSuspended,
|
williamr@2
|
60 |
/** The SyncML Agent has shutdown. */
|
williamr@2
|
61 |
EServerTerminated
|
williamr@2
|
62 |
};
|
williamr@2
|
63 |
public:
|
williamr@2
|
64 |
/**
|
williamr@2
|
65 |
Receives a SyncML session event.
|
williamr@2
|
66 |
|
williamr@2
|
67 |
The following table lists the meaning of the identifier and error parameters for the various event types.
|
williamr@2
|
68 |
@code
|
williamr@2
|
69 |
TEvent aIdentifier aError aAdditionalData
|
williamr@2
|
70 |
EJobStart ID of the new job. KErrNone. KUnusedAdditionalData.
|
williamr@2
|
71 |
EJobStartFailed Unused. Reason for fail. KUnusedAdditionalData.
|
williamr@2
|
72 |
EJobStop ID of the job. Completion code. KUnusedAdditionalData.
|
williamr@2
|
73 |
EJobRejected Unused. Reason for rejection. KUnusedAdditionalData.
|
williamr@2
|
74 |
EProfileCreated ID of the profile. Unused. The usage type( either ESmlDataSync or ESmlDevMan) or an error code.
|
williamr@2
|
75 |
EProfileChanged ID of the profile. Unused. The usage type( either ESmlDataSync or ESmlDevMan) or an error code.
|
williamr@2
|
76 |
EProfileDeleted ID of the profile. Unused. KUnusedAdditionalData.
|
williamr@2
|
77 |
ETransportTimeout ID of the transport. KErrTimedOut. KUnusedAdditionalData.
|
williamr@2
|
78 |
EServerSuspended Non-zero if the server KErrNone when entering. When exiting,
|
williamr@2
|
79 |
is entering suspended any error encountered when reloading data. KUnusedAdditionalData.
|
williamr@2
|
80 |
state, zero on exiting.
|
williamr@2
|
81 |
EServerTerminated Unused. KErrServerTerminated. KUnusedAdditionalData.
|
williamr@2
|
82 |
@endcode
|
williamr@2
|
83 |
|
williamr@2
|
84 |
@param aEvent Event type.
|
williamr@2
|
85 |
@param aIdentifier When the event relates to an object with an ID (job or profile), the ID.
|
williamr@2
|
86 |
@param aError When the event relates to an error, the error code.
|
williamr@2
|
87 |
@param aAdditionalData The value of this parameter can be:
|
williamr@2
|
88 |
KUnusedAdditionalData if additional data are unavailable,
|
williamr@2
|
89 |
ESmlDataSync if the event is generated during a Data Sync session,
|
williamr@2
|
90 |
ESmlDevMan if the event is generated during a Device Management session
|
williamr@2
|
91 |
*/
|
williamr@2
|
92 |
virtual void OnSyncMLSessionEvent(TEvent aEvent, TInt aIdentifier, TInt aError, TInt aAdditionalData) = 0;
|
williamr@2
|
93 |
};
|
williamr@2
|
94 |
|
williamr@2
|
95 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
96 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
97 |
|
williamr@2
|
98 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
99 |
// MSyncMLProgressObserver
|
williamr@2
|
100 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
Interface to receive notifications of SyncML synchronisation progress events.
|
williamr@2
|
103 |
|
williamr@2
|
104 |
Notifications are requested through RSyncMLSession::RequestProgressL().
|
williamr@2
|
105 |
@publishedAll
|
williamr@2
|
106 |
@released
|
williamr@2
|
107 |
*/
|
williamr@2
|
108 |
class MSyncMLProgressObserver
|
williamr@2
|
109 |
{
|
williamr@2
|
110 |
public:
|
williamr@2
|
111 |
/** SyncML synchronisation progress events. */
|
williamr@2
|
112 |
enum TStatus
|
williamr@2
|
113 |
{
|
williamr@2
|
114 |
/** Connecting to a SyncML server. */
|
williamr@2
|
115 |
ESmlConnecting,
|
williamr@2
|
116 |
/** Connected to a SyncML server. */
|
williamr@2
|
117 |
ESmlConnected,
|
williamr@2
|
118 |
/** Logging on to a SyncML server. */
|
williamr@2
|
119 |
ESmlLoggingOn,
|
williamr@2
|
120 |
/** Logged on to a SyncML server. */
|
williamr@2
|
121 |
ESmlLoggedOn,
|
williamr@2
|
122 |
/** Disconnected from a SyncML server. */
|
williamr@2
|
123 |
ESmlDisconnected,
|
williamr@2
|
124 |
/** Synchronisation has completed. */
|
williamr@2
|
125 |
ESmlCompleted,
|
williamr@2
|
126 |
#ifdef SYNCML_V3
|
williamr@2
|
127 |
/** Sending modifications to a SyncML server. DS only */
|
williamr@2
|
128 |
ESmlSendingModificationsToServer,
|
williamr@2
|
129 |
/** Receiving modifications from a SyncML server. DS only */
|
williamr@2
|
130 |
ESmlReceivingModificationsFromServer,
|
williamr@2
|
131 |
/** Sending mappings to a SyncML server. DS only */
|
williamr@2
|
132 |
ESmlSendingMappingsToServer,
|
williamr@2
|
133 |
/** Processing commands from a SyncML server. DM only*/
|
williamr@2
|
134 |
ESmlProcessingServerCommands,
|
williamr@2
|
135 |
/** Receiving commands from a SyncML server. DM only*/
|
williamr@2
|
136 |
ESmlReceivingServerCommands,
|
williamr@2
|
137 |
#else // SYNCML_V3
|
williamr@2
|
138 |
/** Sending data to a SyncML server. */
|
williamr@2
|
139 |
ESmlSendingData,
|
williamr@2
|
140 |
/** Receiving data from a SyncML server. */
|
williamr@2
|
141 |
ESmlReceivingData
|
williamr@2
|
142 |
#endif // SYNCML_V3
|
williamr@2
|
143 |
};
|
williamr@2
|
144 |
/** SyncML error levels. */
|
williamr@2
|
145 |
enum TErrorLevel
|
williamr@2
|
146 |
{
|
williamr@2
|
147 |
/** Warning. A non-fatal error has occurred. Synchronisation continues.*/
|
williamr@2
|
148 |
ESmlWarning,
|
williamr@2
|
149 |
/** Fatal error. A fatal error has occurred. The synchronisation is stopped. */
|
williamr@2
|
150 |
ESmlFatalError
|
williamr@2
|
151 |
};
|
williamr@2
|
152 |
|
williamr@2
|
153 |
#ifdef SYNCML_V3
|
williamr@2
|
154 |
/** Container class for number of items added, replaced, moved, deleted and failed. */
|
williamr@2
|
155 |
class TSyncMLDataSyncModifications
|
williamr@2
|
156 |
{
|
williamr@2
|
157 |
public:
|
williamr@2
|
158 |
TInt iNumAdded;
|
williamr@2
|
159 |
TInt iNumReplaced;
|
williamr@2
|
160 |
TInt iNumMoved;
|
williamr@2
|
161 |
TInt iNumDeleted;
|
williamr@2
|
162 |
TInt iNumFailed;
|
williamr@2
|
163 |
};
|
williamr@2
|
164 |
#endif // SYNCML_V3
|
williamr@2
|
165 |
|
williamr@2
|
166 |
public:
|
williamr@2
|
167 |
|
williamr@2
|
168 |
/**
|
williamr@2
|
169 |
Receives notification of a synchronisation error.
|
williamr@2
|
170 |
|
williamr@2
|
171 |
@param aErrorLevel The error level.
|
williamr@2
|
172 |
@param aError The type of error. This is one of the SyncMLError error values.
|
williamr@2
|
173 |
@param aTaskId The ID of the task for which the error occurred.
|
williamr@2
|
174 |
@param aInfo1 An integer that can contain additional information about the error. Normally 0.
|
williamr@2
|
175 |
@param aInfo2 An integer that can contain additional information about the error. Normally 0.
|
williamr@2
|
176 |
*/
|
williamr@2
|
177 |
virtual void OnSyncMLSyncError(TErrorLevel aErrorLevel, TInt aError, TInt aTaskId, TInt aInfo1, TInt aInfo2)= 0 ;
|
williamr@2
|
178 |
|
williamr@2
|
179 |
/**
|
williamr@2
|
180 |
Receives notification of synchronisation progress.
|
williamr@2
|
181 |
|
williamr@2
|
182 |
@param aStatus The current status, e.g. 'Connecting'.
|
williamr@2
|
183 |
@param aInfo1 An integer that can contain additional information about the progress.
|
williamr@2
|
184 |
@param aInfo2 An integer that can contain additional information about the progress.
|
williamr@2
|
185 |
*/
|
williamr@2
|
186 |
virtual void OnSyncMLSyncProgress(TStatus aStatus, TInt aInfo1, TInt aInfo2)= 0;
|
williamr@2
|
187 |
#ifdef SYNCML_V3
|
williamr@2
|
188 |
/**
|
williamr@2
|
189 |
Receives notification of modifications to synchronisation tasks.
|
williamr@2
|
190 |
|
williamr@2
|
191 |
@param aTaskId The ID of the task.
|
williamr@2
|
192 |
@param aClientModifications Modifications made on the clients Data Store.
|
williamr@2
|
193 |
@param aServerModifications Modifications made on the server Data Store.
|
williamr@2
|
194 |
*/
|
williamr@2
|
195 |
virtual void OnSyncMLDataSyncModifications(TInt aTaskId,
|
williamr@2
|
196 |
const TSyncMLDataSyncModifications& aClientModifications,
|
williamr@2
|
197 |
const TSyncMLDataSyncModifications& aServerModifications)= 0;
|
williamr@2
|
198 |
#else // SYNCML_V3
|
williamr@2
|
199 |
/**
|
williamr@2
|
200 |
Receives notification of modifications to synchronisation tasks.
|
williamr@2
|
201 |
|
williamr@2
|
202 |
@param aTaskId The ID of the task.
|
williamr@2
|
203 |
@param aNumAdded Number of items added.
|
williamr@2
|
204 |
@param aNumReplaced Number of items replaced.
|
williamr@2
|
205 |
@param aNumDeleted Number of items deleted.
|
williamr@2
|
206 |
*/
|
williamr@2
|
207 |
virtual void OnSyncMLDataSyncModifications(TInt aTaskId, TInt aNumAdded, TInt aNumReplaced, TInt aNumDeleted)= 0;
|
williamr@2
|
208 |
#endif // SYNCML_V3
|
williamr@2
|
209 |
|
williamr@2
|
210 |
};
|
williamr@2
|
211 |
|
williamr@2
|
212 |
|
williamr@2
|
213 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
214 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
215 |
|
williamr@2
|
216 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
217 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
218 |
///////////////////////////////////////////////////////////////////////////////
|
williamr@2
|
219 |
#endif
|