phoneengine/PhoneCntFinder/ContactService/inc/cphcntmatchervoipimpl.h
changeset 0 5f000ab63145
child 57 94dc1107e8b2
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     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:  Implements VoIP specific matching methods.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPHCNTMATCHERVOIPIMPL_H
       
    20 #define CPHCNTMATCHERVOIPIMPL_H
       
    21 
       
    22 #include "CPhCntMatcherImpl.h"
       
    23 
       
    24 class CPhCntVoipContactMatchStrategy;
       
    25 class CPhCntStoreLoaderImpl;
       
    26 
       
    27 /**
       
    28  *  Implements VoIP specific matching methods.
       
    29  *
       
    30  *  @lib PhoneCntFinder.lib
       
    31  *  @since S60 v3.2
       
    32  */
       
    33 NONSHARABLE_CLASS( CPhCntMatcherVoIPImpl ) : public CPhCntMatcherImpl
       
    34     {
       
    35 public:
       
    36     static CPhCntMatcherVoIPImpl* NewL( const MPhoneCntPbkOwner& aOwner );
       
    37 
       
    38     virtual ~CPhCntMatcherVoIPImpl();
       
    39     
       
    40 // From base class CPhCntMatcher
       
    41 
       
    42     /**
       
    43      * From CPhCntMatcher
       
    44      * Match number to phonebook.
       
    45      * @since S60 v3.2
       
    46      * @param aMatch Found match, owership tranferred. NULL if not found any.
       
    47      * @param aNumber Number to match against.
       
    48      * @param aAllowUserNameMatch If true user name match is allowed.
       
    49      * @param aCharsForMatching Characters for user name match. Match is started from
       
    50      *                          the rigth of the user name part. (see CS call match)
       
    51      * @return Error code: KErrNone - one match found
       
    52      *                     KErrNotFound - no matches found
       
    53      *                     other - normal Symbian OS error
       
    54      */    
       
    55     TInt MatchVoipNumber(
       
    56         MPhCntMatch*& aMatch,
       
    57         const TDesC& aNumber,
       
    58         TBool aAllowUserNameMatch,
       
    59         MDesCArray* aContactStoreUris,
       
    60         TInt aCharsForMatching = 0 );
       
    61         
       
    62     /**
       
    63      * From CPhCntMatcher
       
    64      * From CPhCntMatcher, gets VoIP call contact info from phonebook
       
    65      * by contact id.
       
    66      * @since Series60 3.2
       
    67      * @param aMatch for found match, owership tranferred. Empty if not found.
       
    68      * @param aContactId for current contact.
       
    69      * @return Error code: KErrNone - VoIP call contact found
       
    70      *                     KErrNotFound - no VoIP call contact found
       
    71      *                     other - normal Symbian OS error
       
    72      */
       
    73     TInt MatchVoipNumber(
       
    74         MPhCntMatch*& aMatch,
       
    75         const CPhCntContactId& aContactId );
       
    76 
       
    77     
       
    78     /**
       
    79      * From CPhCntMatcher
       
    80      * From CPhCntMatcher
       
    81      * Determines if contact has other type of numbers than
       
    82      * voip numbers.
       
    83      * 
       
    84      * @since S60 v3.2.
       
    85      * @param aContactId Id of the contact.
       
    86      * @return ETrue - CS numbers found from contact.
       
    87      *         EFalse - No CS numbers found from contact.
       
    88      */
       
    89     TBool HasCSNumbers( 
       
    90         const CPhCntContactId& aContactId );
       
    91 
       
    92 private:
       
    93     
       
    94     CPhCntMatcherVoIPImpl( const MPhoneCntPbkOwner& aOwner );
       
    95     
       
    96     void ConstructL();
       
    97     
       
    98     /**
       
    99      * Determines if contact has other numbers than VoIP numbers.
       
   100      * 
       
   101      * @since S60 v3.2
       
   102      */
       
   103     TBool HasCSNumbers( 
       
   104         const CPhCntContact* const aContact );
       
   105 
       
   106     /**
       
   107      * From CPhCntMatcher. Used for delayed construction.
       
   108      * 
       
   109      * @since S60 v3.2
       
   110      */
       
   111     TInt CreateMatcher();
       
   112 
       
   113 private: // data
       
   114 
       
   115       
       
   116     /**
       
   117      * Match strategy used for Voip calls.
       
   118      * Own.
       
   119      */
       
   120     CPhCntVoipContactMatchStrategy* iVoipMatchStrategy;
       
   121 
       
   122     /**
       
   123      * Used for loading service specific contact stores 
       
   124     */
       
   125     CPhCntStoreLoaderImpl* iContactStoreLoader;
       
   126     
       
   127     };
       
   128 
       
   129 #endif // CPHCNTMATCHERVOIPIMPL_H