Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
21 #if !( defined __SYMBIAN_CNTMODEL_HIDE_DBMS__ && defined __SYMBIAN_CNTMODEL_USE_SQLITE__ )
27 class CCntFilter : public CBase
28 /** A contact database filter.
30 This is used to get a subset of the items in a contact database.
31 There are three criteria used when filtering a database:
33 - the contact item's state
35 - the date/time the contact item was created/last modified/deleted
37 - the contact item's type
39 The state can be one of: deleted, modified or created (since
40 a specified date/time). The filter can be set to include contact items of
41 only one state, or it can be set to include contact items of all states, using
42 the TInclude enumeration.
44 The date/time value is used in combination with the contact item's state.
46 The contact item's type is one of contact card, contact card group, contact
47 card template, or own card. Any combination of contact types may be specified
48 in the filter, in addition to the contact item's state.
50 After the filter has been set up, it should be passed to the function
51 CContactDatabase::FilterDatabaseL().
56 friend class CPackagerTests; //Comparison test
58 /** Flags to identify which contact items should be included in the filter.
60 Only one of the following values can be set in the filter at a time. However
61 the client may select to filter contacts in all states using EIncludeAllContacts. */
64 /** Contact items in all states should be included. */
66 /** Only contact items which have been added since the date/time should be included. */
68 /** Only contact items which have been modified since the date/time should be included. */
69 EIncludeModifiedContacts,
70 /** Only contact items which have been deleted since the date/time should be included. */
71 EIncludeDeletedContacts
73 /** Contact item types.*/
76 /** All contact item types should be included. */
77 EIncludeAllTypes = 0x01,
78 /** Contact cards should be included in the filter. */
80 /** Contact card groups should be included in the filter. */
81 EContactGroups = 0x04,
82 /** Contact card templates should be included in the filter. */
83 EContactTemplates = 0x08,
84 /** Own cards should be included in the filter. */
85 EContactOwnCard = 0x10
88 IMPORT_C static CCntFilter* NewL();
89 IMPORT_C static CCntFilter* NewLC();
90 IMPORT_C static CCntFilter* NewL(const CCntFilter* aFilter);
91 IMPORT_C static CCntFilter* NewLC(const CCntFilter* aFilter);
92 static CCntFilter* NewLC(RReadStream& aStream);
93 IMPORT_C ~CCntFilter();
95 /** A pointer to an array which stores the filtered list of contact IDs. */
96 CContactIdArray* iIds;
98 IMPORT_C void SetIncludeModifiedContacts(TBool aIncludeModified);
99 IMPORT_C void SetIncludeNewContacts(TBool aIncludeNew);
100 IMPORT_C void SetIncludeDeletedContacts(TBool aIncludeDeleted);
102 IMPORT_C TBool TestContactFilterType(TUid aTypeUid);
103 IMPORT_C void SetContactFilterTypeALL(TBool aFilterAllContacts);
104 IMPORT_C void SetContactFilterTypeCard(TBool aFilterCards);
105 IMPORT_C void SetContactFilterTypeGroup(TBool aFilterGroups);
106 IMPORT_C void SetContactFilterTypeTemplate(TBool aFilterTemplates);
107 IMPORT_C void SetContactFilterTypeOwnCard(TBool aFilterOwnCard);
108 void ExternalizeL(RWriteStream& aStream) const;
109 void InternalizeL(RReadStream& aStream);
111 inline TBool ContactFilterTypeALL() const;
112 inline TBool ContactFilterTypeCard() const;
113 inline TBool ContactFilterTypeGroup() const;
114 inline TBool ContactFilterTypeOwnCard() const;
115 inline TBool ContactFilterTypeTemplate() const;
117 inline TBool IncludeModifiedContacts();
118 inline TBool IncludeNewContacts();
119 inline TBool IncludeDeletedContacts();
121 inline TTime GetFilterDateTime();
122 inline void SetFilterDateTime(TTime aTime);
124 IMPORT_C void Reset();
127 Intended usage: Reserved to preserve future BC */
128 IMPORT_C void Reserved1();
130 Intended usage: Reserved to preserve future BC */
131 IMPORT_C void Reserved2();
134 TTime iSinceDateTime;
140 CCntFilter(const CCntFilter* aFilter);
144 inline TBool CCntFilter::IncludeModifiedContacts()
145 /** Tests whether the filter includes only contacts modified since the filter's
148 @return ETrue if the filter only includes modified contacts. EFalse if not. */
149 {return iInclude == EIncludeModifiedContacts;};
151 inline TBool CCntFilter::IncludeNewContacts()
152 /** Tests whether the filter includes only contacts created since the filter's
155 @return ETrue if the filter only includes new contacts. EFalse if not. */
156 {return iInclude == EIncludeNewContacts;};
158 inline TBool CCntFilter::IncludeDeletedContacts()
159 /** Tests whether the filter includes only contacts deleted since the filter's
162 @return ETrue if the filter only includes deleted contacts. EFalse if not. */
163 {return iInclude == EIncludeDeletedContacts;};
165 inline TTime CCntFilter::GetFilterDateTime()
166 /** Gets the date and time used by the filter, as set by SetFilterDateTime().
168 @return The filter's date and time value. */
169 {return iSinceDateTime;};
171 inline void CCntFilter::SetFilterDateTime(TTime aTime)
172 /** Sets the date and time used by the filter in combination with the TInclude
173 value to test contact items against.
175 @param aTime The new date and time value. */
176 {iSinceDateTime = aTime;};
179 inline TBool CCntFilter::ContactFilterTypeALL() const
180 /** Tests whether all contact item types are included in the filter, as set by
181 SetContactFilterTypeALL().
183 @return ETrue if all contact item types are included in the filter, EFalse
185 {return iContactType & EIncludeAllTypes;}
187 inline TBool CCntFilter::ContactFilterTypeCard() const
188 /** Tests whether contact cards are included in the filter, as set by SetContactFilterTypeCard().
190 @return ETrue if contact cards are included in the filter, EFalse if not. */
191 {return iContactType & EContactCards;}
193 inline TBool CCntFilter::ContactFilterTypeGroup() const
194 /** Tests whether contact card groups are included in the filter, as set by SetContactFilterTypeGroup().
196 @return ETrue if contact card groups are included in the filter, EFalse if
198 {return iContactType & EContactGroups;}
200 inline TBool CCntFilter::ContactFilterTypeOwnCard() const
201 /** Tests whether own cards are included in the filter, as set by SetContactFilterTypeOwnCard().
203 @return ETrue if own cards are included in the filter, EFalse if not. */
204 {return iContactType & EContactOwnCard;}
206 inline TBool CCntFilter::ContactFilterTypeTemplate() const
207 /** Tests whether contact card templates are included in the filter, as set by
208 SetContactFilterTypeTemplate().
210 @return ETrue if contact card templates are included in the filter, EFalse
212 {return iContactType & EContactTemplates;}