phoneengine/phonecntfinder2/inc/cphcntmatcher.h
changeset 36 2eacb6118286
parent 30 ebdbd102c78a
child 37 ba76fc04e6c2
equal deleted inserted replaced
30:ebdbd102c78a 36:2eacb6118286
     1 /*
       
     2 * Copyright (c) 2009 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPHCNTMATCHER_H
       
    19 #define CPHCNTMATCHER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <cntdef.h>     // TContactItemId
       
    24 #include <badesca.h>
       
    25 
       
    26 #include "mphcntmatch.h"
       
    27 
       
    28 // CONSTANTS
       
    29 const TInt KPhCntInvalidFieldId = KErrNotFound;
       
    30 
       
    31 // DATA TYPES
       
    32 typedef TInt TFieldId;
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 
       
    36 class MVPbkContactLink;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41 *  Abstract class for making matches.
       
    42 *
       
    43 *  @lib PhoneCntFinder
       
    44 *  @since 1.0
       
    45 */
       
    46 class CPhCntMatcher 
       
    47     : public CBase
       
    48     {
       
    49     public:  // Constructors and destructor  
       
    50 
       
    51         /**
       
    52         * Match number to phonebook.
       
    53         * @param aMatch Found match, owership tranferred. NULL if not found any.
       
    54         * @param aTelNumber Number to match against.
       
    55         * @return Error code: KErrNone - one match found
       
    56         *                     KErrNotFound - no matches found
       
    57         *                     KErrAlreadyExists - several matches -> no match
       
    58         *                     KErrUnderflow - Number too short for matching
       
    59         *                     KErrAccessDenied - Can't get phonebook instance
       
    60         *                     other - normal Symbian OS error
       
    61         */
       
    62         virtual TInt MatchNumber( 
       
    63             MPhCntMatch*& aMatch, 
       
    64             const TDesC& aTelNumber ) = 0;
       
    65 
       
    66         /**
       
    67         * Match number to phonebook.
       
    68         * @param aMatch Found match, owership tranferred. NULL if not found any.
       
    69         * @param aTelNumber Number to match against.
       
    70         * @param aContactId Current contact.
       
    71         * @return Error code: KErrNone - one match found
       
    72         *                     KErrNotFound - no matches found
       
    73         *                     KErrAlreadyExists - several matches -> no match
       
    74         *                     KErrUnderflow - Number too short for matching
       
    75         *                     KErrAccessDenied - Can't get phonebook instance
       
    76         *                     other - normal Symbian OS error
       
    77         */
       
    78         virtual TInt MatchNumber(
       
    79             MPhCntMatch*& aMatch,
       
    80             const TDesC& aTelNumber,
       
    81             const CPhCntContactId& aContactLink ) = 0;
       
    82 
       
    83 
       
    84         /**
       
    85         * Match number to phonebook.
       
    86         * @param aMatch Found match, owership tranferred. NULL if not found any.
       
    87         * @param aNumber Number to match against.
       
    88         * @param aAllowUsernameMatch 
       
    89         *                        is ETrue if username is sufficient for match.
       
    90         * @param aCharsForMatching Length of string to be used in matching.
       
    91         *                       Starts from the end of VoIP number. Domain part
       
    92         *                       not included for matching.
       
    93         * @return Error code: KErrNone - one match found
       
    94         *                     KErrNotFound - no matches found
       
    95         *                     other - normal Symbian OS error
       
    96         */    
       
    97         virtual TInt MatchVoipNumber(
       
    98             MPhCntMatch*& aMatch,
       
    99             const TDesC& aNumber,
       
   100             const TBool aAllowUsernameMatch,
       
   101             TInt aCharsForMatching = 0 ) = 0;
       
   102         
       
   103          /**
       
   104         * Gets VoIP call contact info from phonebook
       
   105         * by contact id.
       
   106         * @since Series60 3.0
       
   107         * @param aMatch for found match, owership tranferred. Empty if not found.
       
   108         * @param aContactId for current contact.
       
   109         * @return Error code: KErrNone - VoIP call contact found
       
   110         *                     KErrNotFound - no VoIP call contact found
       
   111         *                     other - normal Symbian OS error
       
   112         */    
       
   113         virtual TInt MatchVoipNumber(
       
   114             MPhCntMatch*& aMatch,
       
   115             const CPhCntContactId& aContactId ) = 0;
       
   116             
       
   117         /**
       
   118          * Determines if contact has other type of numbers
       
   119          * than VoIP numbers.
       
   120          * 
       
   121          * @since S60 v3.2.
       
   122          * @param aContactId Id of the contact.
       
   123          * @return ETrue - CS numbers found from contact.
       
   124          *         EFalse - No CS numbers found from contact.
       
   125          */
       
   126         virtual TBool HasCSNumbers( 
       
   127             const CPhCntContactId& aContactId ) = 0;
       
   128             
       
   129         
       
   130         /**
       
   131         * Match number to phonebook.
       
   132         * @param aMatch Found match, owership tranferred. NULL if not found any.
       
   133         * @param aTelNumber Number to match against.
       
   134         * @param aContactId  a contact id (unigue UID)
       
   135         * @return Error code: KErrNone - one match found
       
   136         *                     KErrNotFound - no matches found
       
   137         *                     KErrAlreadyExists - several matches -> no match
       
   138         *                     KErrUnderflow - Number too short for matching
       
   139         *                     KErrAccessDenied - Can't get phonebook instance
       
   140         *                     other - normal Symbian OS error
       
   141         */
       
   142         virtual TInt MatchNumber( 
       
   143             MPhCntMatch*& aMatch, 
       
   144             const TDesC& aTelNumber,
       
   145             TInt aContactId ) = 0;
       
   146 
       
   147     };
       
   148 
       
   149 #endif      // CPHCNTMATCHER_H  
       
   150             
       
   151 // End of File