phoneengine/contacthandling/inc/cpecontacthandling.h
changeset 0 5f000ab63145
equal deleted inserted replaced
-1:000000000000 0:5f000ab63145
       
     1 /*
       
     2 * Copyright (c) 2006-2007 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:  This file contains the header file of the
       
    15 *              : CPEContactHandling class.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef CPECONTACTHANDLING_H
       
    22 #define CPECONTACTHANDLING_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include "mpecontacthandling.h"
       
    26 #include <e32base.h>
       
    27 #include <cntdef.h> // TContactItemId
       
    28 #include <pevirtualengine.h>
       
    29 
       
    30 // CONSTANTS
       
    31 //None
       
    32 
       
    33 // MACROS
       
    34 //None
       
    35 
       
    36 // DATA TYPES
       
    37 //None.
       
    38 
       
    39 // FUNCTION PROTOTYPES
       
    40 //None
       
    41 
       
    42 // FORWARD DECLARATIONS
       
    43 class CContactGroup;
       
    44 class CContactItemFieldDef;
       
    45 class MPEPhoneModelInternal;
       
    46 class CPEContactMatch;
       
    47 
       
    48 // CLASS DECLARATION
       
    49 
       
    50 /**
       
    51 *  Interface class for phone engine to fetch remote info from contact database or SIM
       
    52 *
       
    53 *  @lib ContactHandling.lib
       
    54 *  @since Series60_4.0
       
    55 */
       
    56 class CPEContactHandling
       
    57         : public CBase,
       
    58           public MPEContactHandling
       
    59     {
       
    60     public:  // Constructors and destructor
       
    61       
       
    62         /**
       
    63         * Two-phased constructor.
       
    64         */
       
    65         static CPEContactHandling* NewL( MPEPhoneModelInternal& aModel, 
       
    66                                               RFs& aFsSession );
       
    67         
       
    68         /**
       
    69         * Destructor.
       
    70         */
       
    71         virtual ~CPEContactHandling();
       
    72 
       
    73     public: // New functions
       
    74         
       
    75         /**
       
    76         * Synchronous method for searching contact information. This function call's FindContactInfoSyncL()
       
    77         * which can leave. This function call is Trapped so API function does not leave.
       
    78         * @param aCallId        call id from phone engine
       
    79         * @param aFindKey       defines the key to search the contact data with
       
    80         * @return Error code indicating the success of the search
       
    81         */
       
    82         TInt FindContactInfoSync( 
       
    83             const TInt aCallId,
       
    84             const TPEFindContactKey aFindKey );
       
    85 
       
    86         /**
       
    87         * Reroutes errorCodes to the Phone Model
       
    88         * @param aErrorCode is the errorCode
       
    89         * @return None.
       
    90         */
       
    91         void SendErrorMessage( TInt aErrorCode );
       
    92 
       
    93         /**
       
    94         * Reroutes messages to the Phone Model
       
    95         * @param aMessage is the message id
       
    96         * @param aCallId identifies the call this event is associated to
       
    97         */
       
    98         void SendMessage( MEngineMonitor::TPEMessagesFromPhoneEngine aMessage, 
       
    99                           const TInt aCallId = KPECallIdNotUsed );
       
   100         
       
   101         /**
       
   102         * Fetch number from speed dial location
       
   103         * @param aLocationIndex Index to look for
       
   104         * @param aNumber Filled with speed dial location phone number
       
   105         * @return Error code.
       
   106         */
       
   107         TInt GetSpeedDialLocation( 
       
   108             TInt aLocationIndex, 
       
   109             TPEPhoneNumber& aNumber );
       
   110 
       
   111    protected:  // New functions
       
   112         
       
   113         /**
       
   114         * C++ default constructor.
       
   115         */
       
   116         CPEContactHandling( MPEPhoneModelInternal& aModel, 
       
   117                         RFs& aFsSession );
       
   118 
       
   119     private:
       
   120 
       
   121         /**
       
   122         * By default Symbian 2nd phase constructor is private.
       
   123         */
       
   124         void ConstructL();
       
   125 
       
   126 
       
   127         /**
       
   128         * Synchronous method for searching contact information
       
   129         * @param aCallId        call id from phone engine
       
   130         * @param aFindKey       defines the key to search the contact data with
       
   131         */
       
   132 
       
   133         void FindContactInfoSyncL(
       
   134             const TInt aCallId, 
       
   135             const TPEFindContactKey aFindKey );
       
   136 
       
   137         /**
       
   138         * Synchronous method for searching contact information from Contactdb
       
   139         * @param aFindKey       defines the key to search the contact data with
       
   140         * @return None
       
   141         */
       
   142         void FindContactInfoSyncFromContactDbL(
       
   143             const TInt aCallId, 
       
   144             const TPEFindContactKey aFindKey ) const;
       
   145 
       
   146     private:    // Data
       
   147         // Reference to MPEPhoneModelInternal , also object owner
       
   148         MPEPhoneModelInternal&          iModel;
       
   149         // ContactMatcher
       
   150         CPEContactMatch*                iContactMatcher;
       
   151         // handle to a file server session
       
   152         RFs& iFsSession;
       
   153         
       
   154     };
       
   155 
       
   156 #endif      // CPECONTACTHANDLING_H
       
   157             
       
   158 // End of File