|
1 /* |
|
2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Message store sort result row set. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MSGSTORE_SORT_RESULT_ROWSET_ |
|
20 #define MSGSTORE_SORT_RESULT_ROWSET_ |
|
21 |
|
22 #include "ContainerStoreSortingTable.h" |
|
23 #include "MsgStoreTypes.h" |
|
24 |
|
25 // ================================== |
|
26 // CLASS: CMsgStoreSortResultRowSet |
|
27 // ================================== |
|
28 class CMsgStoreSortResultRowSet : public CBase |
|
29 { |
|
30 |
|
31 public: |
|
32 static CMsgStoreSortResultRowSet* NewL( const TMsgStoreSortCriteria& aSortCriteria, |
|
33 TInt aMessageIdColNum, |
|
34 TInt aReceivedDateColNum, |
|
35 TInt aReadUnreadColNum, |
|
36 TInt aPriotiryColNum, |
|
37 TInt aFlagStatusColNum, |
|
38 TInt aSizeColNum, |
|
39 TInt aAttachmentFlagColNum ); |
|
40 |
|
41 virtual ~CMsgStoreSortResultRowSet(); |
|
42 |
|
43 virtual void ToTopL(); |
|
44 virtual void ToEndL(); |
|
45 |
|
46 virtual TBool HasMorePreviousL(); |
|
47 virtual TBool HasMoreNextL(); |
|
48 |
|
49 //CMsgStoreSortResultRow* NextL(); |
|
50 virtual TMsgStoreId NextL(); |
|
51 |
|
52 //CMsgStoreSortResultRow* PreviousL(); |
|
53 virtual TMsgStoreId PreviousL(); |
|
54 |
|
55 virtual void GotoL( TContainerId aMessageId ); |
|
56 virtual void GotoL( const TDesC& aStartWith, TMsgStoreIteratorDirection aDirection ); |
|
57 |
|
58 //for UI "group" support |
|
59 virtual TBool SkipCurrentGroupL( TMsgStoreIteratorDirection aDirection, TUint& aItemsInPreviousGroup ); |
|
60 |
|
61 virtual TInt GroupCountL( RArray<TUint>& aItemsInGroup ); |
|
62 |
|
63 virtual void SortedIdsL( RArray<TContainerId>& aIdArray ); |
|
64 |
|
65 virtual TInt IndexOfL( TContainerId aMessageId ); |
|
66 |
|
67 virtual void SortedIdsAndGroupCountL( RArray<TContainerId>& aIdArray, RArray<TUint>& aItemsInGroup ); |
|
68 |
|
69 RDbView& DbView() { return iDbView; }; |
|
70 |
|
71 void SetPropertyNamesL( RPointerArray<HBufC8>& aPropertyNames ); |
|
72 |
|
73 const RPointerArray<HBufC8>& PropertyNames() { return iPropertyNames; } |
|
74 |
|
75 TMsgStoreId FolderId(){ return iFolderId; } |
|
76 |
|
77 void SetAutoRefresh( TBool aFlag ) { iIsAutoRefresh = aFlag; } |
|
78 |
|
79 virtual void MessageUpdate ( TContainerId aMessageId, |
|
80 TContainerId aFolderId, |
|
81 TMsgStoreOperation aOperation, |
|
82 TUint aFieldsChanged, |
|
83 const TDesC& aFrom, |
|
84 const TDesC& aTo, |
|
85 const TDesC& aSubject, |
|
86 TInt64 aDate); |
|
87 |
|
88 virtual void FolderDeleted ( TContainerId aFolderId ); |
|
89 |
|
90 virtual void MailBoxDeleted ( TContainerId aMailBoxId ); |
|
91 |
|
92 protected: |
|
93 |
|
94 CMsgStoreSortResultRowSet( const TMsgStoreSortCriteria& aSortCriteria, |
|
95 TInt aMessageIdColNum, |
|
96 TInt aReceivedDateColNum, |
|
97 TInt aReadUnreadColNum, |
|
98 TInt aPriotiryColNum, |
|
99 TInt aFlagStatusColNum, |
|
100 TInt aSizeColNum, |
|
101 TInt aAttachmentFlagColNum ); |
|
102 |
|
103 void ConstructL(); |
|
104 |
|
105 TMsgStoreId GetRowL(); |
|
106 |
|
107 virtual TInt ReEvaluate(); |
|
108 |
|
109 TMsgStoreId iMailBoxId; |
|
110 TMsgStoreId iFolderId; |
|
111 TMsgStoreSortByField iSortBy; |
|
112 TMsgStoreSortOrder iSortOrder; |
|
113 TBool iIsAutoRefresh; |
|
114 |
|
115 private: |
|
116 RDbView iDbView; |
|
117 TInt iMessageIdColNum; |
|
118 TInt iReceivedDateColNum; |
|
119 TInt iReadUnreadColNum; |
|
120 TInt iPriotiryColNum; |
|
121 TInt iFlagStatusColNum; |
|
122 TInt iSizeColNum; |
|
123 TInt iAttachmentFlagColNum; |
|
124 RPointerArray<HBufC8> iPropertyNames; |
|
125 __LOG_DECLARATION |
|
126 }; |
|
127 |
|
128 #endif /*MSGSTORE_SORT_RESULT_ROWSET_*/ |