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 ()
void ExternalizeL ( RWriteStream &)
TTime GetFilterDateTime ()
TBool IncludeDeletedContacts ()
TBool IncludeModifiedContacts ()
TBool IncludeNewContacts ()
void InternalizeL ( 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 void Reserved1 ()
IMPORT_C void Reserved2 ()
IMPORT_C void Reset ()
IMPORT_C void SetContactFilterTypeALL ( TBool )
IMPORT_C void SetContactFilterTypeCard ( TBool )
IMPORT_C void SetContactFilterTypeGroup ( TBool )
IMPORT_C void SetContactFilterTypeOwnCard ( TBool )
IMPORT_C void SetContactFilterTypeTemplate ( TBool )
void SetFilterDateTime ( TTime )
IMPORT_C void SetIncludeDeletedContacts ( TBool )
IMPORT_C void SetIncludeModifiedContacts ( TBool )
IMPORT_C void SetIncludeNewContacts ( TBool )
IMPORT_C TBool TestContactFilterType ( 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
enum TContactType { EIncludeAllTypes  = 0x01, EContactCards  = 0x02, EContactGroups  = 0x04, EContactTemplates  = 0x08, EContactOwnCard  = 0x10 }
enum TInclude { 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 &)

void ExternalizeL ( RWriteStream & aStream ) const

Externalises a CCntFilter object to a write stream.

Parameters

RWriteStream & aStream Stream 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 &)

void InternalizeL ( RReadStream & aStream )

Internalises a CCntFilter object from a read stream.

Parameters

RReadStream & aStream Stream 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 * aFilter Pointer 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 * aFilter Pointer 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 & aStream RReadStream containing object to internalize.

Reserved1()

IMPORT_C void Reserved1 ( )

Intended usage: Reserved to preserve future BC

Reserved2()

IMPORT_C void Reserved2 ( )

Intended usage: Reserved to preserve future BC

Reset()

IMPORT_C void Reset ( )

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

SetContactFilterTypeALL(TBool)

IMPORT_C void SetContactFilterTypeALL ( TBool aFilterAllContacts )

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 aFilterAllContacts ETrue if all contact item types should be included in the filter, EFalse if not.

SetContactFilterTypeCard(TBool)

IMPORT_C void SetContactFilterTypeCard ( TBool aFilterCards )

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

Parameters

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

SetContactFilterTypeGroup(TBool)

IMPORT_C void SetContactFilterTypeGroup ( TBool aFilterGroups )

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

Parameters

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

SetContactFilterTypeOwnCard(TBool)

IMPORT_C void SetContactFilterTypeOwnCard ( TBool aFilterOwnCard )

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

Parameters

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

SetContactFilterTypeTemplate(TBool)

IMPORT_C void SetContactFilterTypeTemplate ( TBool aFilterTemplates )

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

Parameters

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

SetFilterDateTime(TTime)

void SetFilterDateTime ( TTime aTime ) [inline]

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

Parameters

TTime aTime The new date and time value.

SetIncludeDeletedContacts(TBool)

IMPORT_C void SetIncludeDeletedContacts ( TBool aIncludeDeleted )

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

Parameters

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

SetIncludeModifiedContacts(TBool)

IMPORT_C void SetIncludeModifiedContacts ( TBool aIncludeModified )

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

Parameters

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

SetIncludeNewContacts(TBool)

IMPORT_C void SetIncludeNewContacts ( TBool aIncludeNew )

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

Parameters

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

TestContactFilterType(TUid)

IMPORT_C TBool TestContactFilterType ( TUid aTypeUid )

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

Parameters

TUid aTypeUid UID 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]