os/persistentdata/loggingservices/eventlogger/logcntmodel/inc/logcntmodel.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/loggingservices/eventlogger/logcntmodel/inc/logcntmodel.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,85 @@
     1.4 +// Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#ifndef __LOGCNTMODEL_H__
    1.20 +#define __LOGCNTMODEL_H__
    1.21 +
    1.22 +#include <ecom/ecom.h>
    1.23 +#include "logcntdef.h"
    1.24 +#include <logwrap.h>
    1.25 +
    1.26 +/** Provides an interface to decouple the internal static dependency of LogEng on 
    1.27 +Contacts.
    1.28 + 
    1.29 +Rather than statically linking against a specific contacts implementation dll
    1.30 +the log engine dynamically loads a plugin implementation of this class, to remove any need for 
    1.31 +a direct dependency on a specific Contacts implementation.
    1.32 +
    1.33 +The interface is provided to allow logeng to retrieve a string which contains contacts information 
    1.34 +for a given phone number.
    1.35 + 
    1.36 +@internalAll */
    1.37 +class MLogCntModel
    1.38 +	{
    1.39 +public:
    1.40 +	/** Opens the contacts DB.	
    1.41 +	@capability ReadUserData WriteUserData */
    1.42 +	virtual void OpenContactsL()=0;
    1.43 +	
    1.44 +	/** Closes the contacts DB. 
    1.45 +	@capability None */
    1.46 +	virtual	void CloseContacts()=0;
    1.47 +	
    1.48 +	/** Attempts to find a contact item ID for the contact items which contains
    1.49 +	the specified telephone number in a telephone, fax or SMS type field.
    1.50 +	If more than one contact item contains the telephone number this should be 
    1.51 +	treated the same as no contact found.
    1.52 +	
    1.53 +	@capability ReadUserData
    1.54 +	@param aNumber Phone number string
    1.55 +	@param aMatchLengthFromRight Number of digits from the right of the phone number to use
    1.56 +	@return DB Id of the DB entry corresponding to the phone number, KLogNullContactId if none or more than one found */
    1.57 +	virtual TLogContactItemId MatchPhoneNumberL(const TDesC& aNumber, TInt aMatchLengthFromRight)=0;
    1.58 +	
    1.59 +	/** Gets the text data for the family and given name fields of a given contact Id.
    1.60 +	
    1.61 +	@capability ReadUserData
    1.62 +	@param aContactId Contact Id to find data for
    1.63 +	@param aName On return contains a string holding the family and given name in the desired format if found, a 0 length string otherwise. 
    1.64 +	The buffer for aName is supplied by the client and should be of a length sufficent to hold a standard contact string.
    1.65 +	@param aNameFormat Desired format of returned string - Chinese or Western format */
    1.66 +	virtual void ReadContactNameL(TLogContactItemId aContactId, TDes& aName, TLogContactNameFormat aNameFormat)=0;	
    1.67 +	};
    1.68 +
    1.69 +/** Interface UID to be used by all contacts model plugin's for log engine
    1.70 +@internalAll */
    1.71 +#ifdef SYSLIBS_TEST 
    1.72 +    const TUid  KUidEComLogCntInterface = {0x20008030};
    1.73 +#else
    1.74 +    const TUid  KUidEComLogCntInterface = {0x20008029};
    1.75 +#endif
    1.76 +/** Provides an interface for ECom plugins
    1.77 +@internalAll */
    1.78 +class CLogCntModel: public CBase, public MLogCntModel
    1.79 +	{
    1.80 +public:
    1.81 +	IMPORT_C static CLogCntModel* NewL();
    1.82 +	IMPORT_C virtual ~CLogCntModel();
    1.83 +private:
    1.84 +	TUid iDtor_ID_Key;
    1.85 +	};
    1.86 +	
    1.87 +#endif		// __LOGCNTMODEL_H__
    1.88 +