iaupdate/IAD/api/client/inc/iaupdatemanager.h
changeset 29 26b6f0522fd8
parent 0 ba25891c3a9e
equal deleted inserted replaced
25:98b66e4fb0be 29:26b6f0522fd8
     1 /*
     1 /*
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2007-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".
    13 *
    13 *
    14 * Description:   This file contains the header file of the CIAUpdateManager class 
    14 * Description:   This file contains the header file of the CIAUpdateManager class 
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 
       
    19 
       
    20 #ifndef IA_UPDATE_MANAGER_H
    18 #ifndef IA_UPDATE_MANAGER_H
    21 #define IA_UPDATE_MANAGER_H
    19 #define IA_UPDATE_MANAGER_H
    22 
    20 
    23 
    21 
    24 //INCLUDES
    22 //INCLUDES
    25 #include <e32base.h>
    23 #include <e32base.h>
    26 #include <e32std.h>
    24 #include <e32std.h>
    27 #include <coemain.h>
    25 #include <coemain.h>
    28 
    26 
    29 #include "iaupdateclient.h"
       
    30 
       
    31 //FORWARD DECLARATIONS
    27 //FORWARD DECLARATIONS
       
    28 class IAUpdateClient;
    32 class CIAUpdateParameters;
    29 class CIAUpdateParameters;
    33 class MIAUpdateObserver;
    30 class MIAUpdateObserver;
    34 class CEikonEnv;
    31 class CEikonEnv;
    35 
    32 
    36 
    33 
    47  * @see CIAUpdateParameters
    44  * @see CIAUpdateParameters
    48  * @see CIAUpdate
    45  * @see CIAUpdate
    49  *
    46  *
    50  * @since S60 v3.2
    47  * @since S60 v3.2
    51  */
    48  */
    52 NONSHARABLE_CLASS( CIAUpdateManager ) : public CActive, public MCoeForegroundObserver
    49 NONSHARABLE_CLASS( CIAUpdateManager ) : public CBase, public MCoeForegroundObserver
    53     {
    50     {
    54 
    51 
    55 public:
    52 public:
    56 
    53 
    57     /**
       
    58      * These values inform what operation has been requested.
       
    59      *
       
    60      * @since S60 v3.2
       
    61      */
       
    62     enum TIAUpdateType
       
    63         {
       
    64         /**
       
    65          * No operation is going on.
       
    66          */ 
       
    67         EIAUpdateIdle,       
       
    68         
       
    69         /**
       
    70          * Update check has been requested.
       
    71          */
       
    72         EIAUpdateCheck,
       
    73 
       
    74         /**
       
    75          * Update operation has been requested.
       
    76          */
       
    77         EIAUpdateUpdate,     
       
    78         
       
    79         /**
       
    80          * Update query has been requested.
       
    81          */
       
    82         EIAUpdateQuery   
       
    83         };
       
    84 
       
    85 
       
    86     /**
       
    87      * @param aObserver Callback functions of the observer are called
       
    88      * when operations progress.    
       
    89      * @return CIAUpdateManager* Pointer to the created CIAUpdateManager 
       
    90      * object that can be used for update actions.
       
    91      *
       
    92      * @since S60 v3.2
       
    93      */
       
    94     static CIAUpdateManager* NewL( MIAUpdateObserver& aObserver );
    54     static CIAUpdateManager* NewL( MIAUpdateObserver& aObserver );
    95     
    55     
    96     /**
       
    97      * @see NewL
       
    98      *
       
    99      * @since S60 v3.2
       
   100      */
       
   101     static CIAUpdateManager* NewLC( MIAUpdateObserver& aObserver );
    56     static CIAUpdateManager* NewLC( MIAUpdateObserver& aObserver );
   102     
    57     
   103 
    58 
   104     /**
    59 
   105      * Destructor
    60     ~CIAUpdateManager();
   106      *
    61   
   107      * @since S60 v3.2
    62     void CheckUpdates( const CIAUpdateParameters& aUpdateParameters );
   108      */
    63   
   109     virtual ~CIAUpdateManager();
    64     void ShowUpdates( const CIAUpdateParameters& aUpdateParameters );
       
    65  
       
    66     void UpdateQuery();
   110     
    67     
   111 
       
   112     /** 
       
   113      * @see CIAUpdate::CheckUpdates
       
   114      *
       
   115      * @since S60 v3.2
       
   116      */
       
   117     void CheckUpdates( const CIAUpdateParameters& aUpdateParameters );
       
   118     
       
   119         
       
   120     /** 
       
   121      * @see CIAUpdate::ShowUpdates
       
   122      *
       
   123      * @since S60 v3.2
       
   124      */
       
   125     void ShowUpdates( const CIAUpdateParameters& aUpdateParameters );
       
   126     
       
   127 
       
   128     /** 
       
   129      * @see CIAUpdate::Update
       
   130      *
       
   131      * @since S60 v3.2
       
   132      */
       
   133     void Update( const CIAUpdateParameters& aUpdateParameters );
    68     void Update( const CIAUpdateParameters& aUpdateParameters );
   134     
       
   135      /** 
       
   136      * @see CIAUpdate::UpdateQuery
       
   137      *
       
   138      * @since S60 v3.2
       
   139      */   
       
   140     void UpdateQuery();
       
   141 
       
   142 
       
   143 protected: // CActive
       
   144 
       
   145     /**
       
   146      * @see CActive::DoCancel
       
   147      *
       
   148      * @since S60 v3.2
       
   149      */
       
   150     virtual void DoCancel();
       
   151 
       
   152     /**
       
   153      * When the server side has finished operation, the CActive object will
       
   154      * be informed about it, and as a result RunL will be called. This function
       
   155      * well inform the observer that the operation has been completed.
       
   156      * @see CActive::RunL
       
   157      *
       
   158      * @since S60 v3.2
       
   159      */
       
   160     virtual void RunL();
       
   161 
       
   162 
       
   163 protected:
       
   164 
       
   165     /**
       
   166      * @see NewL
       
   167      *
       
   168      * @since S60 v3.2
       
   169      */
       
   170     CIAUpdateManager( MIAUpdateObserver& aObserver );
       
   171     
       
   172     /**
       
   173      * @see NewL
       
   174      *
       
   175      * @since S60 v3.2
       
   176      */
       
   177     virtual void ConstructL();
       
   178 
       
   179 
       
   180     /**
       
   181      * Resets all the result variables to their default values.
       
   182      *
       
   183      * @since S60 v3.2
       
   184      */
       
   185     virtual void ResetResults();
       
   186 
       
   187 
       
   188     /**
       
   189      * @return ETrue if an operation is going on. Else EFalse.
       
   190      *
       
   191      * @since S60 v3.2
       
   192      */
       
   193     TBool BusyCheck() const;
       
   194 
       
   195 
       
   196     /**
       
   197      * @return RIAUpdateClient& Handles the client server communication.
       
   198      *
       
   199      * @since S60 v3.2
       
   200      */
       
   201     RIAUpdateClient& UpdateClient();
       
   202 
       
   203 
       
   204     /**
       
   205      * @return MUpdateObserver& Observer who will be informed about the
       
   206      * completion of the operations.
       
   207      *
       
   208      * @since S60 v3.2
       
   209      */
       
   210     MIAUpdateObserver& Observer() const;
       
   211 
       
   212 
       
   213     /**
       
   214      * @return TIAUpdateType Informs what kind of operation is going on.
       
   215      *
       
   216      * @since S60 v3.2
       
   217      */
       
   218     TIAUpdateType UpdateType() const;
       
   219     
       
   220     /**
       
   221      * @param aUpdateType Informs what kind of operation is going on.
       
   222      *
       
   223      * @since S60 v3.2
       
   224      */
       
   225     void SetUpdateType( TIAUpdateType aUpdateType );
       
   226 
    69 
   227 
    70 
   228 private:
    71 private:
       
    72 
       
    73     CIAUpdateManager();
       
    74     
       
    75     void ConstructL( MIAUpdateObserver& aObserver );
   229 
    76 
   230     // Prevent these if not implemented
    77     // Prevent these if not implemented
   231     CIAUpdateManager( const CIAUpdateManager& aObject );
    78     CIAUpdateManager( const CIAUpdateManager& aObject );
   232     CIAUpdateManager& operator =( const CIAUpdateManager& aObject );
    79     CIAUpdateManager& operator =( const CIAUpdateManager& aObject );
   233     
    80     
   243 	*/
    90 	*/
   244 	void HandleLosingForeground();
    91 	void HandleLosingForeground();
   245 
    92 
   246 
    93 
   247 private: // data
    94 private: // data
       
    95    
       
    96     // Handles the client server communication.
       
    97     IAUpdateClient* iUpdateClient;
   248 
    98 
   249     // Observer who will be informed about the completion of the operations. 
       
   250     MIAUpdateObserver& iObserver;    
       
   251     
       
   252     // Handles the client server communication.
       
   253     RIAUpdateClient iUpdateClient;
       
   254 
       
   255     // Informs what kind of operation is going on.
       
   256     TIAUpdateType iUpdateType;
       
   257 
       
   258     // This is used to storage the success count values for update operations.
       
   259     TInt iSuccessCount;
       
   260     
       
   261     // This is used to storage the fail count values for update operations.
       
   262     TInt iFailCount;
       
   263     
       
   264     // This is used to storage the cancel count values for update operations.
       
   265     TInt iCancelCount;
       
   266 
       
   267     TBool iUpdateNow;
       
   268     
       
   269     CEikonEnv* iEikEnv; //not owned
    99     CEikonEnv* iEikEnv; //not owned
   270 
       
   271     };
   100     };
   272 
   101 
   273 #endif // IA_UPDATE_IMPL_H
   102 #endif // IA_UPDATE_IMPL_H