ncdengine/inc/ncdinstalloperationobserver.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2006 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:   Observer interface definition for install operations
       
    15 *
       
    16 */
       
    17 	
       
    18 
       
    19 #ifndef M_NCD_INSTALL_OPERATION_OBSERVER_H
       
    20 #define M_NCD_INSTALL_OPERATION_OBSERVER_H
       
    21 
       
    22 #include <e32cmn.h>
       
    23 
       
    24 class MNcdInstallOperation;
       
    25 class TNcdProgress;
       
    26 class MNcdQuery;
       
    27 
       
    28 /**
       
    29  *  Observer interface for install operations
       
    30  *
       
    31  *  Install operation users should implement this interface to be able to
       
    32  *  receive callbacks.
       
    33  *
       
    34  *  
       
    35  *  @see MNcdInstallOperation
       
    36  */
       
    37 class MNcdInstallOperationObserver
       
    38     {
       
    39     
       
    40 public:
       
    41      
       
    42      
       
    43     /**
       
    44      * Called when install has progressed. 
       
    45      *
       
    46      * @note This will be called only once per an installed file. 
       
    47      * The reason for this is that the install process is handled outside of
       
    48      * Catalogs Engine in the platform installer.
       
    49      *
       
    50      * 
       
    51      * @param aOperation The operation that sent the event.
       
    52      * @param aProgress Progress of the operation.
       
    53      */
       
    54     virtual void InstallProgress( MNcdInstallOperation& aOperation,
       
    55         TNcdProgress aProgress ) = 0;
       
    56 
       
    57     /**
       
    58      * Called when a query has been received for an operation.
       
    59      *
       
    60      * @note Querys need to be completed with MNcdOperation::CompleteQueryL()
       
    61      *       to continue the operation! Alternatively, the operation must be
       
    62      *       cancelled.
       
    63      * 
       
    64      * 
       
    65      * @see MNcdOperation
       
    66      * @see MNcdQuery
       
    67      * @param aOperation Uncounted reference to the operation that sent the event.
       
    68      * @param aQuery Pointer to the query that must be completed. Counted, Release()
       
    69      *        must be called after use.
       
    70      * @see MNcdOperation::CompleteQueryL()
       
    71      */
       
    72     virtual void QueryReceived( MNcdInstallOperation& aOperation,
       
    73         MNcdQuery* aQuery ) = 0;
       
    74 
       
    75     /**
       
    76      * Called when an operation has been completed.
       
    77      *
       
    78      * 
       
    79      * @param aOperation The operation that sent the event.
       
    80      * @param aError Error code for operation completion. 
       
    81      *               KErrNone for successful completion, KErrAbort if the user
       
    82      *               cancelled the operation, otherwise a system
       
    83      *               wide error code.
       
    84      */
       
    85     virtual void OperationComplete( MNcdInstallOperation& aOperation,
       
    86         TInt aError ) = 0;
       
    87 
       
    88 
       
    89 protected:
       
    90 
       
    91     /**
       
    92      * Destructor
       
    93      *
       
    94      * An empty virtual destructor is implemented to prevent deletion 
       
    95      * of a class object through this interface.
       
    96      * Observer should not be deleted by the one that is observed.
       
    97      */
       
    98     virtual ~MNcdInstallOperationObserver() { }
       
    99     
       
   100     };
       
   101     
       
   102 #endif //  M_NCD_INSTALL_OPERATION_OBSERVER_H