phoneengine/PhoneCntFinder/ContactService/inc/cphcntvoipcontactmatchstrategy.h
branchRCL_3
changeset 62 5266b1f337bd
parent 0 5f000ab63145
equal deleted inserted replaced
61:41a7f70b3818 62:5266b1f337bd
       
     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:  Finds voip contacts from phonebook
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHCNTVOIPCONTACTMATCHSTRATEGY
       
    20 #define CPHCNTVOIPCONTACTMATCHSTRATEGY
       
    21 
       
    22 #include <e32base.h>
       
    23 #include <MVPbkContactFindObserver.h>
       
    24 
       
    25 #include "mphcntcontactmatchstrategy.h"
       
    26 
       
    27 class MPhCntVoipContactFinder;
       
    28 class MVPbkContactOperationBase;
       
    29 
       
    30 /**
       
    31  *  Finds voip contacts from phonebook
       
    32  *
       
    33  *  @lib PhoneCntFinder
       
    34  *  @since S60 v3.1
       
    35  */
       
    36 NONSHARABLE_CLASS( CPhCntVoipContactMatchStrategy ): 
       
    37     public CBase, 
       
    38     public MPhCntContactMatchStrategy,
       
    39     private MVPbkContactFindObserver
       
    40     {
       
    41 public:
       
    42     
       
    43     static CPhCntVoipContactMatchStrategy* NewL(
       
    44         MPhCntVoipContactFinder& aVoipContactFinder,
       
    45         MVPbkContactFindObserver& aObserver );
       
    46 
       
    47     static CPhCntVoipContactMatchStrategy* NewLC(
       
    48         MPhCntVoipContactFinder& aVoipContactFinder,
       
    49         MVPbkContactFindObserver& aObserver );
       
    50 
       
    51     virtual ~CPhCntVoipContactMatchStrategy();
       
    52 
       
    53 // from base class MPhCntContactMatchStrategy
       
    54 
       
    55     /**
       
    56      * From base class MPhCntContactMatchStrategy
       
    57      * Starts finding contacts, which contact field matches with aMatchString.
       
    58      *
       
    59      * @since S60 v3.1
       
    60      * @param aMatchString String which is matched against contact fields.
       
    61      */
       
    62     void FindMatchesL( const TDesC& aMatchString );
       
    63 
       
    64 private:
       
    65 
       
    66     CPhCntVoipContactMatchStrategy( 
       
    67         MPhCntVoipContactFinder& aVoipContactFinder,
       
    68         MVPbkContactFindObserver& aObserver );
       
    69 
       
    70     void ConstructL();
       
    71     
       
    72 // from base class MVPbkContactFindObserver
       
    73     
       
    74     /**
       
    75      * From base class MVPbkContactFindObserver
       
    76      * Called when find is complete. Callee takes ownership of the results.
       
    77      * In case of an error during find, the aResults may contain only 
       
    78      * partial results of the find.
       
    79      *
       
    80      * @since S60 v3.1
       
    81      * @param aResults Array of contact links that matched the find.
       
    82      *                 Callee must take ownership of this object in
       
    83      *                 the start of the function, ie. in case the function
       
    84      *                 leaves the results must be destroyed. The find
       
    85      *                 operation can be destroyed at the end of this callback.
       
    86      */
       
    87     void FindCompleteL( MVPbkContactLinkArray* aResults );
       
    88 
       
    89     /** 
       
    90      * From base class MVPbkContactFindObserver
       
    91      * Called in case the find fails for some reason. The find operation
       
    92      * can be destroyed at the end of this callback.
       
    93      * 
       
    94      * @Since S60 v3.1
       
    95      * @param aError One of the system wide error codes.
       
    96      *        KErrNotReady if store is not ready (not open or unavailable).
       
    97      */
       
    98     void FindFailed( TInt aError );
       
    99 
       
   100 private: // data
       
   101 
       
   102     /**
       
   103      * Voip contact finder.
       
   104      * Not own.
       
   105      */
       
   106     MPhCntVoipContactFinder& iVoipContactFinder;
       
   107     
       
   108     /**
       
   109      * Find operation.
       
   110      * Own.
       
   111      */
       
   112     MVPbkContactOperationBase* iFindOperation;
       
   113     
       
   114     /**
       
   115      * Observer of the operation.
       
   116      * Not own.
       
   117      */
       
   118     MVPbkContactFindObserver& iObserver;
       
   119 
       
   120     };
       
   121 #endif // CPHCNTVOIPCONTACTMATCHSTRATEGY