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