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