messagingappbase/mce/inc/mceiaupdateutils.h
changeset 0 72b543305e3a
child 5 4697dfb2d7ad
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002 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 *     Application class for Mce.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef C_CMCEIAUPDATEUTILS_H
       
    20 #define C_CMCEIAUPDATEUTILS_H
       
    21 
       
    22 // system include files go here:
       
    23 #include <e32base.h>
       
    24 #include <iaupdateobserver.h>
       
    25 
       
    26 // forward declarations go here:
       
    27 class CIAUpdate;
       
    28 class CIAUpdateParameters;
       
    29 
       
    30 /**
       
    31  *  Has utilities to help IAD aware applications to
       
    32  *  update themselves (discover, download and install updates).
       
    33  *
       
    34  *  @code
       
    35  *   const TUid KYourAppUid ={0x10005ABC};
       
    36  *   CMceIAUpdateUtils *MsgIadUpdate = CMceIAUpdateUtils::NewL();
       
    37  *   iMsgIadUpdate->StartL(KYourAppUid);
       
    38  *  @endcode
       
    39  *
       
    40  */
       
    41 class CMceIAUpdateUtils : public CBase,
       
    42 public MIAUpdateObserver
       
    43     {
       
    44 public:
       
    45 
       
    46     /**
       
    47      * Two-phased constructor.
       
    48      * @param aAppUid Uid of the app for which update needs to be checked.
       
    49      */
       
    50     static CMceIAUpdateUtils* NewL();
       
    51 
       
    52 
       
    53     /**
       
    54     * Destructor.
       
    55     */
       
    56     virtual ~CMceIAUpdateUtils();
       
    57 
       
    58     /**
       
    59      * Start IA update process.
       
    60      * @param aAppUid Uid of the app for which update needs to be checked.
       
    61      */
       
    62     void StartL( const TUid aAppUid );
       
    63 
       
    64 private:
       
    65 
       
    66     /**
       
    67      * C++ default constructor.
       
    68      */
       
    69     CMceIAUpdateUtils();
       
    70 
       
    71     /**
       
    72      * By default Symbian 2nd phase constructor is private.
       
    73      */
       
    74     void ConstructL();
       
    75 
       
    76     /**
       
    77      * Cleanup function.
       
    78      */
       
    79     void Delete();
       
    80 
       
    81 private: // From MIAUpdateObserver
       
    82 
       
    83     /**
       
    84      * From MIAUpdateObserver.
       
    85      * This callback function is called when the update checking operation has
       
    86      * completed.
       
    87      *
       
    88      * @param aErrorCode The error code of the observed update operation.
       
    89      *                   KErrNone for successful completion,
       
    90      *                   otherwise a system wide error code.
       
    91      * @param aAvailableUpdates Number of the updates that were found available.
       
    92      */
       
    93     void CheckUpdatesComplete( TInt aErrorCode, TInt aAvailableUpdates );
       
    94 
       
    95 
       
    96     /**
       
    97      * From MIAUpdateObserver.
       
    98      * This callback function is called when an update operation has completed.
       
    99      * Even if multiple functions are provided to start different update
       
   100      * operations, this callback function is always called after an update
       
   101      * operation has completed.
       
   102      *
       
   103      * @param aErrorCode The error code of the completed update operation.
       
   104      *                   KErrNone for successful completion,
       
   105      *                   otherwise a system wide error code.
       
   106      * @param aResult Details about the completed update operation.
       
   107      *                Ownership is transferred.
       
   108      */
       
   109     void UpdateComplete( TInt aErrorCode, CIAUpdateResult* aResultDetails );
       
   110 
       
   111 
       
   112     /**
       
   113      * From MIAUpdateObserver.
       
   114      * This callback function is called when an update query operation has
       
   115      * completed.
       
   116      *
       
   117      * @param aErrorCode The error code of the observed query operation.
       
   118      *                   KErrNone for successful completion,
       
   119      *                   otherwise a system wide error code.
       
   120      * @param aUpdateNow ETrue informs that an update operation should be started.
       
   121      *                   EFalse informs that there is no need to start an update
       
   122      *                   operation.
       
   123      */
       
   124     void UpdateQueryComplete( TInt aErrorCode, TBool aUpdateNow );
       
   125 
       
   126 private: // data
       
   127 
       
   128     /**
       
   129      * IAD update API.
       
   130      * Own.
       
   131      */
       
   132     CIAUpdate* iUpdate;
       
   133 
       
   134     /**
       
   135      * IAD update parameters.
       
   136      * Own.
       
   137      */
       
   138     CIAUpdateParameters* iParameters;
       
   139 
       
   140     };
       
   141 
       
   142 #endif // C_CMCEIAUPDATEUTILS_H
       
   143 
       
   144 //EOF