filemanager/Engine/inc/CFileManagerRefresher.h
changeset 0 6a9f87576119
equal deleted inserted replaced
-1:000000000000 0:6a9f87576119
       
     1 /*
       
     2 * Copyright (c) 2002-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:  Asynchronous refresher for CGflmNavigatorModel
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CFILEMANAGERREFRESHER_H
       
    20 #define CFILEMANAGERREFRESHER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "GFLM.hrh"
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CGflmNavigatorModel;
       
    28 class MFileManagerProcessObserver;
       
    29 
       
    30 // CLASS DECLARATION
       
    31 
       
    32 /**
       
    33 *  This class start asynchronous refreshing of given CGflmNavigatorModel.
       
    34 *
       
    35 *  @lib FileManagerEngine.lib
       
    36 *  @since 2.0
       
    37 */
       
    38 NONSHARABLE_CLASS(CFileManagerRefresher) : public CActive
       
    39     {
       
    40     public:  // Constructors and destructor
       
    41 
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         */
       
    45         static CFileManagerRefresher* NewL( CGflmNavigatorModel& aModel );
       
    46 
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50         virtual ~CFileManagerRefresher();
       
    51 
       
    52     public: // New functions
       
    53 
       
    54         /**
       
    55         * Refreshes the model.
       
    56         * @since 2.0
       
    57         * @param aRefreshMode Given refresh mode.
       
    58         */
       
    59         void Refresh( TGflmRefreshMode aRefreshMode = ERefreshItems );
       
    60 
       
    61         /**
       
    62         * Sets observer
       
    63         * @since 2.0
       
    64         * @param aObserver Observer for the operation or NULL,
       
    65         *                  ownership is not transferred.
       
    66         */
       
    67         void SetObserver( MFileManagerProcessObserver* aObserver );
       
    68 
       
    69         /**
       
    70         * Cancels refresh.
       
    71         * @since 2.0
       
    72         */
       
    73         TBool CancelRefresh();
       
    74 
       
    75     protected:  // From CActive
       
    76 
       
    77         void RunL();
       
    78 
       
    79         TInt RunError( TInt aError );
       
    80 
       
    81         void DoCancel();
       
    82 
       
    83     private:
       
    84 
       
    85         /**
       
    86         * By default Symbian 2nd phase constructor is private.
       
    87         */
       
    88         void ConstructL();
       
    89 
       
    90         /**
       
    91         * C++ default constructor.
       
    92         */
       
    93         CFileManagerRefresher( CGflmNavigatorModel& aModel );
       
    94 
       
    95     private:    // Data
       
    96 
       
    97         // Ref: Reference to the model instance that will be refreshed
       
    98         CGflmNavigatorModel& iModel;
       
    99 
       
   100         // Ref: Pointer to the observer that will be notified
       
   101         MFileManagerProcessObserver* iObserver;
       
   102 
       
   103     };
       
   104 
       
   105 #endif // CFILEMANAGERREFRESHER_H
       
   106 
       
   107 // End of File