os/persistentdata/loggingservices/eventlogger/logcntmodel/inc/logcntmodel.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 //
    15 
    16 #ifndef __LOGCNTMODEL_H__
    17 #define __LOGCNTMODEL_H__
    18 
    19 #include <ecom/ecom.h>
    20 #include "logcntdef.h"
    21 #include <logwrap.h>
    22 
    23 /** Provides an interface to decouple the internal static dependency of LogEng on 
    24 Contacts.
    25  
    26 Rather than statically linking against a specific contacts implementation dll
    27 the log engine dynamically loads a plugin implementation of this class, to remove any need for 
    28 a direct dependency on a specific Contacts implementation.
    29 
    30 The interface is provided to allow logeng to retrieve a string which contains contacts information 
    31 for a given phone number.
    32  
    33 @internalAll */
    34 class MLogCntModel
    35 	{
    36 public:
    37 	/** Opens the contacts DB.	
    38 	@capability ReadUserData WriteUserData */
    39 	virtual void OpenContactsL()=0;
    40 	
    41 	/** Closes the contacts DB. 
    42 	@capability None */
    43 	virtual	void CloseContacts()=0;
    44 	
    45 	/** Attempts to find a contact item ID for the contact items which contains
    46 	the specified telephone number in a telephone, fax or SMS type field.
    47 	If more than one contact item contains the telephone number this should be 
    48 	treated the same as no contact found.
    49 	
    50 	@capability ReadUserData
    51 	@param aNumber Phone number string
    52 	@param aMatchLengthFromRight Number of digits from the right of the phone number to use
    53 	@return DB Id of the DB entry corresponding to the phone number, KLogNullContactId if none or more than one found */
    54 	virtual TLogContactItemId MatchPhoneNumberL(const TDesC& aNumber, TInt aMatchLengthFromRight)=0;
    55 	
    56 	/** Gets the text data for the family and given name fields of a given contact Id.
    57 	
    58 	@capability ReadUserData
    59 	@param aContactId Contact Id to find data for
    60 	@param aName On return contains a string holding the family and given name in the desired format if found, a 0 length string otherwise. 
    61 	The buffer for aName is supplied by the client and should be of a length sufficent to hold a standard contact string.
    62 	@param aNameFormat Desired format of returned string - Chinese or Western format */
    63 	virtual void ReadContactNameL(TLogContactItemId aContactId, TDes& aName, TLogContactNameFormat aNameFormat)=0;	
    64 	};
    65 
    66 /** Interface UID to be used by all contacts model plugin's for log engine
    67 @internalAll */
    68 #ifdef SYSLIBS_TEST 
    69     const TUid  KUidEComLogCntInterface = {0x20008030};
    70 #else
    71     const TUid  KUidEComLogCntInterface = {0x20008029};
    72 #endif
    73 /** Provides an interface for ECom plugins
    74 @internalAll */
    75 class CLogCntModel: public CBase, public MLogCntModel
    76 	{
    77 public:
    78 	IMPORT_C static CLogCntModel* NewL();
    79 	IMPORT_C virtual ~CLogCntModel();
    80 private:
    81 	TUid iDtor_ID_Key;
    82 	};
    83 	
    84 #endif		// __LOGCNTMODEL_H__
    85