Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: cntitem.h
Link against: cntmodel.lib

Class CCntFilter

CCntFilter

Support

Supported from 6.0

Description

A contact database filter. Used to get a subset of the contact items contained in a contact database. There are three criteria used when filtering a database: —

The contact item's 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().

Derivation

CBaseBase class for all classes to be instantiated on the heap
CCntFilterA contact database filter

Defined in CCntFilter:
ContactFilterTypeALL(), ContactFilterTypeCard(), ContactFilterTypeGroup(), ContactFilterTypeOwnCard(), ContactFilterTypeTemplate(), EContactCards, EContactGroups, EContactOwnCard, EContactTemplates, EIncludeAllContacts, EIncludeAllTypes, EIncludeDeletedContacts, EIncludeModifiedContacts, EIncludeNewContacts, GetFilterDateTime(), IncludeDeletedContacts(), IncludeModifiedContacts(), IncludeNewContacts(), NewL(), NewLC(), Reset(), SetContactFilterTypeALL(), SetContactFilterTypeCard(), SetContactFilterTypeGroup(), SetContactFilterTypeOwnCard(), SetContactFilterTypeTemplate(), SetFilterDateTime(), SetIncludeDeletedContacts(), SetIncludeModifiedContacts(), SetIncludeNewContacts(), TContactType, TInclude, TestContactFilterType(), iIds, ~CCntFilter()

Inherited from CBase:
operator new()


Construction and destruction


NewL()

static CCntFilter* NewL();

Description

Constructs the contact database filter.

Return value

CCntFilter*

Pointer to the new filter.


NewLC()

static CCntFilter* NewLC();

Description

Constructs the contact database filter. The pointer to the filter is left on the cleanup stack.

Return value

CCntFilter*

Pointer to the new filter.


NewL()

static CCntFilter* NewL(const CCntFilter* aFilter);

Description

Constructs the contact database filter from another filter. 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.

Return value

CCntFilter*

Pointer to the new filter.


NewLC()

static CCntFilter* NewLC(const CCntFilter* aFilter);

Description

Constructs the contact database filter from another filter. The state value, type flags, the date/time value and the ID array are copied. The pointer to the filter is left on the cleanup stack.

Parameters

const CCntFilter* aFilter

Pointer to the filter to copy.

Return value

CCntFilter*

Pointer to the new filter.


~CCntFilter()

~CCntFilter();

Description

The destructor deletes all resources owned by the filter prior to its destruction.


Reset()

void Reset();

Description

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

[Top]


Contact states


SetIncludeModifiedContacts()

void SetIncludeModifiedContacts(TBool aIncludeModified);

Description

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

void SetIncludeNewContacts(TBool aIncludeNew);

Description

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.


SetIncludeDeletedContacts()

void SetIncludeDeletedContacts(TBool aIncludeDeleted);

Description

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.


IncludeModifiedContacts()

TBool IncludeModifiedContacts();

Description

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

Return value

TBool

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


IncludeNewContacts()

TBool IncludeNewContacts();

Description

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

Return value

TBool

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


IncludeDeletedContacts()

TBool IncludeDeletedContacts();

Description

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

Return value

TBool

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

[Top]


Contact types


TestContactFilterType()

TBool TestContactFilterType(TUid aTypeUid);

Description

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.

Return value

TBool

ETrue if the specified contact type is included in the filter, EFalse not.


SetContactFilterTypeALL()

void SetContactFilterTypeALL(TBool aFilterAllContacts);

Description

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

void SetContactFilterTypeCard(TBool aFileterCards);

Description

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

Parameters

TBool aFileterCards

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


SetContactFilterTypeGroup()

void SetContactFilterTypeGroup(TBool aFilterGroups);

Description

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.


SetContactFilterTypeTemplate()

void SetContactFilterTypeTemplate(TBool aFilterTemplates);

Description

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.


SetContactFilterTypeOwnCard()

void SetContactFilterTypeOwnCard(TBool aFilterOwnCard);

Description

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.


ContactFilterTypeALL()

TBool ContactFilterTypeALL() const;

Description

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

Return value

TBool

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


ContactFilterTypeCard()

TBool ContactFilterTypeCard() const;

Description

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

Return value

TBool

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


ContactFilterTypeGroup()

TBool ContactFilterTypeGroup() const;

Description

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

Return value

TBool

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


ContactFilterTypeOwnCard()

TBool ContactFilterTypeOwnCard() const;

Description

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

Return value

TBool

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


ContactFilterTypeTemplate()

TBool ContactFilterTypeTemplate() const;

Description

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

Return value

TBool

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

[Top]


Date and time


SetFilterDateTime()

void SetFilterDateTime(TTime aTime);

Description

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.


GetFilterDateTime()

TTime GetFilterDateTime();

Description

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

Return value

TTime

The filter's date and time value.

[Top]


Member data


iIds

CContactIdArray* iIds

Description

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

[Top]


Enumerations


Enum TInclude

TInclude

Description

Flags to set 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.

EIncludeAllContacts

Contact items in all states should be included in the filter.

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.


Enum TContactType

TContactType

Description

Contact item types

EIncludeAllTypes

All contact item types should be included in the filter.

EContactCards

Contact cards should be included in the filter.

EContactGroups

Contact card groups should be included in the filter.

EContactTemplates

Contact card templates should be included in the filter.

EContactOwnCard

Own cards should be included in the filter.