iaupdate/IAD/firmwareupdate/inc/iaupdatefwsyncstate.h
changeset 0 ba25891c3a9e
child 77 d1838696558c
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2008 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:    
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef IAUPDATEFWSYNCSTATE_H
       
    22 #define IAUPDATEFWSYNCSTATE_H
       
    23 
       
    24 
       
    25 //  INCLUDES
       
    26 #include <e32base.h>
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /*
       
    31 * CIAUpdateFWSyncState 
       
    32 *
       
    33 * CIAUpdateFWSyncState handles sync states
       
    34 */
       
    35 NONSHARABLE_CLASS (CIAUpdateFWSyncState) : public CBase
       
    36     {
       
    37     public:
       
    38 		enum TSyncPhase
       
    39 			{
       
    40 			EPhaseConnecting = 0,
       
    41 			EPhaseInitialising,
       
    42 			EPhaseSending,
       
    43 			EPhaseReceiving,
       
    44 			EPhaseSynchronizing,
       
    45 			EPhaseDisconnecting,
       
    46 			EPhaseCanceling,
       
    47 			EPhaseNone
       
    48 			};
       
    49 
       
    50     public:
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         */
       
    54          static CIAUpdateFWSyncState* NewL();
       
    55         
       
    56         /**
       
    57         * Destructor.
       
    58         */
       
    59          virtual ~CIAUpdateFWSyncState();
       
    60         
       
    61     private:
       
    62         /**
       
    63         * By default Symbian 2nd phase constructor is private.
       
    64         */
       
    65         CIAUpdateFWSyncState();
       
    66         
       
    67         /**
       
    68         * C++ default constructor.
       
    69         */
       
    70         void ConstructL();
       
    71         
       
    72     public:
       
    73         /**
       
    74         * Reset state variables.
       
    75         * @param None.
       
    76         * @return None.
       
    77         */
       
    78          void Reset();
       
    79         
       
    80     public:
       
    81         /**
       
    82         * Set synchronization phase.
       
    83         * @param aPhase synchronization phase.
       
    84         * @return None.
       
    85         */
       
    86          void SetSyncPhase(TInt aPhase);
       
    87         
       
    88         /**
       
    89         * Get synchronization phase.
       
    90         * @param None.
       
    91         * @return Synchronization phase.
       
    92         */
       
    93          TInt SyncPhase();
       
    94 
       
    95         /**
       
    96         * Set total sync progress.
       
    97         * @param aCount Progress count.
       
    98         * @return None.
       
    99         */
       
   100 		 void SetTotalProgress(TInt aCount);
       
   101 
       
   102         /**
       
   103         * Get total sync progress.
       
   104         * @param None. 
       
   105         * @return Progress count.
       
   106         */
       
   107 		 TInt TotalProgress();
       
   108 
       
   109         /**
       
   110         * Set sync progress.
       
   111         * @param aCount Progress count.
       
   112         * @return None.
       
   113         */
       
   114 		 void SetProgress(TInt aCount);
       
   115 
       
   116         /**
       
   117         * Increase sync progress.
       
   118         * @param None.
       
   119         * @return None.
       
   120         */
       
   121          void IncreaseProgress();
       
   122         
       
   123         /**
       
   124         * Get sync progress.
       
   125         * @param None. 
       
   126         * @return Progress count.
       
   127         */
       
   128 		 TInt Progress();
       
   129 
       
   130         /**
       
   131         * Set sync content name.
       
   132         * @param aContent Content name.
       
   133         * @return None.
       
   134         */
       
   135          void SetContent(const TDesC& aContent);
       
   136 
       
   137         /**
       
   138         * Get sync content name.
       
   139         * @param None. 
       
   140         * @return Content name.
       
   141         */
       
   142 		 const TDesC& Content();
       
   143 
       
   144         /**
       
   145         * Resets progress state.
       
   146         * @param None. 
       
   147         * @return None.
       
   148         */
       
   149 		 void ResetProgress();
       
   150 		
       
   151         /**
       
   152         * Finds out whether total progress count is known.
       
   153         * @param None. 
       
   154         * @return ETrue if total progress count is known, EFalse otherwise.
       
   155         */
       
   156 		 TBool ProgressKnown();
       
   157         
       
   158     private:
       
   159         // synchronization phase
       
   160 		TInt iSyncPhase;
       
   161 
       
   162 		// total number of sent/received sync items
       
   163 		TInt iTotalProgressCount;
       
   164 
       
   165 		// number of sent/received sync items
       
   166 		TInt iProgressCount;
       
   167 
       
   168 		// name of the content being synced
       
   169 		TName iSyncContent;
       
   170     };
       
   171 
       
   172 #endif  // IAUPDATEFWSYNCSTATE_H
       
   173 
       
   174 // End of File