CCntFilter Class Reference

#include <app/cntfilt.h>

class CCntFilter : public CBase, public CBase

Inherits from

Public Attributes
CContactIdArray *iIds
Public Member Enumerations
enumTContactType { EIncludeAllTypes, EContactCards, EContactGroups, EContactTemplates, EContactOwnCard }
enumTInclude { EIncludeAllContacts, EIncludeNewContacts, EIncludeModifiedContacts, EIncludeDeletedContacts }
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)
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()

Detailed Description

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().

Member Attribute Documentation

iIds

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

Member Enumeration Documentation

Enum TContactType

Contact item types.

EnumeratorValueDescription
EIncludeAllTypes0x01

All contact item types should be included.

EContactCards0x02

Contact cards should be included in the filter.

EContactGroups0x04

Contact card groups should be included in the filter.

EContactTemplates0x08

Contact card templates should be included in the filter.

EContactOwnCard0x10

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.

EnumeratorValueDescription
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.

Constructor & Destructor Documentation

~CCntFilter ( )

IMPORT_C~CCntFilter()

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

Member Function Documentation

ContactFilterTypeALL ( )

TBool ContactFilterTypeALL()const [inline]

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

Return Value
ETrue if all contact item types are included in the filter, EFalse if not.

ContactFilterTypeCard ( )

TBool ContactFilterTypeCard()const [inline]

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

Return Value
ETrue if contact cards are included in the filter, EFalse if not.

ContactFilterTypeGroup ( )

TBool ContactFilterTypeGroup()const [inline]

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

Return Value
ETrue if contact card groups are included in the filter, EFalse if not.

ContactFilterTypeOwnCard ( )

TBool ContactFilterTypeOwnCard()const [inline]

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

Return Value
ETrue if own cards are included in the filter, EFalse if not.

ContactFilterTypeTemplate ( )

TBool ContactFilterTypeTemplate()const [inline]

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

Return Value
ETrue if contact card templates are included in the filter, EFalse if not.

ExternalizeL ( RWriteStream & )

voidExternalizeL(RWriteStream &aStream)const

Externalises a CCntFilter object to a write stream.

Parameters
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().

Return Value
The filter's date and time value.

IncludeDeletedContacts ( )

TBool IncludeDeletedContacts()[inline]

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

Return Value
ETrue if the filter only includes deleted contacts. EFalse if not.

IncludeModifiedContacts ( )

TBool IncludeModifiedContacts()[inline]

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

Return Value
ETrue if the filter only includes modified contacts. EFalse if not.

IncludeNewContacts ( )

TBool IncludeNewContacts()[inline]

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

Return Value
ETrue if the filter only includes new contacts. EFalse if not.

InternalizeL ( RReadStream & )

voidInternalizeL(RReadStream &aStream)

Internalises a CCntFilter object from a read stream.

Parameters
aStreamStream from which the object should be internalised.

NewL ( )

IMPORT_C CCntFilter *NewL()[static]

Allocates and constructs a default contact database filter.

Return Value
Pointer to the new 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
aFilterPointer to the filter to copy.
Return Value
Pointer to the new filter.

NewLC ( )

IMPORT_C CCntFilter *NewLC()[static]

Allocates and constructs a default contact database filter.

Return Value
Pointer to the new filter. This is left on the cleanup stack.

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
aFilterPointer to the filter to copy.
Return Value
Pointer to the new filter. This is left on the cleanup stack.

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
aStreamRReadStream containing object to internalize.
Return Value
Pointer to the new filter. This is left on the cleanup stack.

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
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
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
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
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
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
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
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
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
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
aTypeUidUID which identifies a contact item type. One of: KUidContactCard, KUidContactGroup, KUidContactCardTemplate or KUidContactOwnCard.
Return Value
ETrue if the specified contact type is included in the filter, EFalse not.