summaryrefslogtreecommitdiffstats
path: root/plugins/contacts/symbian/contactsmodel/inc/cntitem.h
blob: 68491d86c423073a7072e7c9183fbf1779f9ed28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
/*
* Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
* Contact: http://www.qt-project.org/legal
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: 
* Persistence layer exports
*
*/


#if !defined(__CNTITEM_H__)
#define __CNTITEM_H__

#if !defined(__E32BASE_H__)
#include <e32base.h>
#endif

#if !defined(__CNTDEF_H__)
#include <cntdef.h>
#endif

#if !defined(__CNTFIELD_H__)
#include <cntfield.h>
#endif

#include <cntdb.h>

/** Maximum length of UID string.
@publishedAll
@released
*/
const TInt KUidStringLength =244;

/** UID string separator character
@publishedAll
@released
*/
#define KUidStringSeparator '-'

#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
/** Constant used by vCard import/export.
@internalComponent
*/
#define KContactMaxFieldNumber 32
#endif

class CContactItemField;
class CContactItemViewDef;
class CContactItem;

/** Constant to indicate that all fields in the fieldset should be searched.
@publishedAll
@released
*/
const TInt KContactFieldSetSearchAll=-1;

class CContactItemFieldSet : public CBase
/** A contact item's field set. The field set owns an array of contact item fields
(CContactItemFields). The field set is owned by a contact item, and can be
retrieved using CContactItem::CardFields(). Use functions in class
CContactItem to add and remove fields to/from the field set.

A field set can contain more than one field of the same type, but this is
not advisable as it may cause problems when synchronising the contacts database.
@publishedAll
@released
*/
	{
	friend class CContactItemField;
	friend class CContactDatabase;
	friend class CContactTables;
	friend class RPplContactTable;
    friend class TCntPersistenceUtility;

public:
	IMPORT_C static CContactItemFieldSet* NewL();
	IMPORT_C static CContactItemFieldSet* NewLC();
	IMPORT_C ~CContactItemFieldSet();
	inline const CContactItemField& operator[](TInt aIndex) const;
	inline CContactItemField& operator[](TInt aIndex);
	inline TInt Find(TFieldType aFieldType) const; // will only find the first such occurence
	inline TInt Find(TFieldType aFieldType,TUid aMapping) const;
	IMPORT_C TInt FindNext(TFieldType aFieldType,TInt aStartPos=KContactFieldSetSearchAll) const;
	IMPORT_C TInt FindNext(TFieldType aFieldType,TUid aMapping,TInt aStartPos=KContactFieldSetSearchAll) const;
	inline TInt Count() const;
	inline void Reset();
	IMPORT_C void UpdateFieldL(const CContactItemField& aField, TInt aMatchCount);
	IMPORT_C void UpdateFieldSyncL(const CContactItemField& aField, TInt aMatchCount);
	IMPORT_C CContactItemFieldSet& AddL(CContactItemField& aField);
	IMPORT_C void Remove(TInt aIndex);
	IMPORT_C void InsertL(TInt aIndex,CContactItemField& aField);
	IMPORT_C void Move(TInt aFrom, TInt aTo);
	IMPORT_C TStreamId StoreL(CStreamStore& aStore,RWriteStream& aTextStream,CStreamStore& aBlobStore);
	TStreamId StoreL(CStreamStore& aStore,RWriteStream& aTextStream,CStreamStore& aBlobStore,CContactTables* aTables);
	IMPORT_C void RestoreL(CStreamStore& aStore, TStreamId anId,CStreamStore* aBlobStore,const CContactItemViewDef& aViewDef,RReadStream& aReadStream);
	IMPORT_C void RestoreL(CStreamStore& aStore, TStreamId anId,CStreamStore* aBlobStore,const CContactItemViewDef& aViewDef,const CContactItem* aTemplate, HBufC* aTextBuf);
	TInt FieldText(TFieldType aFieldType, TDes &aText, TInt aStartPosition) const;
	CArrayFix<TFieldHeader>* ConstructFieldHeaderArrayLC(RWriteStream& aTextStream, CStreamStore& aBlobStore);
	TInt FieldTypeCount(const CContactItemFieldSet& aSystemTemplateFields, TInt aStartIndex, const CContactItemField& aField) const;
	TBool ContainsFieldTypeMapping(const CContentType& aBaseFieldContentType, const TFieldType& aContactFieldType) const;
	void ExternalizeL(RWriteStream& aStream) const;
	void InternalizeL(RReadStream& aStream);

private:
	CContactItemFieldSet();
	void ConstructL();
	void SetFieldId(CContactItemField& aField);
	const CContactItemField* FindById(TInt aId) const;
	IMPORT_C TStreamId StoreL(CStreamStore& aStore,const CContactItem* aTemplate,RWriteStream& aStream,CStreamStore& aBlobStore,CContactTables* aTables);
	void RestoreL(CStreamStore& aStore, TStreamId anId, CStreamStore* aBlobStore,const CContactItemViewDef& aViewDef,const CContactItem* aTemplate,RReadStream& aReadStream,CContactTables* aContactsTable, RArray<TInt>* aEmailIdArray);
	void RestoreAndAddTemplateL(CStreamStore& aStore, TStreamId aId,CStreamStore* aBlobStore,const CContactItemViewDef& aViewDef,const CContactItem* aTemplate, RReadStream& aReadStream,CContactTables* aContactsTable,RArray<TInt>* aEmailIdArray);
	TInt MatchTemplateField(const CContentType& aContentType,TUint aUserFlags,TBool &aExactMatch) const;
	static HBufC* LoadTextStreamLC(RReadStream& aStream);
	void NonZeroFieldText(TFieldType aFieldType, TDes &aText) const;

private:
	CArrayPtr<CContactItemField>* iFields;
	};

class CContactDatabase;
class RCntModel;
class CContactItem : public CBase
/** The abstract base class for contact cards, templates and groups. All contact
items are identified by a contact ID, (TContactItemId), have a last modified
date/time and own one or more fields (the field set). Contact items also
have an access count and attributes (e.g. hidden). Note that fields in a contact
item also have attributes. Attribute values specified in the contact item
override those in the contained fields. The access count is a record of the
number of objects referencing a contact item. A contact item cannot be fully
deleted until its access count is zero.
@publishedAll
@released
*/
	{
	friend class CContactCardTemplate;
	friend class CContactItemPlusGroup;
	friend class CContactCard;
	friend class CContactTemplate;
	friend class CContactGroup;
	friend class CContactOwnCard;
	friend class CVCardToContactsAppConverter;
	friend class CContactICCEntry;
	friend class RPplContactTable;
	friend class RPplIdentityTable;
	friend class RPplPreferencesTable;
	friend class CPackagerTests; //Comparison test
	friend class CPackagerCntComparator;
	friend class CContactDatabase;
	friend class CPplContactItemManager;
public:
	IMPORT_C ~CContactItem();
	/** Gets the contact item's type.

	@return The contact item's type. */
	virtual TUid Type() const=0;
	static CContactItem* NewLC(RReadStream& aStream);
	IMPORT_C static CContactItem* NewLC(TUid aType);
	IMPORT_C TContactItemId Id() const;
	IMPORT_C TContactItemId TemplateRefId() const;
	IMPORT_C TTime LastModified() const;
	IMPORT_C void SetLastModified(const TTime& aLastModified);
	IMPORT_C void AddFieldL(CContactItemField& aField);
	IMPORT_C void RemoveField(TInt aFieldPos);
	IMPORT_C void InsertFieldL(CContactItemField& aField,TInt aFieldPos);
	IMPORT_C CContactItemFieldSet& CardFields() const;
	IMPORT_C void SetHidden(TBool aHidden);
	IMPORT_C void SetSystem(TBool aSystem);
	IMPORT_C TBool IsHidden();
	IMPORT_C TBool IsSystem();
	IMPORT_C void UpdateFieldSet(CContactItemFieldSet* aNewFieldSet);
	IMPORT_C void SetDeleted(TBool aDeleted);
	IMPORT_C TBool IsDeleted() const;
	IMPORT_C void SetTemplateRefId(TContactItemId aUid);
	TContactItemId Agent();
	inline TBool IsDeletable();
	inline void IncAccessCount();
	inline void DecAccessCount();
	inline TInt AccessCount() const;
	IMPORT_C void SetUidStringL(TDesC& aString);
	IMPORT_C TPtrC UidStringL(TInt64 aMachineUniqueId) const;
	TStreamId PopulateStoreL(CStreamStore& aStore, CArrayFix<TFieldHeader>& aFieldHeaderArray) const;
	void AddLabelFieldL();
	IMPORT_C void RestoreTemplateFieldsL(const CContactItemFieldSet& aSystemTemplateFields, const CContactItemFieldSet& aTemplateFields, const CContactItemViewDef& aViewDef);
	void ClearFieldContent();
	inline TPtrC Guid();
	virtual void ExternalizeL(RWriteStream& aStream) const;
	virtual void InternalizeL(RReadStream& aStream);

	IMPORT_C void SetId(TContactItemId aId);
	IMPORT_C TUint32 Attributes() const;
	IMPORT_C void SetAttributes(TUint32 aAttributes);
	IMPORT_C void SetAccessCount(TUint32 aAccessCount);
	IMPORT_C void SetCreationDate(const TTime& aTime);

public:
	/** Contact item's attribute flags

	These flags can be used to set the various attributes of a contact item. */
	enum
	{
	/** To set the contact item's system attribute. */
	ESystem=0x01,
	/** To set the contact item's hidden attribute. */
	EHidden=0x02,
	/** To set the contact item's hidden attribute. */
	ECompressedGuid=0x04,
	/** To set the contact item's Is deleted attribute. */
	EDeleted=0x08
	};

private:
	CContactItem();
	void ConstructL();
	void ConstructL(const CContactItem *aTemplate);
	void MakeUidStringL(TInt64 aMachineUniqueId);
	IMPORT_C void SetHasCompressedGuid(TBool aCompressed);
	TBool GuidIsCompressed() const;
	TInt NumberOfFieldsToStore() const;

private:
	CContactItemFieldSet* iFieldSet;
	TUint32 iAttributes;
	TContactItemId iId;
	TContactItemId iTemplateRefId;
	TTime iLastModified;
	TTime iCreationDate;
	TUint32 iAccessCount;
	HBufC* iGuid;
	};

class CContactItemPlusGroup : public CContactItem
/** Abstract base class for CContactGroup, CContactCard and CContactOwnCard.

The purpose of this class is to avoid duplication of group functionality
in its derived classes.
@publishedAll
@released
*/
	{
public:
	IMPORT_C const CContactIdArray* GroupsJoined() const;
	IMPORT_C CContactIdArray* GroupsJoinedLC() const;
protected:
	CContactItemPlusGroup();
	IMPORT_C ~CContactItemPlusGroup();
public:
	virtual void ExternalizeL(RWriteStream& aStream) const;
	virtual void InternalizeL(RReadStream& aStream);

	IMPORT_C void ResetGroups();
	IMPORT_C void SetGroups(CContactIdArray* aGroups);

private:
	CContactIdArray* iGroups;
	friend class CContactDatabase;
	friend class RPplLookupGroupsTable;
	friend class RPplGroupMembershipTable;
	};

class CContactGroup : public CContactItemPlusGroup
/** A contact group.

A contact group is a contact item which holds a set of associated contact
item IDs. The members of the group may be contact cards, own cards, or even
other groups. The group has a label which identifies the group to users, e.g.
"family", or "colleagues". The type of a contact group is KUidContactGroup,
as returned by Type().

Objects of this class are constructed using CContactDatabase::CreateContactGroupL()
or CreateContactGroupLC(). These functions create the group, optionally with
a label, add it to the database, and return a pointer to it.

To create an association between a card and a group, use CContactDatabase::AddContactToGroupL()
and to remove the association, use RemoveContactFromGroupL(). To find out
which groups a card belongs to, use CContactCard::GroupsJoinedLC() or CContactOwnCard::GroupsJoinedLC().

The function CContactDatabase::GetGroupIdListL() may be used to retrieve a
list of IDs for all groups in the database.
@publishedAll
@released
*/
	{
public:
	IMPORT_C static CContactGroup* NewL();
	IMPORT_C static CContactGroup* NewLC();
	IMPORT_C ~CContactGroup();
public: // from CContactItem
	IMPORT_C TUid Type() const;
public:
	// default sorted item array is ascending
	IMPORT_C CContactIdArray* ItemsContainedLC() const;
	IMPORT_C const CContactIdArray* ItemsContained() const;
	IMPORT_C TBool IsSystem() const;
	IMPORT_C void SetSystem(TBool aSystem);
	IMPORT_C TBool ContainsItem(TContactItemId aContactId);
	IMPORT_C void SetGroupLabelL(const TDesC& aLabel);
	IMPORT_C TPtrC GetGroupLabelL();
	IMPORT_C TBool HasItemLabelField();
	IMPORT_C CContactIdArray* GroupsJoinedLC() const;

	IMPORT_C void AddContactL(TContactItemId aContactId);
	IMPORT_C void RemoveContactL(TContactItemId aContactId);
	virtual void ExternalizeL(RWriteStream& aStream) const;
	virtual void InternalizeL(RReadStream& aStream);

	IMPORT_C void ResetItems();
	IMPORT_C void SetItems(CContactIdArray* aItems);

private:
	CContactGroup();

private:
	CContactIdArray* iItems;
	friend class CContactDatabase;
	friend class RPplGroupMembershipTable;
	friend class CLplAnalyserProxy;
	friend class RCntModel;
	
	//list of contacts belonging to a group (updated on open) 
	mutable CContactIdArray* iInitialContactIds;
	
	//contacts added to a group
	mutable CContactIdArray* iAddedContactIds;
	
	//contact removed from a group
    mutable CContactIdArray* iRemovedContactIds;
	};

class CContactCardTemplate : public CContactItem
/** A contact card template.

This is a contact item containing a set of fields on which new contact items can
be based. Templates have a label which is a string which identifies the template
to a user. For instance, 'work template' could indicate a template used
to create contact cards in the style of a work colleague. Contact card templates
have a type of KUidContactCardTemplate, as returned by Type().

Objects of this class cannot be constructed directly because its constructors
are protected. Instead, use either CContactDatabase::CreateContactCardTemplateL()
or CreateContactCardTemplateLC(). These functions create a contact card template,
add it to the database, and return a pointer to it.

The function CContactDatabase::GetCardTemplateIdListL() gets a list of the
IDs of all contact card templates in the database.
@publishedAll
@released
*/
	{
	friend class CContactDatabase;
	friend class CContactTables;
	friend class RPplContactTable;
	friend class CContactItem;
public:
	IMPORT_C void SetTemplateLabelL(const TDesC& aLabel);
	IMPORT_C TPtrC GetTemplateLabelL();
protected:
	IMPORT_C static CContactCardTemplate* NewL();
	IMPORT_C static CContactCardTemplate* NewLC();
	IMPORT_C static CContactCardTemplate* NewL(const CContactItem *aTemplate);
	IMPORT_C static CContactCardTemplate* NewLC(const CContactItem *aTemplate);
	IMPORT_C TBool HasItemLabelField();

/** Intended usage: Reserved to preserve future BC */
	IMPORT_C void ReservedFunction1();
/** Intended usage: Reserved to preserve future BC */
	IMPORT_C void ReservedFunction2();

protected: // from CContactItem
	IMPORT_C TUid Type() const;

private:
	CContactCardTemplate();
	};

class CContactCard : public CContactItemPlusGroup
/** A contact card.

Implements the Type() function declared in class CContactItem.
Contact cards may optionally be constructed from a template.
@publishedAll
@released
*/
	{
public:
	IMPORT_C ~CContactCard();
	IMPORT_C static CContactCard* NewL();
	IMPORT_C static CContactCard* NewLC();
	IMPORT_C static CContactCard* NewL(const CContactItem *aTemplate);
	IMPORT_C static CContactCard* NewLC(const CContactItem *aTemplate);
public: // from CContactItem
	IMPORT_C TUid Type() const;
public:
	IMPORT_C CContactIdArray* GroupsJoinedLC() const;
private:
	CContactCard();
private:
	friend class CContactDatabase;
	};

class CContactOwnCard : public CContactItemPlusGroup
/** Own card.

An own card is a contact card which contains information about the device's
owner. This can be sent to another compatible electronic device as a vCard.
The contact database recognises a single own card, referred to as the
current own card; its ID is returned by CContactDatabase::OwnCardId(). Like
a contact card, an own card can be a member of one or more contact card groups.
The own card type is identified by a UID of KUidContactOwnCard.

Own cards can be constructed using either CContactDatabase::CreateOwnCardLC()
or CreateOwnCardL(). These functions create an own card, based on the system
template, add it to the database, set it as the database's current own card
and return a pointer to it. To change the database's current own card, use
CContactDatabase::SetOwnCardL().
@publishedAll
@released
*/
	{
public:
	IMPORT_C ~CContactOwnCard();
	IMPORT_C static CContactOwnCard* NewL();
	IMPORT_C static CContactOwnCard* NewLC();
	IMPORT_C static CContactOwnCard* NewL(const CContactItem *aTemplate);
	IMPORT_C static CContactOwnCard* NewLC(const CContactItem *aTemplate);
public: // from CContactItem
	IMPORT_C TUid Type() const;
public:
	IMPORT_C CContactIdArray* GroupsJoinedLC() const;
private:
	CContactOwnCard();
private:
	friend class CContactDatabase;
	};

class CContactTemplate : public CContactItem
/** A contact item template.

This is a contact item which is used to seed the initial field set for
other contact items.

Non-system (i.e. user-defined) templates are implemented
by the CContactCardTemplate class. CContactCardTemplate should be
used in preference to CContactTemplate.
@publishedAll
@released
*/
	{
public:
	IMPORT_C static CContactTemplate* NewL();
	IMPORT_C static CContactTemplate* NewLC();
	IMPORT_C static CContactTemplate* NewL(const CContactItem *aTemplate);
	IMPORT_C static CContactTemplate* NewLC(const CContactItem *aTemplate);
public: // from CContactItem
	IMPORT_C TUid Type() const;
private:
	CContactTemplate();
	};


class CContactICCEntry : public CContactItemPlusGroup
/** A contact ICC entry.
@publishedAll
@released
*/
	{
public:
	IMPORT_C ~CContactICCEntry();
	IMPORT_C static CContactICCEntry* NewL(const CContactItem& aTemplate);
	static CContactICCEntry* NewL();
public: //from CContactItem
	TUid Type() const;
private:
	CContactICCEntry();
	};


class ContactGuid
/** A globally unique identifier enquiry utility.

Each contact item has a unique identifier, stored as a descriptor. It is
referred to as the 'UID string'. This is a combination of the unique
identifier of the database in which the contact item was created, the
contact item ID and the date/time of the contact item's creation. ContactGuid
provides a single static exported function to enquire whether an item was
created in a specified database.
@publishedAll
@released
*/
	{
public:
	IMPORT_C static TContactItemId IsLocalContactUidString(const TDesC& aString, TInt64 aMachineUniqueId);
	IMPORT_C static TBool GetCreationDate(TDes& aString, TInt64 aMachineUniqueId);
	static HBufC* CreateGuidLC(const TDesC& aCreationDate,TContactItemId aId, TInt64 aMachineUniqueId);
	static HBufC* CreateGuidLC(const TTime& aCreationDate,TContactItemId aId, TInt64 aMachineUniqueId);
	static HBufC* CreateGuidLC(TContactItemId aId, TInt64 aMachineUniqueId);
	};

inline const CContactItemField& CContactItemFieldSet::operator[](TInt aIndex) const
/** Gets the field located at a specified position in the field set.

@param aIndex The position of the field in the field set. This is relative to zero.
It must be non-negative and less than the number of objects in the array, otherwise
the operator raises a panic.

@return A const reference to an element in the array. */
	{ return *(*iFields)[aIndex]; }

inline CContactItemField& CContactItemFieldSet::operator[](TInt aIndex)
/** Gets the field located at a specified position in the field set.

@param aIndex The position of the field in the field set. This is relative to zero.
It must be non-negative and less than the number of objects in the array, otherwise
the operator raises a panic.

@return A non-const reference to an element in the array. */
	{ return *(*iFields)[aIndex]; }

inline TInt CContactItemFieldSet::Find(TFieldType aFieldType) const
/** Finds the first field in the field set with the specified field type.

@param aFieldType The field type of interest.
@return If found, the index of the field within the field set, or KErrNotFound
if not found. */
	{ return FindNext(aFieldType,KContactFieldSetSearchAll); }

inline TInt CContactItemFieldSet::Find(TFieldType aFieldType,TUid aMapping) const
/** Finds the first field in the field set containing both the content type mapping
and the field type specified.

@param aFieldType The field type of interest.
@param aMapping The content type mapping of interest.
@return If found, the index of the field within the field set, or KErrNotFound
if not found. */
	{ return FindNext(aFieldType,aMapping,KContactFieldSetSearchAll); }

inline TInt CContactItemFieldSet::Count() const
/** Gets the number of fields in the field set.

@return The number of fields in the field set. */
	{ return iFields->Count(); }

inline void CContactItemFieldSet::Reset()
/** Deletes all fields in the field set. */
	{ iFields->ResetAndDestroy(); }

inline TBool CContactItem::IsDeletable()
/** Tests whether the contact item is deletable.

This is true if the item's access count is zero.

@return ETrue if deletable, EFalse if not deletable. */
	{return (iAccessCount == 0);}

inline void CContactItem::IncAccessCount()
/** Increments the contact item's access count. */
	{iAccessCount++;}

inline void CContactItem::DecAccessCount()
/** Decrements the contact item's access count. */
	{if(iAccessCount) iAccessCount--;}

inline TInt CContactItem::AccessCount() const
/** Gets the contact item's access count.

@return The item's access count. */
	{return(iAccessCount);}

inline TPtrC CContactItem::Guid()
/** Accessor function for Contact Guid.
 * This is used to cache contact items that are added during a sync.
 @return Guid    */
 { return iGuid ? *iGuid : TPtrC(KNullDesC); }

#endif