phoneengine/PhoneCntFinder/ContactService/inc/cphcntmatchervoipimpl.h
branchRCL_3
changeset 62 5266b1f337bd
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:  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 aMatchString 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& aMatchString,
       
    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 aMatchString Number to match against.
       
    69      * @param aContactId for current contact.
       
    70      * @return Error code: KErrNone - VoIP call contact found
       
    71      *                     KErrNotFound - no VoIP call contact found
       
    72      *                     other - normal Symbian OS error
       
    73      */
       
    74     TInt MatchVoipNumber(
       
    75         MPhCntMatch*& aMatch,
       
    76         const TDesC& aMatchString,
       
    77         const CPhCntContactId& aContactId );
       
    78 
       
    79     
       
    80     /**
       
    81      * From CPhCntMatcher
       
    82      * From CPhCntMatcher
       
    83      * Determines if contact has other type of numbers than
       
    84      * voip numbers.
       
    85      * 
       
    86      * @since S60 v3.2.
       
    87      * @param aContactId Id of the contact.
       
    88      * @return ETrue - CS numbers found from contact.
       
    89      *         EFalse - No CS numbers found from contact.
       
    90      */
       
    91     TBool HasCSNumbers( 
       
    92         const CPhCntContactId& aContactId );
       
    93 
       
    94 private:
       
    95     
       
    96     CPhCntMatcherVoIPImpl( const MPhoneCntPbkOwner& aOwner );
       
    97     
       
    98     void ConstructL();
       
    99     
       
   100     /**
       
   101      * Determines if contact has other numbers than VoIP numbers.
       
   102      * 
       
   103      * @since S60 v3.2
       
   104      */
       
   105     TBool HasCSNumbers( 
       
   106         const CPhCntContact* const aContact );
       
   107 
       
   108     /**
       
   109      * From CPhCntMatcher. Used for delayed construction.
       
   110      * 
       
   111      * @since S60 v3.2
       
   112      */
       
   113     TInt CreateMatcher();
       
   114 
       
   115     /**
       
   116      * Sets matched VoIP number if it was found.
       
   117      *
       
   118      * @param aContact Contact, which is checked.
       
   119      * @param aMatchString Number to match against.
       
   120      */
       
   121     void SetMatchedVoIPNumberIfExists( 
       
   122         CPhCntContact& aContact,
       
   123         const TDesC& aMatchString );
       
   124     
       
   125 private: // data
       
   126 
       
   127       
       
   128     /**
       
   129      * Match strategy used for Voip calls.
       
   130      * Own.
       
   131      */
       
   132     CPhCntVoipContactMatchStrategy* iVoipMatchStrategy;
       
   133 
       
   134     /**
       
   135      * Used for loading service specific contact stores 
       
   136     */
       
   137     CPhCntStoreLoaderImpl* iContactStoreLoader;
       
   138     
       
   139     };
       
   140 
       
   141 #endif // CPHCNTMATCHERVOIPIMPL_H