iaupdate/IAD/firmwareupdate/inc/iaupdatefwsyncappengine.h
changeset 77 d1838696558c
parent 0 ba25891c3a9e
equal deleted inserted replaced
75:2d2d25361590 77:d1838696558c
     1 /*
     1 /*
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    29 
    29 
    30 // FORWARD DECLARATIONS
    30 // FORWARD DECLARATIONS
    31 class CIAUpdateFWSyncHandler;
    31 class CIAUpdateFWSyncHandler;
    32 class CIAUpdateFWSyncProfile;
    32 class CIAUpdateFWSyncProfile;
    33 class CIAUpdateFWFotaModel;
    33 class CIAUpdateFWFotaModel;
       
    34 class MIAUpdateFWUpdateObserver;
    34 
    35 
    35 
    36 
    36 // CLASS DECLARATION
    37 // CLASS DECLARATION
    37 /**
    38 /**
    38 * CIAUpdateFWSyncAppEngine
    39 * CIAUpdateFWSyncAppEngine
    39 * Sync engine for handling synchronization and profiles.
    40 * Sync engine for handling synchronization and profiles.
    40 */
    41 */
    41 class CIAUpdateFWSyncAppEngine : public CBase
    42 NONSHARABLE_CLASS (CIAUpdateFWSyncAppEngine) : public CBase
    42     {
    43     {
    43     public:  // Constructors and destructor
    44     public:  // Constructors and destructor
    44         
    45         
    45         /**
    46         /**
    46         * Two-phased constructor.
    47         * Two-phased constructor.
    52         */
    53         */
    53         virtual ~CIAUpdateFWSyncAppEngine();
    54         virtual ~CIAUpdateFWSyncAppEngine();
    54 
    55 
    55     public: // New functions
    56     public: // New functions
    56         
    57         
    57         /**
    58         void SetObserver( MIAUpdateFWUpdateObserver* aObserver );
    58         * Delete profile
    59  
    59         * @param aProfileId Profile to be deleted.
       
    60         * @return None
       
    61         */
       
    62         void DeleteProfileL( TInt aProfileId );
       
    63 
       
    64         /**
       
    65         * Create profile
       
    66         * @param None.
       
    67         * @return None
       
    68         */
       
    69         TInt CreateProfileL();
       
    70 
       
    71         /**
       
    72         * Create copy profile
       
    73         * @param aProfileId Profile that is used for copying
       
    74         * @return None
       
    75         */
       
    76         CIAUpdateFWSyncProfile* CreateCopyProfileL( TInt aProfileId );
       
    77 
       
    78         /**
    60         /**
    79         * Return current profile
    61         * Return current profile
    80         * @param None.
    62         * @param None.
    81         * @return CIAUpdateFWSyncProfile*
    63         * @return CIAUpdateFWSyncProfile*
    82         */
    64         */
    83         CIAUpdateFWSyncProfile* Profile( );
    65         CIAUpdateFWSyncProfile* Profile( );
    84 
    66          
    85         /**
    67          
    86         * Cancel synchronization
       
    87         * @param None.
       
    88         * @return None
       
    89         */
       
    90         void CancelSyncL();
       
    91         
       
    92         /**
       
    93         * Return RSyncMLSession
       
    94         * @param None.
       
    95         * @return RSyncMLSession*
       
    96         */
       
    97         RSyncMLSession* Session();
       
    98         
       
    99         /**
    68         /**
   100         * Open profile
    69         * Open profile
   101         * @param aProfileId Profile id to open
    70         * @param aProfileId Profile id to open
   102         * @param aOpenMode opening mode
    71         * @param aOpenMode opening mode
   103         * @return None
    72         * @return None
   119         */               
    88         */               
   120         void SynchronizeL( TDesC& aServerName,
    89         void SynchronizeL( TDesC& aServerName,
   121                            const TInt aProfileId,
    90                            const TInt aProfileId,
   122                            const TInt aConnectionBearer,
    91                            const TInt aConnectionBearer,
   123                            const TBool aUseFotaProgressNote);
    92                            const TBool aUseFotaProgressNote);
   124         
    93  
   125         /**
    94    
   126         * Start synchronization
    95        		
   127         * @param aProfileId Profile id to sync
       
   128         * @param aJobId Jod id to sync
       
   129         * @return None
       
   130         */         
       
   131         void SynchronizeL( TDesC& aServerName,
       
   132                            const TInt aProfileId,
       
   133                            const TInt aJobId,
       
   134                            const TInt aConnectionBearer,
       
   135                            const TBool aUseFotaProgressNote );
       
   136         
       
   137         /**
       
   138         * Check if duplicate server id is found
       
   139         * @param  aServerId Server id
       
   140         * @param  aProfileId current profile id
       
   141         * @return ETrue if server id found
       
   142         */                 
       
   143         TBool ServerIdFoundL( const TDesC& aServerId, const TInt aProfileId );
       
   144         
       
   145 		/**
       
   146 		* Compare two descriptors
       
   147         * @param aLeft  
       
   148 		* @param aRight  
       
   149 		* @return - Positive, if this descriptor is 
       
   150         *                     greater than the specified descriptor.
       
   151 		*           Negative, if this descriptor is
       
   152 		*                     less than the specified descriptor.
       
   153 		*           Zero, if the content of both descriptors match
       
   154         */
       
   155         TInt Compare( const TDesC& aLeft, const TDesC& aRight );
       
   156         
       
   157         /**
       
   158         * Sync state
       
   159         * @param None
       
   160         * @return ETrue if sync is running
       
   161         */          
       
   162         TBool SyncRunning();
       
   163         
       
   164         /**
       
   165         * Utility function.
       
   166         * @param aSyncObserver
       
   167         * @return None
       
   168         */
       
   169         //void RequestSyncStatus( MIAUpdateFWSyncObserver* aSyncObserver );
       
   170 		
       
   171 	void SyncCompleted( TNSmlStatus aStatus );
    96 	void SyncCompleted( TNSmlStatus aStatus );
   172 
    97 
   173         
    98         
   174     private:
    99     private:
   175 
   100 
   189         RSyncMLSession          iSyncMLSession;
   114         RSyncMLSession          iSyncMLSession;
   190         // Sync profile
   115         // Sync profile
   191         CIAUpdateFWSyncProfile*     iProfile;
   116         CIAUpdateFWSyncProfile*     iProfile;
   192         // Sync handler
   117         // Sync handler
   193         CIAUpdateFWSyncHandler*     iSyncHandler;
   118         CIAUpdateFWSyncHandler*     iSyncHandler;
   194         // Sync Observer
       
   195         //MIAUpdateFWSyncObserver*    iSyncObserver;
       
   196     };
   119     };
   197 
   120 
   198 #endif      // CIAUpdateFWSYNCAPPENGINE_H
   121 #endif      // CIAUpdateFWSYNCAPPENGINE_H
   199 
   122 
   200 // End of File
   123 // End of File