1 // Copyright (c) 1998-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.
16 inline TMsvId TMsvEntry::Id() const
17 /** Gets the value of the entry ID.
19 @return The value of the entry ID */
24 inline void TMsvEntry::SetId(TMsvId aId)
29 inline TMsvId TMsvEntry::Parent() const
30 /** Gets the value of the parent ID.
32 @return The value of the parent ID */
37 inline void TMsvEntry::SetParent(TMsvId aParentId)
39 iParentId = aParentId;
42 inline TBool TMsvEntry::Complete () const
43 /** Gets the value of the message complete flag.
45 Note that for email download without size limits, the complete flag will only
46 be set to true once all the parts of the message (body text and attachments)
49 @return The value of the message complete flag */
51 return !(iData&KMsvEntryNotCompleteFlag);
54 inline void TMsvEntry::SetComplete(TBool aComplete)
55 /** Sets the message complete flag.
57 Note that for email download without size limits, the complete flag will only
58 be set to true once all the parts of the message (body text and attachments)
61 @param aComplete Value for the message complete flag */
63 iData = (iData & ~KMsvEntryNotCompleteFlag) | ((!aComplete)?KMsvEntryNotCompleteFlag:KMsvEntryClearFlag);
66 inline TBool TMsvEntry::New() const
67 /** Gets the value of the new message flag.
69 @return The value of the new message flag */
71 return iData&KMsvEntryNewFlag;
74 inline void TMsvEntry::SetNew(TBool aNew)
75 /** Sets the message new flag.
77 @param aNew Value for the message new flag */
79 iData = (iData & ~KMsvEntryNewFlag) | (aNew?KMsvEntryNewFlag:KMsvEntryClearFlag);
82 inline TBool TMsvEntry::Unread() const
83 /** Gets the value of the message unread flag.
85 @return The value of the message unread flag */
87 return iData&KMsvEntryUnreadFlag;
90 inline void TMsvEntry::SetUnread(TBool aUnread)
91 /** Sets the message unread flag.
93 @param aUnread Value for the message unread flag */
95 iData = (iData & ~KMsvEntryUnreadFlag) | (aUnread?KMsvEntryUnreadFlag:KMsvEntryClearFlag);
98 inline TBool TMsvEntry::Failed() const
99 /** Gets the value of the message send failed flag.
101 @return The value of the message send failed flag */
103 return iData&KMsvEntryFailedFlag;
106 inline void TMsvEntry::SetFailed(TBool aFailed)
107 /** Sets the message send failed flag.
109 @param aFailed Value for the message send failed flag */
111 iData = (iData & ~KMsvEntryFailedFlag) | (aFailed?KMsvEntryFailedFlag:KMsvEntryClearFlag);
114 inline TBool TMsvEntry::Operation() const
115 /** Gets the value of the disconnected operation queued flag.
117 @return The value of the disconnected operation queued flag */
119 return iData&KMsvEntryOperationFlag;
122 inline void TMsvEntry::SetOperation(TBool aOperation)
123 /** Sets the disconnected operation queued flag.
125 @param aOperation Value for the disconnected operation queued flag */
127 iData = (iData & ~KMsvEntryOperationFlag) | (aOperation?KMsvEntryOperationFlag:KMsvEntryClearFlag);
130 inline TBool TMsvEntry::Owner() const
131 /** Gets the value of the owner flag.
133 @return The value of the owner flag */
135 return iData&KMsvEntryOwnerFlag;
138 inline void TMsvEntry::SetOwner(TBool aOwner)
140 iData = (iData & ~KMsvEntryOwnerFlag) | (aOwner?KMsvEntryOwnerFlag:KMsvEntryClearFlag);
143 inline TBool TMsvEntry::Attachment() const
144 /** Gets the value of the attachment flag.
146 @return The value of the attachment flag */
148 return iData&KMsvEntryAttachmentFlag;
151 inline void TMsvEntry::SetAttachment(TBool aAttachmentFlag)
152 /** Sets the attachment flag.
154 @param aAttachmentFlag Value for the attachment flag */
156 iData = (iData & ~KMsvEntryAttachmentFlag) | (aAttachmentFlag?KMsvEntryAttachmentFlag:KMsvEntryClearFlag);
159 inline TBool TMsvEntry::Visible() const
160 /** Gets the value of the entry visible flag.
162 @return The value of the entry visible flag */
164 return !((iData&KMsvEntryInvisibleFlag) || (iData&KMsvEntryPendingDeleteFlag));
167 inline void TMsvEntry::SetVisible(TBool aVisble)
168 /** Sets the entry visible flag.
170 @param aVisble Value for the entry visible flag */
172 iData = (iData & ~KMsvEntryInvisibleFlag) | ((!aVisble)?KMsvEntryInvisibleFlag:KMsvEntryClearFlag);
175 inline TBool TMsvEntry::MultipleRecipients() const
176 /** Gets the value of the multiple recipients flag.
178 @return The value of the multiple recipients flag */
180 return iData&KMsvEntryMultipleRecipientFlag;
183 inline void TMsvEntry::SetMultipleRecipients(TBool aMultipleRecipient)
184 /** Sets the multiple recipients flag.
186 @param aMultipleRecipient Value for the multiple recipients flag */
188 iData = (iData & ~KMsvEntryMultipleRecipientFlag) | (aMultipleRecipient?KMsvEntryMultipleRecipientFlag:KMsvEntryClearFlag);
191 inline TBool TMsvEntry::ReadOnly() const
192 /** Gets the value of the read-only flag.
194 @return The value of the read-only flag */
196 return iData&KMsvEntryReadOnlyFlag;
199 inline void TMsvEntry::SetReadOnly(TBool aReadOnly)
200 /** Sets the read-only flag.
202 @param aReadOnly Value for the read-only flag */
204 iData = (iData & ~KMsvEntryReadOnlyFlag) | (aReadOnly?KMsvEntryReadOnlyFlag:KMsvEntryClearFlag);
207 inline TBool TMsvEntry::Deleted() const
208 /** Gets the value of the deleted flag.
210 @return The value of the deleted flag */
212 return iData&KMsvEntryDeletedFlag;
215 inline void TMsvEntry::SetDeleted(TBool aDeletedFlag)
217 iData = (iData & ~KMsvEntryDeletedFlag) | (aDeletedFlag?KMsvEntryDeletedFlag:KMsvEntryClearFlag);
220 inline TBool TMsvEntry::StandardFolder() const
221 /** Gets the value of the standard folder flag.
223 @return The value of the standard folder flag */
225 return iData&KMsvEntryStandardFolderFlag;
228 inline void TMsvEntry::SetStandardFolder(TBool aStandardFolder)
230 iData = (iData & ~KMsvEntryStandardFolderFlag) | (aStandardFolder?KMsvEntryStandardFolderFlag:KMsvEntryClearFlag);
233 inline TBool TMsvEntry::Connected() const
234 /** Gets the value of the remote server connection flag.
236 @return The value of the remote server connection flag */
238 return iData&KMsvEntryConnectedFlag;
241 inline void TMsvEntry::SetConnected(TBool aConnected)
242 /** Sets the remote server connection flag.
244 @param aConnected Value for the remote server connection flag */
246 iData = (iData & ~KMsvEntryConnectedFlag) | (aConnected?KMsvEntryConnectedFlag:KMsvEntryClearFlag);
249 inline TBool TMsvEntry::InPreparation() const
250 /** Gets the value of the in preparation flag.
252 @return The value of the in preparation flag */
254 return iData&KMsvEntryInPreparationFlag;
257 inline void TMsvEntry::SetInPreparation(TBool aInPreparation)
258 /** Sets the in-preparation flag.
260 @param aInPreparation Value for the in-preparation flag */
262 iData = (iData & ~KMsvEntryInPreparationFlag) | (aInPreparation?KMsvEntryInPreparationFlag:KMsvEntryClearFlag);
265 inline TInt TMsvEntry::PcSyncCount() const
266 /** Gets the value of the PC synchronisation field.
268 @return The value of the PC synchronisation field */
273 inline void TMsvEntry::IncPcSyncCount()
274 /** Increments the PC synchronisation field. */
279 inline void TMsvEntry::DecPcSyncCount()
280 /** Decrements the PC synchronisation field. */
285 inline TUint TMsvEntry::PersistedFlags() const
287 return iData&KMsvEntryPersistedFlags;
290 inline TUint TMsvEntry::TemporaryFlags() const
292 return iData&KMsvEntryTemporaryFlags;
295 inline TBool TMsvEntry::OffPeak() const
296 /** Gets the off-peak flag.
298 @return The value of the off-peak flag */
300 return iData & KMsvOffPeakFlag;
303 inline void TMsvEntry::SetOffPeak(TBool aOffPeak)
304 /** Sets the off-peak flag.
306 @param aOffPeak Value for off-peak flag. */
308 iData = (iData & ~KMsvOffPeakFlag) | (aOffPeak ? KMsvOffPeakFlag : KMsvEntryClearFlag);
311 inline TBool TMsvEntry::Scheduled() const
312 /** Gets the scheduled flag.
314 @return The value of the scheduled flag */
316 return iData & KMsvScheduledFlag;
319 inline void TMsvEntry::SetScheduled(TBool aScheduled)
320 /** Sets the scheduled flag.
322 @param aScheduled Value for the scheduled flag. */
324 iData = (iData & ~KMsvScheduledFlag) | (aScheduled ? KMsvScheduledFlag : KMsvEntryClearFlag);
327 inline TUint TMsvEntry::SendingState() const
328 /** Gets the sending state.
330 @return The sending state */
332 return (iData & KMsvSendingStateFlags) >> KMsvSendingStateShift;
335 inline void TMsvEntry::SetSendingState(TUint aSendingState)
336 /** Sets the sending state.
338 @param aSendingState The sending state. This must be a value between 0x00
339 and KMsvSendStateMax. */
341 __ASSERT_DEBUG(aSendingState <= KMsvSendStateMax, User::Invariant());
342 iData = iData & ~KMsvSendingStateFlags | aSendingState << KMsvSendingStateShift;
345 inline void TMsvEntry::SetPendingDelete(TBool aPendingDelete)
347 iData = (iData & ~KMsvEntryPendingDeleteFlag) | (aPendingDelete ? KMsvEntryPendingDeleteFlag : KMsvEntryClearFlag);
350 inline TBool TMsvEntry::PendingDelete() const
352 return iData & KMsvEntryPendingDeleteFlag;
356 inline void TMsvEntry::SetDeleteProtected(TBool aDeleteProtected)
358 /** temporary variable used to mask the anonymous global enum. */
359 TInt temp = KMsvEntryDeleteProtected;
360 /** Sets the delete protected state */
361 iMtmData1 = (iMtmData1 & ~KMsvEntryDeleteProtected ) | (aDeleteProtected ? temp : KMsvEntryClearFlag);
364 inline TBool TMsvEntry::DeleteProtected() const
366 /** returns the delete protected state */
367 return iMtmData1 & KMsvEntryDeleteProtected;
370 inline void TMsvEntry::SetForwarded(TBool aForwarded)
372 /** temporary variable used to mask the anonymous global enum. */
373 TInt temp = KMsvEntryForwarded ;
374 /** Sets the forwarded state */
375 iMtmData1 = (iMtmData1 & ~KMsvEntryForwarded) | (aForwarded ? temp : KMsvEntryClearFlag);
378 inline TBool TMsvEntry::Forwarded() const
380 /** returns the forwarded state */
381 return iMtmData1 & KMsvEntryForwarded;
384 inline void TMsvEntry::SetLocallyDeleted(TBool aLocallyDeleted)
386 /** temporary variable used to mask the anonymous global enum. */
387 TInt temp = KMsvEntryLocallyDeleted ;
388 /** Sets the locally deleted state */
389 iMtmData1 = (iMtmData1 & ~KMsvEntryLocallyDeleted) | (aLocallyDeleted ? temp : KMsvEntryClearFlag);
392 inline TBool TMsvEntry::LocallyDeleted() const
394 /** returns the locally deleted state */
395 return iMtmData1 & KMsvEntryLocallyDeleted;
398 //**********************************
399 // TMsvSelectionOrdering
400 //**********************************
402 inline TBool TMsvSelectionOrdering::GroupByType() const
403 /** Gets the group-by-entry-type flag.
405 @return Group-by-entry-type flag */
407 return iGrouping&KMsvGroupByType;
410 inline TBool TMsvSelectionOrdering::GroupStandardFolders() const
411 /** Gets the group-by-standard-folders flag.
413 @return Group-by-standard-folders flag */
415 return iGrouping&KMsvStandardFolders;
418 inline TBool TMsvSelectionOrdering::GroupByPriority() const
419 /** Gets the group-by-priority flag.
421 @return Group-by-priority flag */
423 return iGrouping&KMsvGroupByPriority;
426 inline TBool TMsvSelectionOrdering::GroupByMtm() const
427 /** Gets the group-by-MTM flag.
429 @return Group-by-MTM flag */
431 return iGrouping&KMsvGroupByMtm;
434 inline TBool TMsvSelectionOrdering::ShowInvisibleEntries() const
435 /** Gets the show-invisible-entries flag. Entries whose entry visible flag index
436 field is not set are included in the ordered list only if this is set.
438 @return Show-invisible-entries flag */
440 return iGrouping&KMsvInvisibleFlag;
443 inline void TMsvSelectionOrdering::SetGroupByType(TBool aFlag)
445 iGrouping = (iGrouping & ~KMsvGroupByStandardFolders) | ((aFlag)?KMsvGroupByType:0);
448 inline void TMsvSelectionOrdering::SetGroupStandardFolders(TBool aFlag)
450 iGrouping = (iGrouping & ~KMsvStandardFolders) | ((aFlag)?KMsvGroupByStandardFolders:0);
453 inline void TMsvSelectionOrdering::SetGroupByPriority(TBool aFlag)
455 iGrouping = (iGrouping & ~KMsvGroupByPriority) | ((aFlag)?KMsvGroupByPriority:0);
458 inline void TMsvSelectionOrdering::SetGroupByMtm(TBool aFlag)
460 iGrouping = (iGrouping & ~KMsvGroupByMtm) | ((aFlag)?KMsvGroupByMtm:0);
463 inline void TMsvSelectionOrdering::SetShowInvisibleEntries(TBool aFlag)
465 iGrouping = (iGrouping & ~KMsvInvisibleFlag) | ((aFlag)?KMsvInvisibleFlag:0);
468 inline TMsvSorting TMsvSelectionOrdering::Sorting() const
469 /** Gets the sorting order of entries within groups.
471 @return Sorting order. */
476 inline void TMsvSelectionOrdering::SetSorting(TMsvSorting aSortType)
481 inline TBool TMsvSelectionOrdering::GroupingOn() const
482 /** Tests whether any grouping option has been set.
484 @return ETrue if one or more grouping options have been set, else EFalse */
486 return iGrouping&KMsvAllGroupingFlags;
489 //**********************************
491 //**********************************
493 inline TMsvId CMsvEntryFilter::Service() const
494 /** Gets the service ID set for the filter.
496 @return Service ID set for the filter */
501 inline void CMsvEntryFilter::SetService(TMsvId aServiceId)
502 /** Sets the service ID for the filter.
504 @param aServiceId Service ID for the filter */
506 iServiceId = aServiceId;
509 inline TUid CMsvEntryFilter::Mtm() const
510 /** Gets the MTM UID set for the filter.
512 @return MTM UID set for the filter */
517 inline void CMsvEntryFilter::SetMtm(TUid aMtm)
518 /** Sets the MTM UID for the filter.
520 @param aMtm MTM UID for the filter */
525 inline TUid CMsvEntryFilter::Type() const
526 /** Gets the entry type set for the filter.
528 @return Entry type set for the filter */
533 inline void CMsvEntryFilter::SetType(TUid aType)
534 /** Sets the entry type for the filter.
536 @param aType Entry type for the filter */
541 inline const TTime& CMsvEntryFilter::LastChangeDate() const
542 /** Gets the last change date set for the filter.
544 @return Last change date set for the filter */
549 inline void CMsvEntryFilter::SetLastChangeDate(const TTime& aLastChange)
550 /** Sets the last date change for the filter.
552 This is used to retrieve entries that have changed since a particular date.
554 @param aLastChange Last date change for the filter, specified in Universal
557 iLastChange = aLastChange;
560 inline const TMsvSelectionOrdering& CMsvEntryFilter::Order() const
561 /** Gets the selection ordering set for the filter.
563 @return Selection ordering set for the filter */
568 inline void CMsvEntryFilter::SetOrder(const TMsvSelectionOrdering& aOrder)
569 /** Sets the sort ordering for the filter.
571 @param aOrder Selection ordering for the filter */
576 inline TUid CMsvEntryFilter::SortMtm() const
577 /** Gets the sorting by MTM for the filter.
579 @return Sorting by MTM for the filter */
584 inline void CMsvEntryFilter::SetSortMtm(TUid aSortMtm)
585 /** Sets the sorting by MTM for the filter.
587 @param aSortMtm Sorting by MTM for the filter */