syncmlfw/ds/syncagent/inc/NSmlDSAgent.h
changeset 0 b497e44ab2fc
child 9 57a65a3a658c
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  DS Sync flow
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __NSMLDSAGENT_H__
       
    20 #define __NSMLDSAGENT_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <SyncMLObservers.h>
       
    25 #include "nsmldbcaps.h"
       
    26 #include "nsmldsdefines.h"
       
    27 #include "NSmlAgentBase.h"
       
    28 #include "nsmldsagconstants.h"
       
    29 
       
    30 #include "nsmlagentlog.h"
       
    31 //RD_AUTO_RESTART
       
    32 #include "nsmldsnetmon.h"
       
    33 #include <rconnmon.h>
       
    34 // FORWARD DECLARATIONS
       
    35 class MSyncMLProgressObserver;
       
    36 class CNSmlDSContent;
       
    37 //RD_AUTO_RESTART
       
    38 class CNsmlDSNetmon;
       
    39 class CNSmlDSProfile;
       
    40 
       
    41 // CLASS DECLARATION
       
    42 
       
    43 /**
       
    44 * OMA DS protocol engine.
       
    45 *
       
    46 * @lib nsmldsagent.lib
       
    47 */
       
    48 class CNSmlDSAgent : public CNSmlAgentBase
       
    49 	{
       
    50     public: // constructors and destructor
       
    51     	/**
       
    52     	* Symbian two-phased constructor.
       
    53     	* @param aObserver Observer callback through which a sync client is informed.
       
    54     	*/
       
    55     	static CNSmlDSAgent* NewL( MSyncMLProgressObserver* aObserver );
       
    56 		  	
       
    57 		/**
       
    58 		* Destructor.
       
    59 		*/
       
    60     	virtual ~CNSmlDSAgent();
       
    61 
       
    62     public: // new functions
       
    63 	    /**
       
    64 	    * Start the synchronisation process with a remote server.
       
    65 	    * @param aStatus Asynchronous call result code.
       
    66 	    * @param aProfileId ID of the used profile.
       
    67 	    * @param aConnectionId ID of the used medium.
       
    68 	    * @param aTypeArray Used to specify content specific synchronisation types.
       
    69 	    * @param aSyncInitiation Specifies whether the session is client or server initiated.
       
    70 	    * @param aSessionId Used session id.
       
    71 	    * @param aAlertPackage SyncML 1.1 server alert package.
       
    72 	    */
       
    73 		virtual void Synchronise( TRequestStatus& aStatus,
       
    74 		                      TSmlProfileId aProfileId,
       
    75 		                      TSmlConnectionId aConnectionId = -1,
       
    76 							  CArrayFix<TNSmlContentSpecificSyncType>* aTypeArray = NULL,
       
    77 							  TNSmlSyncInitiation aSyncInitiation = EClientInitiated,
       
    78 							  TInt aSessionId = 0,
       
    79 							  HBufC8* aAlertPackage = NULL );
       
    80 		//RD_AUTO_RESTART
       
    81 		/** 
       
    82 		 * Launches the Auto-restart exe if the Sync is interrupted
       
    83 		 * because of Network failures
       
    84 		 * Before launching the Netmon.exe,Profile details will be stored
       
    85 		 * into Cenrep
       
    86 		 */
       
    87 		void LaunchAutoRestartL(TInt aError);           //from CNSmlAgentBase							  
       
    88 		TBool IsSyncClientInitiated();
       
    89 		//RD_AUTO_RESTART	
       
    90     
       
    91     public: // enumerations     
       
    92     
       
    93 	//  Status when synchronisation is completed (normally or abnormally) 
       
    94 	enum TNSmlAgentSyncStatus
       
    95 		{
       
    96 		ECompletedOK = 0,
       
    97 		ECompletedWithInfo,
       
    98 		ENothingIsSent,
       
    99 		ENoServerDataUpdated,
       
   100 		EServerDataPartiallyUpdated
       
   101 		};
       
   102 	
       
   103     private: // enumerations
       
   104 		
       
   105 	//
       
   106     // DS specific state coding enumerations, common enums with DM
       
   107 	// are specified in CNSmlAgentBase
       
   108 	// 
       
   109 
       
   110 	// sub-states under begin state
       
   111 	enum TBeginSubState
       
   112 		{
       
   113 		EBeginSubStart,
       
   114 		EBeginSubReadSettings,
       
   115 		EBeginSubSyncmlCmdsInstance,
       
   116 		EBeginSubServerAlerting,
       
   117 		EBeginSubOpenContentInstances,
       
   118 // <MAPINFO_RESEND_MOD_BEGIN>
       
   119 		EBeginSubScanMapInfo,
       
   120 // <MAPINFO_RESEND_MOD_END>
       
   121 		EBeginSubCreateLUIDBuffers
       
   122 		};
       
   123 		
       
   124 	//server alerting level state coding
       
   125 	enum TServerAlertState
       
   126 		{
       
   127 		EServerAlertWaitingStartMessage,
       
   128 		EServerAlertWaitingAlerts,
       
   129 		EServerAlertMessageReceived
       
   130 		};
       
   131 
       
   132 	// server initialisation level state coding
       
   133 	enum TServerInitState
       
   134 		{
       
   135 		EServerInitWaitingStartMessage,
       
   136 		EServerInitWaitingCommands,
       
   137 		EServerInitMessageReceived,
       
   138 		EServerInitPackageReceived,
       
   139 		EServerInitEnd
       
   140 		};
       
   141 
       
   142 // <MAPINFO_RESEND_MOD_BEGIN>
       
   143 	// Client resend map info level state coding
       
   144 	enum TClientResendMapInfoState
       
   145 		{
       
   146 		EResendMapInfoStartingMessage,
       
   147 		EResendMapInfoMakingAlert,
       
   148 		EResendMapInfoMakingStatus,
       
   149 		EResendMapInfoMakingResults,
       
   150 		EResendMapInfoStartingSync,
       
   151 		EResendMapInfoEndingSync,
       
   152 		EResendMapInfoMakingMap,
       
   153 		EResendMapInfoEndingMessage
       
   154 		};
       
   155 
       
   156 
       
   157 	void ClientResendMapInfoStartingMessageStateL();
       
   158 	void ClientResendMapInfoMakingAlertStateL();
       
   159 	void ClientResendMapInfoMakingStatusStateL();
       
   160 	void ClientResendMapInfoMakingMapStateL();
       
   161 	void ClientResendMapInfoMakingResultsStateL();
       
   162 	void ClientResendMapInfoStartingSyncStateL();
       
   163 	void ClientResendMapInfoEndingSyncStateL();
       
   164 	void ClientResendMapInfoEndingMessageStateL();
       
   165 	
       
   166 // <MAPINFO_RESEND_MOD_END>
       
   167 
       
   168 	// client modifications level state coding
       
   169 	enum TClientModificationsState
       
   170 		{
       
   171 		EClientModStartingMessage,
       
   172 		EClientModMakingStatus,
       
   173 		EClientModMakingResults,
       
   174 		EClientModStartingSync,
       
   175 		EClientModMakingUpdates,
       
   176 		EClientModEndingSync,
       
   177 		EClientModEndingMessage
       
   178 		};
       
   179 		
       
   180 	// map acknowledge level state coding
       
   181 	enum TMapAcknowledgeState
       
   182 		{
       
   183 		EMapAckWaitingStartMessage,
       
   184 		EMapAckWaitingCommands,
       
   185 		EMapAckMessageReceived,
       
   186 		EMapAckPackageReceived
       
   187 		};
       
   188 
       
   189 	private: // constructors & operators
       
   190 		/**
       
   191 		* Standard C++ constructor.
       
   192 		*/
       
   193 		CNSmlDSAgent();
       
   194 		
       
   195 		/**
       
   196 		* Symbian 2nd phase constructor.
       
   197     	* @param aObserver Observer callback through which the sync client is informed.
       
   198 		*/	
       
   199     	void ConstructL( MSyncMLProgressObserver* aObserver );
       
   200     	
       
   201 		/**
       
   202 		* Prohibit copy constructor.
       
   203 		*/
       
   204 		CNSmlDSAgent( const CNSmlDSAgent& aOther );
       
   205 		
       
   206 		/**
       
   207 		* Prohibit assignment operator.
       
   208 		*/
       
   209 		CNSmlDSAgent& operator=( const CNSmlDSAgent& aOther );
       
   210 		
       
   211 	//
       
   212 	// Begin sub-state functions 
       
   213 	//
       
   214 	void BeginSubStartStateL();
       
   215 	void BeginSubReadSettingsStateL();
       
   216 	void BeginSubSyncmlCmdsInstanceStateL();
       
   217 	void BeginSubServerAlertingStateL();
       
   218 	void BeginSubOpenContentInstancesStateL();
       
   219 	void BeginSubCreateLUIDBuffersStateL();	
       
   220 	
       
   221 // <MAPINFO_RESEND_MOD_BEGIN>
       
   222 	void BeginSubScanMapInfo();
       
   223 // <MAPINFO_RESEND_MOD_END>
       
   224 	
       
   225     //
       
   226 	// Server Alerting state functions 
       
   227 	//
       
   228 	void ServerAlertStateL();
       
   229 	void ServerAlertStartMessageStateL( SmlSyncHdr_t* aSyncHdr );
       
   230 	void ServerAlertAlertCmdStateL( SmlAlert_t* aAlert );
       
   231 	void ServerAlertEndMessageStateL( TBool aFinal );
       
   232 	//
       
   233 	// Server Initiliasation state functions 
       
   234 	//
       
   235 	void ServerInitialisationStateL();
       
   236 	void ServerInitStartMessageStateL( SmlSyncHdr_t* aSyncHdr );
       
   237 	void ServerInitStatusCmdStateL( SmlStatus_t* aStatus );
       
   238 	void ServerInitResultsCmdStateL( SmlResults_t* aResults );
       
   239 	void ServerInitAlertCmdStateL( SmlAlert_t* aAlert );
       
   240 	void ServerInitPutCmdStateL( SmlPut_t* aPut );
       
   241 	void ServerInitGetCmdStateL( SmlGet_t* aGet );
       
   242 	void ServerInitEndMessageStateL( TBool aFinal );
       
   243 	//
       
   244 	// Client Modifications state functions 
       
   245 	//
       
   246 	void ClientModificationsStateL();
       
   247 	void ClientModStartingMessageStateL();
       
   248 	void ClientModMakingStatusStateL();
       
   249 	void ClientModMakingResultsStateL();	
       
   250 	void ClientModStartingSyncStateL();
       
   251 	void ClientModMakingUpdatesStateL();
       
   252 	void ClientModEndingSyncStateL();
       
   253 	void ClientModEndingMessageStateL();
       
   254 // <MAPINFO_RESEND_MOD_BEGIN>
       
   255 	void ClientResendMapInfoStateL();
       
   256 // <MAPINFO_RESEND_MOD_END>
       
   257 	
       
   258 	//
       
   259 	// Server Modifications state functions 
       
   260 	//
       
   261 	void ServerModificationsStateL();
       
   262 	void ServerModStartSyncStateL( SmlSync_t* aSync );
       
   263 	void ServerModEndSyncStateL();
       
   264 	void ServerModStartAtomicStateL( SmlAtomic_t* aContent );
       
   265 	void ServerModEndAtomicStateL();
       
   266 	//
       
   267 	// Map Acknowledgement state functions
       
   268 	//
       
   269 	void MapAcknowledgeStateL();
       
   270 	void MapAckStartMessageStateL( SmlSyncHdr_t* aSyncHdr );
       
   271 	void MapAckStatusCmdStateL( SmlStatus_t* aStatus );
       
   272 	void MapAckAlertCmdStateL( SmlAlert_t* aAlert );
       
   273 	void MapAckEndMessageStateL( TBool aFinal );
       
   274 	//
       
   275 	// Finishing state functions 
       
   276 	//
       
   277 	void FinishingStateL();                                      
       
   278 	//  Open Database related instances
       
   279 	void OpenDatabaseInstancesL( TBool& aEnd );
       
   280 	
       
   281 // <MAPINFO_RESEND_MOD_BEGIN>
       
   282 	//Scans for MapInfo and loads if exists
       
   283 	void ScanMapInfoL(TBool &aEnd);
       
   284 // <MAPINFO_RESEND_MOD_END>
       
   285 	
       
   286 	//
       
   287 	void CreateLUIDBuffersL( TBool& aEnd );
       
   288 	//  Create SyncML commands instance
       
   289 	void CreateSyncmlCmdsInstanceL();
       
   290 	//
       
   291 	// Sync Log functions
       
   292 	//
       
   293 	void InfoMessageToSyncLogL( TInt appIndex, TInt aErrorCode );
       
   294 	//  Read SyncML DS settings
       
   295 	void ReadSettingsL(); 
       
   296 	// Session ID get/update
       
   297 	TInt GetSessionIDL();                                        
       
   298 	void UpdateSessionIDL( TInt aSessionID );   
       
   299 	// Finishing 
       
   300 	void FinishL(); 
       
   301 	
       
   302 	//Launches the Netmon exe
       
   303 	void LaunchNETMONL();
       
   304 	//Saves the profile-info to cenrep
       
   305 	void SaveProfileInfoL();
       
   306 	//Stops the current ongoing session
       
   307 	void StopDSSession();
       
   308 	TBool CheckProfileIdL();
       
   309 	void TerminateAutoRestart();
       
   310 	void ReplaceIAPIdL();
       
   311 	//RD_AUTO_RESTART
       
   312 	private: // functions from base classes 
       
   313 		/**
       
   314 		* From CActive. Cancels the currently ongoing asynchronous operation.
       
   315 		*/
       
   316 		void DoCancel();
       
   317 
       
   318     	/**
       
   319     	* From MWBXMLSyncMLCallbacks.
       
   320     	* @param aContent Alert command structure.
       
   321     	* @return Parser API return code.
       
   322     	*/
       
   323 		Ret_t smlAlertCmdFuncL( SmlAlertPtr_t aContent);
       
   324 		
       
   325     	/**
       
   326     	* From MWBXMLSyncMLCallbacks.
       
   327     	* @param aContent Get command structure.
       
   328     	* @return Parser API return code.
       
   329     	*/
       
   330 		Ret_t smlGetCmdFuncL( SmlGetPtr_t aContent );
       
   331 		
       
   332     	/**
       
   333     	* From MWBXMLSyncMLCallbacks.
       
   334     	* @param aContent Put command structure.
       
   335     	* @return Parser API return code.
       
   336     	*/
       
   337 		Ret_t smlPutCmdFuncL( SmlPutPtr_t aContent );
       
   338 		
       
   339     	/**
       
   340     	* From MWBXMLSyncMLCallbacks.
       
   341     	* @param aContent Results command structure.
       
   342     	* @return Parser API return code.
       
   343     	*/
       
   344 		Ret_t smlResultsCmdFuncL( SmlResultsPtr_t aContent );
       
   345 		
       
   346     	/**
       
   347     	* From MWBXMLSyncMLCallbacks.
       
   348     	* @param aContent Status command structure.
       
   349     	* @return Parser API return code.
       
   350     	*/
       
   351 		Ret_t smlStatusCmdFuncL( SmlStatusPtr_t aContent );
       
   352 		
       
   353     	/**
       
   354     	* From MWBXMLSyncMLCallbacks.
       
   355     	* @param aContent Sync header structure.
       
   356     	* @return Parser API return code.
       
   357     	*/
       
   358 		Ret_t smlStartMessageFuncL( SmlSyncHdrPtr_t aContent );
       
   359 		
       
   360     	/**
       
   361     	* From MWBXMLSyncMLCallbacks.
       
   362     	* @param final Last part of the command (yes/no).
       
   363     	* @return Parser API return code.
       
   364     	*/
       
   365 		Ret_t smlEndMessageFuncL( Boolean_t final );
       
   366 		
       
   367     	/**
       
   368     	* From MWBXMLSyncMLCallbacks.
       
   369     	* @param aContent Sync command structure.
       
   370     	* @return Parser API return code.
       
   371     	*/
       
   372 		Ret_t smlStartSyncFuncL( SmlSyncPtr_t aContent );
       
   373 		
       
   374     	/**
       
   375     	* From MWBXMLSyncMLCallbacks.
       
   376     	* @return Parser API return code.
       
   377     	*/
       
   378 		Ret_t smlEndSyncFuncL();
       
   379 		
       
   380     	/**
       
   381     	* From MWBXMLSyncMLCallbacks.
       
   382     	* @param aContent Atomic command structure.
       
   383     	* @return Parser API return code.
       
   384     	*/
       
   385 		Ret_t smlStartAtomicFuncL( SmlAtomicPtr_t aContent );
       
   386 		
       
   387     	/**
       
   388     	* From MWBXMLSyncMLCallbacks.
       
   389     	* @return Parser API return code.
       
   390     	*/
       
   391 		Ret_t smlEndAtomicFuncL();
       
   392 		
       
   393     	/**
       
   394     	* From MWBXMLSyncMLCallbacks.
       
   395     	* @param aContent Sequence command structure.
       
   396     	* @return Parser API return code.
       
   397     	*/
       
   398 		Ret_t smlStartSequenceFuncL( SmlSequencePtr_t aContent );
       
   399 		
       
   400     	/**
       
   401     	* From MWBXMLSyncMLCallbacks.
       
   402     	* @return Parser API return code.
       
   403     	*/
       
   404 		Ret_t smlEndSequenceFuncL();
       
   405 		
       
   406     	/**
       
   407     	* From MWBXMLSyncMLCallbacks.
       
   408     	* @param aContent Move command structure.
       
   409     	* @return Parser API return code.
       
   410     	*/
       
   411 		Ret_t smlMoveCmdFuncL( SmlMovePtr_t aContent );
       
   412 	
       
   413 	//
       
   414     // Main state functions 
       
   415 	//
       
   416 		/**
       
   417 		* From CNSmlAgentBase. Calls the correct main state function depending
       
   418 		* on the current state.
       
   419 		*/
       
   420 		void NavigateMainStateL();
       
   421 		
       
   422 		/**
       
   423 		* From CNSmlAgentBase. Advances the state machine to the next main state.
       
   424 		* The next state depends on the current and (possibly) previous state.
       
   425 		*/
       
   426 		void NextMainStateL();
       
   427 		
       
   428 	void InitialiseSubStates();  //from CNSmlAgentBase
       
   429 	//
       
   430 	// Beginning state functions 
       
   431 	//
       
   432 	void BeginStateL();        //from CNSmlAgentBase
       
   433 				
       
   434 	// Client Initialisation state functions 
       
   435 	//
       
   436 	void InitStartingMessageStateL();  //from CNSmlAgentBase
       
   437 	void InitAlertingStateL();         //from CNSmlAgentBase
       
   438 	void InitDeviceInfoStateL();       //from CNSmlAgentBase  
       
   439 	void InitAskingDeviceInfoStateL(); //from CNSmlAgentBase
       
   440 	//
       
   441 	// Server Modifications state functions 
       
   442 	//
       
   443 	void ServerModUpdatesStateL( const TDesC8& aCmd, SmlGenericCmd_t* aContent ); //from CNSmlAgentBase
       
   444 	//
       
   445 	// Data Update Status state functions
       
   446 	//
       
   447 	void DataUpdateStatusStartingMessageStateL();                //from CNSmlAgentBase 
       
   448 	void DataUpdateStatusMakingMapStateL();                      //from CNSmlAgentBase
       
   449 	//
       
   450 	// Client Alert For Next states functions
       
   451 	//
       
   452 	void ClientAlertNextMakingMapStateL();                       //from CNSmlAgentBase
       
   453 	///
       
   454 	// Agent Log functions
       
   455 	//
       
   456 	HBufC* NonceL() const;                                        //from CNSmlAgentBase
       
   457 	void SetNonceL( const TDesC& aNonce ) const;                  //from CNSmlAgentBase  
       
   458 	//
       
   459 	// Sync Log functions
       
   460 	//
       
   461 	void FinalizeSyncLog();                                       //from CNSmlAgentBase
       
   462 	void FinalizeSyncLogL();
       
   463 
       
   464 	//
       
   465 	// Synchronisation Log functions
       
   466 	void WriteWarningL( TNSmlError::TNSmlAgentErrorCode aWarningCode );    //from CNSmlAgentBase
       
   467 	void WriteWarningL( TInt appIndex, TNSmlError::TNSmlAgentErrorCode aWarningCode ); //from CNSmlAgentBase
       
   468 	void WriteWarningL( TInt appIndex, TNSmlError::TNSmlSyncMLStatusCode aWarningCode ); //from CNSmlAgentBase
       
   469 		
       
   470 	void CheckServerStatusCodeL( TInt aEntryID );                //from CNSmlAgentBase
       
   471 	void CheckCommandsAreReceivedL();							 //from CNSmlAgentBase
       
   472 	//
       
   473 	// Authentication functions
       
   474 	//
       
   475 	CNSmlAgentBase::TAuthenticationType AuthTypeL() const;            //from CNSmlAgentBase 
       
   476 	void SetAuthTypeL( CNSmlAgentBase::TAuthenticationType aAuthType ) const; //from CNSmlAgentBase
       
   477 	//
       
   478 	// Free resources
       
   479 	//
       
   480 	void FreeResources(); //from CNSmlAgentBase
       
   481 	
       
   482 	//
       
   483 	// Error Handling functions
       
   484 	//
       
   485 	void Interrupt( TInt aErrorCode, TBool aImmediatelyInterruption, TBool aStatusError ); //from CNSmlAgentBase 
       
   486 	void InterruptL( TInt appIndex, TInt aErrorCode, TBool aImmediatelyInterruption, TBool aStatusError ); //from CNSmlAgentBase 
       
   487 	void FinaliseWhenErrorL();          //from CNSmlAgentBase 
       
   488 	TBool Interrupted();                //from CNSmlAgentBase  
       
   489 
       
   490 	void PrepareSyncL( CArrayFix<TNSmlContentSpecificSyncType>* aTypeArray );
       
   491 	void DoErrorEvent( MSyncMLProgressObserver::TErrorLevel aErrorLevel,
       
   492 	                   TInt aError, TInt aTaskId, TInt aInfo1, TInt aInfo2 );
       
   493 	
       
   494 	
       
   495 	//RD_SUSPEND_RESUME
       
   496 	//stores the suspendedsync status
       
   497 	TNSmlSyncSuspendedState CurrentState( );
       
   498 	TNSmlSyncSuspendedState CurrentStateInFinishing();
       
   499 	TNSmlSyncSuspendedState CurrentStateInReceiving();
       
   500 	TNSmlSyncSuspendedState CurrentStateInClientAlertNext();
       
   501 	TNSmlSyncSuspendedState CurrentStateInServerAlertNext();
       
   502 	
       
   503 	TBool SyncFailure();
       
   504 	public:
       
   505 	/**
       
   506 	* Mapping of the Alert code is done
       
   507 	*/
       
   508 	static TNSmlPreviousSyncType MapAlertCode(TDes8& aAlertCode);
       
   509 	static TPtrC8 MapAlertCode(TNSmlPreviousSyncType aAlertCode);
       
   510 	
       
   511 	/**
       
   512 	* Reads the Cenrep Key for the Suspend & Resume feature
       
   513 	* The feature will be enabled if the aKey value is set to 1
       
   514 	*/
       
   515 	
       
   516 	static void ReadRepositoryL(TInt aKey, TInt& aValue);
       
   517 	//RD_SUSPEND_RESUME
       
   518 	
       
   519 	/**
       
   520 	* Publishes and resets sync session details
       
   521 	*/	
       
   522 	void SetDSSessionInfoL(CNSmlDSProfile* aProfile);
       
   523 	void ResetDSSessionInfoL();
       
   524 	
       
   525     private: // data	
       
   526 	//
       
   527     // DS specific state codes
       
   528 	//
       
   529 	TBeginSubState iDSCurrBeginSubState; 
       
   530 	TServerInitState iDSCurrServerInitState;
       
   531 	
       
   532 // <MAPINFO_RESEND_MOD_BEGIN>
       
   533 	TClientResendMapInfoState iCurrClientResendMapInfoState;
       
   534 	TBool iMapResendStatusPackage;
       
   535 	TBool iDSMapOpeningStarted;
       
   536 // <MAPINFO_RESEND_MOD_END>
       
   537 	
       
   538 	TServerAlertState iDSCurrServerAlertState;
       
   539 	TClientModificationsState iDSCurrClientModState;
       
   540 	TMapAcknowledgeState iDSCurrMapAcknowledgeState;
       
   541 	// Sync Type (given for all contents);
       
   542 	CArrayFix<TNSmlContentSpecificSyncType>* iDSSyncTypeArray;
       
   543 	// Client's current Sync Anchor 
       
   544 	TTime iDSClientNextSyncAnchor;
       
   545 	TBool iDSDeviceInfoRequestByClient;
       
   546 	TBool iDSDeviceInfoRequestedByServer;
       
   547 	// switch for Map Acknowledgement
       
   548 	TBool iDSWaitingForMapAcknowledgement;
       
   549 	// 
       
   550 	TBool iDSDatabaseOpeningStarted;
       
   551 	//
       
   552 	TBool iDSLUIDBufferingStarted;
       
   553 	HBufC* iDSServerId;
       
   554 
       
   555 	// DS protocol version
       
   556 	TSmlProtocolVersion iProtocolVer;
       
   557 
       
   558 	// progress observer
       
   559 	MSyncMLProgressObserver* iDSObserver;
       
   560 	
       
   561 	
       
   562 	// session id
       
   563 	TInt iSessionId;
       
   564 	// 1.1 server alert package
       
   565 	HBufC8* iServerAlertPackage;
       
   566 	
       
   567 	//
       
   568 	// Owned classes
       
   569 	//
       
   570 	CNSmlDSContent* iDSContent;
       
   571 	TBool iErrorNotified;
       
   572      //RD_AUTO_RESTART
       
   573 	CNsmlDSNetmon *iDSNetmon;
       
   574 	TBool iAutoRestartInitiatedSync;
       
   575 	//RD_SUSPEND_RESUME
       
   576 	TBool iUpdateLastAnchor;
       
   577 	};
       
   578 	
       
   579 typedef CNSmlDSAgent* (*TNSmlCreateDSAgentFunc) ( MSyncMLProgressObserver* aObserver );
       
   580 
       
   581 /**
       
   582 * Creates new instance of the CNSmlDSAgent class.
       
   583 * @param aObserver Progress callback observer.
       
   584 * @return The newly created instance.
       
   585 */
       
   586 IMPORT_C CNSmlDSAgent* CreateDSAgentL( MSyncMLProgressObserver* aObserver );
       
   587 	
       
   588 #endif // __NSMLDSAGENT_H__
       
   589             
       
   590 // End of File