ncdengine/engine/transport/inc/catalogstransportoperation.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:  
       
    15 *
       
    16 */
       
    17 	
       
    18 
       
    19 #ifndef M_CATALOGSTRANSPORTOPERATION_H
       
    20 #define M_CATALOGSTRANSPORTOPERATION_H
       
    21 
       
    22 
       
    23 /**
       
    24 * Operation progress information
       
    25 */
       
    26 class TCatalogsTransportProgress	
       
    27     {
       
    28     public:
       
    29         /**
       
    30         * Constructor
       
    31         */
       
    32         TCatalogsTransportProgress( TInt aState, TInt32 aProgress, 
       
    33             TInt32 aMaxProgress ) :
       
    34             iState( aState ), 
       
    35             iProgress( aProgress ), 
       
    36             iMaxProgress( aMaxProgress )
       
    37             {			
       
    38             }
       
    39 	
       
    40     public:
       
    41         TUint iState;         // State of the operation
       
    42         TInt32 iProgress;     // Progress of the current state
       
    43         TInt32 iMaxProgress;  // Maximum progress value for the current state
       
    44     };
       
    45 
       
    46 
       
    47 /**
       
    48 * Transport Operation interface	
       
    49 */
       
    50 class MCatalogsTransportOperation //: public MCatalogsBase	
       
    51     {        
       
    52     public:
       
    53 
       
    54         /**
       
    55          * AddRef
       
    56          * Increases the reference counter by given value.
       
    57          *
       
    58          * @param aNum is the number by which the reference count is increased.
       
    59          * @return TInt the new reference count value.
       
    60          */
       
    61         virtual TInt AddRef() = 0;		
       
    62         
       
    63         /**
       
    64          * Release
       
    65          * Releases a reference. Deletes the object if the reference count
       
    66          * reaches 0. 
       
    67          * Notice that destructor is defined as protected. So, the object of
       
    68          * this interface can be deleted using this function and only after 
       
    69          * reference count is zero.
       
    70          *
       
    71          * @return Reference count after release
       
    72          */
       
    73         virtual TInt Release() = 0;
       
    74         
       
    75         /**
       
    76          * Returns the number of registered references to the object 
       
    77          * that implements the MCatalogBase interfaces.
       
    78          *
       
    79          * @return TInt Reference count     
       
    80          */
       
    81         virtual TInt RefCount() const = 0;
       
    82 
       
    83 
       
    84         /**
       
    85         * Cancel operation
       
    86         *
       
    87         * @return Error code
       
    88         */
       
    89         virtual TInt Cancel() = 0;
       
    90 
       
    91 
       
    92         /**
       
    93         * Progress information getter
       
    94         *
       
    95         * @return Progress information
       
    96         */
       
    97         virtual TCatalogsTransportProgress Progress() const = 0;
       
    98         
       
    99     protected:
       
   100     
       
   101         /**
       
   102         * Protected destructor
       
   103         */
       
   104         virtual ~MCatalogsTransportOperation() 
       
   105             {
       
   106             }
       
   107 	
       
   108 	};
       
   109 	
       
   110 	
       
   111 #endif //  M_CATALOGSTRANSPORTOPERATION_H