phonebookengines/VirtualPhonebook/VPbkEng/src/CVPbkContactFindFromStoresOperation.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  An operation for find for store
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <CVPbkContactFindFromStoresOperation.h>
       
    20 #include <MVPbkContactStore.h>
       
    21 #include <MVPbkContactStoreProperties.h>
       
    22 #include <MVPbkContactLinkArray.h>
       
    23 
       
    24 // ======== MEMBER FUNCTIONS ========
       
    25 
       
    26 // ---------------------------------------------------------------------------
       
    27 // CVPbkContactFindFromStoresOperation::CVPbkContactFindFromStoresOperation
       
    28 // ---------------------------------------------------------------------------
       
    29 //
       
    30 CVPbkContactFindFromStoresOperation::CVPbkContactFindFromStoresOperation(
       
    31         MVPbkContactFindFromStoresObserver& aObserver )
       
    32         :   iObserver( aObserver )
       
    33     {
       
    34     }
       
    35 
       
    36 
       
    37 // ---------------------------------------------------------------------------
       
    38 // CVPbkContactFindFromStoresOperation::ConstructL
       
    39 // ---------------------------------------------------------------------------
       
    40 //
       
    41 void CVPbkContactFindFromStoresOperation::ConstructL()
       
    42     {
       
    43     }
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // CVPbkContactFindFromStoresOperation::NewLC
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 EXPORT_C CVPbkContactFindFromStoresOperation* 
       
    50         CVPbkContactFindFromStoresOperation::NewLC( 
       
    51             MVPbkContactFindFromStoresObserver& aObserver )
       
    52     {
       
    53     CVPbkContactFindFromStoresOperation* self = 
       
    54         new( ELeave ) CVPbkContactFindFromStoresOperation( aObserver );
       
    55     CleanupStack::PushL( self );
       
    56     self->ConstructL();
       
    57     return self;
       
    58     }
       
    59 
       
    60 
       
    61 // ---------------------------------------------------------------------------
       
    62 // CVPbkContactFindFromStoresOperation::~CVPbkContactFindFromStoresOperation
       
    63 // ---------------------------------------------------------------------------
       
    64 //
       
    65 CVPbkContactFindFromStoresOperation::~CVPbkContactFindFromStoresOperation()
       
    66     {
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // CVPbkContactFindFromStoresOperation::HandleZeroSuboperations
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 void CVPbkContactFindFromStoresOperation::HandleZeroSuboperations()
       
    74     {
       
    75     iObserver.FindFromStoresOperationComplete();
       
    76     }
       
    77     
       
    78 // ---------------------------------------------------------------------------
       
    79 // CVPbkContactFindFromStoresOperation::FindFromStoreSucceedL
       
    80 // ---------------------------------------------------------------------------
       
    81 //
       
    82 void CVPbkContactFindFromStoresOperation::FindFromStoreSucceededL( 
       
    83         MVPbkContactStore& aStore, 
       
    84         MVPbkContactLinkArray* aResultsFromStore )
       
    85     {
       
    86     // Client takes ownership of aResultsFromStore immediately
       
    87     iObserver.FindFromStoreSucceededL( aStore, aResultsFromStore );
       
    88     const TDesC16& check = aStore.StoreProperties().Uri().UriDes();
       
    89     }
       
    90 
       
    91 // ---------------------------------------------------------------------------
       
    92 // CVPbkContactFindFromStoresOperation::FindFromStoreFailed
       
    93 // ---------------------------------------------------------------------------
       
    94 //    
       
    95 void CVPbkContactFindFromStoresOperation::FindFromStoreFailed( 
       
    96         MVPbkContactStore& aStore, TInt aError )
       
    97     {
       
    98     iObserver.FindFromStoreFailed( aStore, aError );
       
    99     }
       
   100 
       
   101 // ---------------------------------------------------------------------------
       
   102 // CVPbkContactFindFromStoresOperation::FindFromStoreSucceed
       
   103 // ---------------------------------------------------------------------------
       
   104 //
       
   105 void CVPbkContactFindFromStoresOperation::FindFromStoresOperationComplete()
       
   106     {
       
   107     ++iNumberOfCompleted;
       
   108     if ( iNumberOfCompleted >= SubOperationCount() )
       
   109         {
       
   110         iObserver.FindFromStoresOperationComplete();
       
   111         }
       
   112     }
       
   113