profilesservices/FileList/Src/CFLDOperationObserver.cpp
branchRCL_3
changeset 54 7e0eff37aedb
parent 0 8c5d936e5675
equal deleted inserted replaced
53:8ee96d21d9bf 54:7e0eff37aedb
       
     1 /*
       
     2 * Copyright (c) 2005 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: Implementation of CFLDOperationObserver.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // CLASS HEADER
       
    21 #include "CFLDOperationObserver.h"
       
    22 
       
    23 // ============================ MEMBER FUNCTIONS ===============================
       
    24 
       
    25 // -----------------------------------------------------------------------------
       
    26 // CFLDOperationObserver::CFLDOperationObserver
       
    27 // C++ default constructor can NOT contain any code, that
       
    28 // might leave.
       
    29 // -----------------------------------------------------------------------------
       
    30 //
       
    31 CFLDOperationObserver::CFLDOperationObserver()
       
    32     {
       
    33     }
       
    34 
       
    35 // -----------------------------------------------------------------------------
       
    36 // CFLDOperationObserver::NewL
       
    37 // Two-phased constructor.
       
    38 // -----------------------------------------------------------------------------
       
    39 //
       
    40 CFLDOperationObserver* CFLDOperationObserver::NewL()
       
    41     {
       
    42     CFLDOperationObserver* self = new (ELeave) CFLDOperationObserver;
       
    43     return self;
       
    44     }
       
    45 
       
    46 // Destructor
       
    47 CFLDOperationObserver::~CFLDOperationObserver()
       
    48     {
       
    49     }
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CFLDOperationObserver::HandleOperationEventL
       
    53 // Method to handle list model operation events.
       
    54 // -----------------------------------------------------------------------------
       
    55 //
       
    56 void CFLDOperationObserver::HandleOperationEventL(
       
    57                                 TCLFOperationEvent aOperationEvent,
       
    58                                 TInt /*aError*/ )
       
    59     {
       
    60     // Waiting is stopped when an event for refresh completion is received
       
    61     if( aOperationEvent == ECLFRefreshComplete )
       
    62         {
       
    63         iRefreshOngoing = EFalse;
       
    64 
       
    65         if( iWait && iWait->IsStarted() )
       
    66             {
       
    67             iWait->AsyncStop();
       
    68             }
       
    69         }
       
    70     }
       
    71 
       
    72 // -----------------------------------------------------------------------------
       
    73 // CFLDOperationObserver::IsRefreshOngoing
       
    74 // Check if there is a refresh operation is ongoing.
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 TBool CFLDOperationObserver::IsRefreshOngoing()
       
    78     {
       
    79     return iRefreshOngoing;
       
    80     }
       
    81 
       
    82 // -----------------------------------------------------------------------------
       
    83 // CFLDOperationObserver::PrepareForRefresh
       
    84 // Prepare for a refresh operation.
       
    85 // -----------------------------------------------------------------------------
       
    86 //
       
    87 void CFLDOperationObserver::PrepareForRefresh( CActiveSchedulerWait& aWait )
       
    88     {
       
    89     // Store the wait instance
       
    90     iWait = &aWait;
       
    91 
       
    92     // Refresh operation will be started in a moment
       
    93     iRefreshOngoing = ETrue;
       
    94     }    
       
    95 
       
    96 //  End of File