CCntFilter Class Reference

class CCntFilter : public CBase

A contact database filter.

This is used to get a subset of the items in a contact database. There are three criteria used when filtering a database:

  • the contact item's state

  • the date/time the contact item was created/last modified/deleted

  • the contact item's type

The state can be one of: deleted, modified or created (since a specified date/time). The filter can be set to include contact items of only one state, or it can be set to include contact items of all states, using the TInclude enumeration.

The date/time value is used in combination with the contact item's state.

The contact item's type is one of contact card, contact card group, contact card template, or own card. Any combination of contact types may be specified in the filter, in addition to the contact item's state.

After the filter has been set up, it should be passed to the function CContactDatabase::FilterDatabaseL().

Inherits from

Public Member Functions
~CCntFilter()
TBool ContactFilterTypeALL()
TBool ContactFilterTypeCard()
TBool ContactFilterTypeGroup()
TBool ContactFilterTypeOwnCard()
TBool ContactFilterTypeTemplate()
voidExternalizeL(RWriteStream &)
TTime GetFilterDateTime()
TBool IncludeDeletedContacts()
TBool IncludeModifiedContacts()
TBool IncludeNewContacts()
voidInternalizeL(RReadStream &)
IMPORT_C CCntFilter *NewL()
IMPORT_C CCntFilter *NewL(const CCntFilter *)
IMPORT_C CCntFilter *NewLC()
IMPORT_C CCntFilter *NewLC(const CCntFilter *)
CCntFilter *NewLC(RReadStream &)
IMPORT_C voidReserved1()
IMPORT_C voidReserved2()
IMPORT_C voidReset()
IMPORT_C voidSetContactFilterTypeALL(TBool)
IMPORT_C voidSetContactFilterTypeCard(TBool)
IMPORT_C voidSetContactFilterTypeGroup(TBool)
IMPORT_C voidSetContactFilterTypeOwnCard(TBool)
IMPORT_C voidSetContactFilterTypeTemplate(TBool)
voidSetFilterDateTime(TTime)
IMPORT_C voidSetIncludeDeletedContacts(TBool)
IMPORT_C voidSetIncludeModifiedContacts(TBool)
IMPORT_C voidSetIncludeNewContacts(TBool)
IMPORT_C TBoolTestContactFilterType(TUid)
Private Member Functions
CCntFilter()
CCntFilter(const CCntFilter *)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enumTContactType { EIncludeAllTypes = 0x01, EContactCards = 0x02, EContactGroups = 0x04, EContactTemplates = 0x08, EContactOwnCard = 0x10 }
enumTInclude { EIncludeAllContacts, EIncludeNewContacts, EIncludeModifiedContacts, EIncludeDeletedContacts }
Public Attributes
CContactIdArray *iIds
Private Attributes
TInt32 iContactType
TInclude iInclude
TAny *iReserved1
TAny *iReserved2
TTime iSinceDateTime

Constructor & Destructor Documentation

CCntFilter()

CCntFilter()[private]

CCntFilter(const CCntFilter *)

CCntFilter(const CCntFilter *aFilter)[private]

Parameters

const CCntFilter * aFilter

~CCntFilter()

IMPORT_C~CCntFilter()

Deletes all resources owned by the filter prior to its destruction.

Member Functions Documentation

ContactFilterTypeALL()

TBool ContactFilterTypeALL()const [inline]

Tests whether all contact item types are included in the filter, as set by SetContactFilterTypeALL().

ContactFilterTypeCard()

TBool ContactFilterTypeCard()const [inline]

Tests whether contact cards are included in the filter, as set by SetContactFilterTypeCard().

ContactFilterTypeGroup()

TBool ContactFilterTypeGroup()const [inline]

Tests whether contact card groups are included in the filter, as set by SetContactFilterTypeGroup().

ContactFilterTypeOwnCard()

TBool ContactFilterTypeOwnCard()const [inline]

Tests whether own cards are included in the filter, as set by SetContactFilterTypeOwnCard().

ContactFilterTypeTemplate()

TBool ContactFilterTypeTemplate()const [inline]

Tests whether contact card templates are included in the filter, as set by SetContactFilterTypeTemplate().

ExternalizeL(RWriteStream &)

voidExternalizeL(RWriteStream &aStream)const

Externalises a CCntFilter object to a write stream.

Parameters

RWriteStream & aStreamStream to which the object should be externalised.

GetFilterDateTime()

TTime GetFilterDateTime()[inline]

Gets the date and time used by the filter, as set by SetFilterDateTime().

IncludeDeletedContacts()

TBool IncludeDeletedContacts()[inline]

Tests whether the filter includes only contacts deleted since the filter's date/time.

IncludeModifiedContacts()

TBool IncludeModifiedContacts()[inline]

Tests whether the filter includes only contacts modified since the filter's date/time.

IncludeNewContacts()

TBool IncludeNewContacts()[inline]

Tests whether the filter includes only contacts created since the filter's date/time.

InternalizeL(RReadStream &)

voidInternalizeL(RReadStream &aStream)

Internalises a CCntFilter object from a read stream.

Parameters

RReadStream & aStreamStream from which the object should be internalised.

NewL()

IMPORT_C CCntFilter *NewL()[static]

Allocates and constructs a default contact database filter.

NewL(const CCntFilter *)

IMPORT_C CCntFilter *NewL(const CCntFilter *aFilter)[static]

Allocates and constructs a contact database filter based on another one.

The state value, type flags, the date/time value and the ID array are copied.

Parameters

const CCntFilter * aFilterPointer to the filter to copy.

NewLC()

IMPORT_C CCntFilter *NewLC()[static]

Allocates and constructs a default contact database filter.

NewLC(const CCntFilter *)

IMPORT_C CCntFilter *NewLC(const CCntFilter *aFilter)[static]

Allocates and constructs a contact database filter based on another one.

The state value, type flags, the date/time value and the ID array are copied.

Parameters

const CCntFilter * aFilterPointer to the filter to copy.

NewLC(RReadStream &)

CCntFilter *NewLC(RReadStream &aStream)[static]

Allocates and constructs a contact database filter based on a RReadStream.

The state value, type flags, the date/time value and the ID array are copied.

Parameters

RReadStream & aStreamRReadStream containing object to internalize.

Reserved1()

IMPORT_C voidReserved1()

Intended usage: Reserved to preserve future BC

Reserved2()

IMPORT_C voidReserved2()

Intended usage: Reserved to preserve future BC

Reset()

IMPORT_C voidReset()

Resets the filter. The state value is set to EIncludeAllContacts and the contact ID array is reset.

SetContactFilterTypeALL(TBool)

IMPORT_C voidSetContactFilterTypeALL(TBoolaFilterAllContacts)

Sets whether all contact item types (contact card groups, contact cards, own cards and contact card templates) should be included in the filter.

Parameters

TBool aFilterAllContactsETrue if all contact item types should be included in the filter, EFalse if not.

SetContactFilterTypeCard(TBool)

IMPORT_C voidSetContactFilterTypeCard(TBoolaFilterCards)

Sets whether contact cards should be included in or excluded from the filter.

Parameters

TBool aFilterCardsETrue to include contact cards in the filter, EFalse to exclude them.

SetContactFilterTypeGroup(TBool)

IMPORT_C voidSetContactFilterTypeGroup(TBoolaFilterGroups)

Sets whether contact card groups should be included in or excluded from the filter.

Parameters

TBool aFilterGroupsETrue to include contact card groups in the filter, EFalse to exclude them.

SetContactFilterTypeOwnCard(TBool)

IMPORT_C voidSetContactFilterTypeOwnCard(TBoolaFilterOwnCard)

Sets whether own cards should be included in or excluded from the filter.

Parameters

TBool aFilterOwnCardETrue to include own cards in the filter, EFalse to exclude them.

SetContactFilterTypeTemplate(TBool)

IMPORT_C voidSetContactFilterTypeTemplate(TBoolaFilterTemplates)

Sets whether contact card templates should be included in or excluded from the filter.

Parameters

TBool aFilterTemplatesETrue to include contact card templates in the filter, EFalse to exclude them.

SetFilterDateTime(TTime)

voidSetFilterDateTime(TTimeaTime)[inline]

Sets the date and time used by the filter in combination with the TInclude value to test contact items against.

Parameters

TTime aTimeThe new date and time value.

SetIncludeDeletedContacts(TBool)

IMPORT_C voidSetIncludeDeletedContacts(TBoolaIncludeDeleted)

Sets the filter to include only contacts deleted since the filter's date/time.

Parameters

TBool aIncludeDeletedETrue to include only contacts deleted since the filter's date/time, EFalse to include contact items in all states.

SetIncludeModifiedContacts(TBool)

IMPORT_C voidSetIncludeModifiedContacts(TBoolaIncludeModified)

Sets the filter to include only contacts modified since the filter's date/time.

Parameters

TBool aIncludeModifiedETrue to include only contacts modified since the filter's date/time, EFalse to include contact items in all states.

SetIncludeNewContacts(TBool)

IMPORT_C voidSetIncludeNewContacts(TBoolaIncludeNew)

Sets the filter to include only contacts created since the filter's date/time.

Parameters

TBool aIncludeNewETrue to include only contacts created since the filter's date/time, EFalse to include contact items in all states.

TestContactFilterType(TUid)

IMPORT_C TBoolTestContactFilterType(TUidaTypeUid)

Tests whether a contact item type, identified by its UID is included in or excluded from the filter.

Parameters

TUid aTypeUidUID which identifies a contact item type. One of: KUidContactCard, KUidContactGroup, KUidContactCardTemplate or KUidContactOwnCard.

Member Enumerations Documentation

Enum TContactType

Contact item types.

Enumerators

EIncludeAllTypes = 0x01

All contact item types should be included.

EContactCards = 0x02

Contact cards should be included in the filter.

EContactGroups = 0x04

Contact card groups should be included in the filter.

EContactTemplates = 0x08

Contact card templates should be included in the filter.

EContactOwnCard = 0x10

Own cards should be included in the filter.

Enum TInclude

Flags to identify which contact items should be included in the filter.

Only one of the following values can be set in the filter at a time. However the client may select to filter contacts in all states using EIncludeAllContacts.

Enumerators

EIncludeAllContacts

Contact items in all states should be included.

EIncludeNewContacts

Only contact items which have been added since the date/time should be included.

EIncludeModifiedContacts

Only contact items which have been modified since the date/time should be included.

EIncludeDeletedContacts

Only contact items which have been deleted since the date/time should be included.

Member Data Documentation

TInt32 iContactType

TInt32 iContactType[private]

CContactIdArray * iIds

CContactIdArray *iIds

A pointer to an array which stores the filtered list of contact IDs.

TInclude iInclude

TInclude iInclude[private]

TAny * iReserved1

TAny *iReserved1[private]

TAny * iReserved2

TAny *iReserved2[private]

TTime iSinceDateTime

TTime iSinceDateTime[private]