phonebookengines/VirtualPhonebook/VPbkCntModel/inc/CFindInTextDefOperation.h
branchRCL_3
changeset 20 f4a778e096c2
parent 0 e686773b3f54
equal deleted inserted replaced
19:5b6f26637ad3 20:f4a778e096c2
       
     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:  A find operation that uses 
       
    15 *                CContactDataBase::FindInTextDefAsyncL
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef C_CFINDINTEXTDEFOPERATION_H
       
    21 #define C_CFINDINTEXTDEFOPERATION_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <cntdb.h>
       
    25 #include <MVPbkContactOperation.h>
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MVPbkFieldTypeList;
       
    29 class MVPbkContactFindFromStoresObserver;
       
    30 class CVPbkContactLinkArray;
       
    31 
       
    32 namespace VPbkCntModel {
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CContactStore;
       
    36 
       
    37 /**
       
    38  *  A find operation that uses CContactDataBase::FindInTextDefAsyncL
       
    39  *
       
    40  */
       
    41 NONSHARABLE_CLASS(CFindInTextDefOperation) 
       
    42     :   public CBase,
       
    43         public MVPbkContactOperation,
       
    44         private MIdleFindObserver
       
    45     {
       
    46 public:
       
    47     static CFindInTextDefOperation* NewL( 
       
    48         CContactStore& aContactStore,
       
    49         const MDesC16Array& aSearchStrings,
       
    50         const MVPbkFieldTypeList& aFieldTypes,
       
    51         MVPbkContactFindFromStoresObserver& aObserver, 
       
    52         const TCallBack& aWordParserCallBack );
       
    53     virtual ~CFindInTextDefOperation();
       
    54 
       
    55 // from base class MVPbkContactOperation
       
    56     void StartL();
       
    57     void Cancel();
       
    58 
       
    59 private:
       
    60 // from base class MIdleFindObserver
       
    61     void IdleFindCallback();
       
    62     
       
    63 private:
       
    64 
       
    65     CFindInTextDefOperation( CContactStore& aContactStore,
       
    66         MVPbkContactFindFromStoresObserver& aObserver, 
       
    67         const TCallBack& aWordParserCallBack );
       
    68     void ConstructL( const MDesC16Array& aSearchStrings,
       
    69         const MVPbkFieldTypeList& aFieldTypes );
       
    70     static TInt ConvertResults( TAny* aThis );
       
    71     TInt ConvertResultsL();
       
    72     void HandleError( TInt aError );
       
    73 
       
    74 private: // data
       
    75     /// Ref: the store implementation
       
    76     CContactStore& iStore;
       
    77     /// Ref: the observer of the operation
       
    78     MVPbkContactFindFromStoresObserver& iObserver;
       
    79     /// Ref: the word parser from the client
       
    80     TCallBack iWordParserCallBack;
       
    81     /// Own: the search strings
       
    82     CDesCArrayFlat* iSearchStrings;
       
    83     /// Own: defines the field types that used for searching
       
    84     CContactTextDef* iTextDefs;
       
    85     /// Own: a find operation from contact model
       
    86     CIdleFinder* iAsyncFinder;
       
    87     /// Own: matched contact ids
       
    88     CContactIdArray* iContactIds;
       
    89     /// Own: an idle for asynchronous find completion
       
    90     CIdle* iIdle;
       
    91     /// Own: an arrau of contact find results
       
    92     CVPbkContactLinkArray* iResults;
       
    93     };
       
    94 } // VPbkCntModel
       
    95 
       
    96 #endif // C_CFINDINTEXTDEFOPERATION_H