sl@0: // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #ifndef __LOGCNTMODEL_H__ sl@0: #define __LOGCNTMODEL_H__ sl@0: sl@0: #include sl@0: #include "logcntdef.h" sl@0: #include sl@0: sl@0: /** Provides an interface to decouple the internal static dependency of LogEng on sl@0: Contacts. sl@0: sl@0: Rather than statically linking against a specific contacts implementation dll sl@0: the log engine dynamically loads a plugin implementation of this class, to remove any need for sl@0: a direct dependency on a specific Contacts implementation. sl@0: sl@0: The interface is provided to allow logeng to retrieve a string which contains contacts information sl@0: for a given phone number. sl@0: sl@0: @internalAll */ sl@0: class MLogCntModel sl@0: { sl@0: public: sl@0: /** Opens the contacts DB. sl@0: @capability ReadUserData WriteUserData */ sl@0: virtual void OpenContactsL()=0; sl@0: sl@0: /** Closes the contacts DB. sl@0: @capability None */ sl@0: virtual void CloseContacts()=0; sl@0: sl@0: /** Attempts to find a contact item ID for the contact items which contains sl@0: the specified telephone number in a telephone, fax or SMS type field. sl@0: If more than one contact item contains the telephone number this should be sl@0: treated the same as no contact found. sl@0: sl@0: @capability ReadUserData sl@0: @param aNumber Phone number string sl@0: @param aMatchLengthFromRight Number of digits from the right of the phone number to use sl@0: @return DB Id of the DB entry corresponding to the phone number, KLogNullContactId if none or more than one found */ sl@0: virtual TLogContactItemId MatchPhoneNumberL(const TDesC& aNumber, TInt aMatchLengthFromRight)=0; sl@0: sl@0: /** Gets the text data for the family and given name fields of a given contact Id. sl@0: sl@0: @capability ReadUserData sl@0: @param aContactId Contact Id to find data for sl@0: @param aName On return contains a string holding the family and given name in the desired format if found, a 0 length string otherwise. sl@0: The buffer for aName is supplied by the client and should be of a length sufficent to hold a standard contact string. sl@0: @param aNameFormat Desired format of returned string - Chinese or Western format */ sl@0: virtual void ReadContactNameL(TLogContactItemId aContactId, TDes& aName, TLogContactNameFormat aNameFormat)=0; sl@0: }; sl@0: sl@0: /** Interface UID to be used by all contacts model plugin's for log engine sl@0: @internalAll */ sl@0: #ifdef SYSLIBS_TEST sl@0: const TUid KUidEComLogCntInterface = {0x20008030}; sl@0: #else sl@0: const TUid KUidEComLogCntInterface = {0x20008029}; sl@0: #endif sl@0: /** Provides an interface for ECom plugins sl@0: @internalAll */ sl@0: class CLogCntModel: public CBase, public MLogCntModel sl@0: { sl@0: public: sl@0: IMPORT_C static CLogCntModel* NewL(); sl@0: IMPORT_C virtual ~CLogCntModel(); sl@0: private: sl@0: TUid iDtor_ID_Key; sl@0: }; sl@0: sl@0: #endif // __LOGCNTMODEL_H__ sl@0: