phoneengine/contacthandling2/inc/cpecontactmatch.h
branchRCL_3
changeset 61 41a7f70b3818
equal deleted inserted replaced
58:40a3f856b14d 61:41a7f70b3818
       
     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:  Contact match class
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPECONTACTMATCH_H
       
    19 #define CPECONTACTMATCH_H
       
    20 
       
    21 // INCLUDES
       
    22 #include <cntdef.h>
       
    23 #include <e32base.h>
       
    24 #include <pevirtualengine.h>
       
    25 
       
    26 // CONSTANTS
       
    27 // Number of languages that use lastname-firstname order
       
    28 const TInt KPENumberOfSwappedLanguages = 7;
       
    29 
       
    30 // Languages which use lastname-firstname order
       
    31 const TLanguage KPESwappedLanguages[ KPENumberOfSwappedLanguages ] = 
       
    32     {
       
    33     ELangHungarian,       // 17
       
    34     ELangTaiwanChinese,   // 29
       
    35     ELangHongKongChinese, // 30
       
    36     ELangPrcChinese,      // 31
       
    37     ELangJapanese,        // 32
       
    38     ELangKorean,          // 65
       
    39     ELangVietnamese       // 96
       
    40     };
       
    41 
       
    42 // FORWARD DECLARATIONS
       
    43 class CPEContactHandling;
       
    44 class CPhCntContactId;
       
    45 class CPhCntFactory;
       
    46 class MPEDataStore;
       
    47 class MPhCntMatch;
       
    48 class CPhCntMatcher;
       
    49 class MPESimContactMatch;
       
    50 
       
    51 // CLASS DECLARATION
       
    52 
       
    53 /**
       
    54 *  Container for all Contact Handling owned instances of Phone Contact Finder
       
    55 */
       
    56 class CPEContactMatch
       
    57     : public CBase
       
    58     {
       
    59     public:  // Constructors and destructor      
       
    60 
       
    61         /**
       
    62         * Two-phased constructor.
       
    63         * @param aOwner, handle to contact handling interface / owner of this class
       
    64         * @param aDataStore, handle to internal engine info interface
       
    65         * @return an instance of class CPEContactMatch
       
    66         */
       
    67         IMPORT_C static CPEContactMatch* NewL(
       
    68             CPEContactHandling& aOwner,
       
    69             MPEDataStore& aDataStore );
       
    70         
       
    71         /**
       
    72         * Destructor.
       
    73         */
       
    74         ~CPEContactMatch();
       
    75 
       
    76     public: // New functions
       
    77 
       
    78         /**
       
    79         * Synchronous method for finding contact data specified with aContactId
       
    80         * @param aCallId, the call this contact is associated with
       
    81         * @return None
       
    82         */
       
    83         void MatchWithContactIdL( const TInt aCallId ); 
       
    84 
       
    85         /**
       
    86         * Search contact information synchronously matching with aPhoneNumber
       
    87         * @param aCallId, the call this contact is associated with
       
    88         * @return None (leaves with KErrNotFound if no match found or db in use)
       
    89         */
       
    90         void MatchWithNumberL( const TInt aCallId );
       
    91 
       
    92         /**
       
    93         * Returns contact picture data and call id association
       
    94         * NOTE! Ownership of the picture is transfered to caller.
       
    95         * @return contact thumbnail, equals NULL if not found
       
    96         */
       
    97         CFbsBitmap* ContactThumbnail();
       
    98 
       
    99     private:
       
   100 
       
   101         /**
       
   102         * C++ constructor.
       
   103         */
       
   104         CPEContactMatch(
       
   105             CPEContactHandling& aOwner,
       
   106             MPEDataStore& aDataStore );
       
   107         
       
   108         /**
       
   109         * Symbian OS constructor.
       
   110         */
       
   111         void ConstructL();
       
   112 
       
   113         /**
       
   114         * Copies contact information to remote info struct
       
   115         * @param aMatch a contact item 
       
   116         * @param aCallId, the call this contact is associated with
       
   117         */
       
   118         void CopyContactFieldsDataL(
       
   119             const MPhCntMatch& aMatch,
       
   120             const TInt aCallId );
       
   121 
       
   122 
       
   123         /**
       
   124          * Creates contact id.
       
   125          */
       
   126         CPhCntContactId* CreateContactIdL( const TDesC8& aContactId );
       
   127 
       
   128         /**
       
   129          * Creates contact id.
       
   130          */
       
   131         CPhCntContactId* CreateContactIdL( TContactItemId aContactId );
       
   132 
       
   133         /**
       
   134         * Starts loading thumbnail image
       
   135         * @param aContactId contact item with the desired thumbnail
       
   136         * @param aCallId call id for identifying which thumbnail is loaded
       
   137         * @return Symbian OS error code
       
   138         */
       
   139         TInt LoadThumbnail( const CPhCntContactId& aContactId, const TInt aCallId );
       
   140 
       
   141   
       
   142 
       
   143     private:    // Data
       
   144 
       
   145         // Handle to contact handling interface / owner of this class
       
   146         CPEContactHandling& iOwner;
       
   147 
       
   148         // Handle to internal engine info interface
       
   149         MPEDataStore& iDataStore;
       
   150 
       
   151         // Owned: library
       
   152         RLibrary iLibrary;
       
   153 
       
   154         // Owned: contact factory
       
   155         CPhCntFactory* iContactFactory;
       
   156 
       
   157         // Owned: contact matcher
       
   158         CPhCntMatcher* iContactMatcher;
       
   159 
       
   160         // Owned: sim contact matcher
       
   161         MPESimContactMatch* iSimContactMatcher;
       
   162 
       
   163 
       
   164     };
       
   165 
       
   166 #endif // CPECONTACTMATCH_H
       
   167 
       
   168 // End of File