|
1 /* |
|
2 * Copyright (c) 2007 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 the License "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: Defination of class CMessagingAccessFolder |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __ACCESSFOLDER_H |
|
20 #define __ACCESSFOLDER_H |
|
21 |
|
22 |
|
23 /** |
|
24 * This class provides function to get a list of measage header |
|
25 * in a sorted order present in a folder . Message Headers are |
|
26 * retrieved as per searching options provided by user. |
|
27 */ |
|
28 class CMessagingAccessFolder : public CBase |
|
29 { |
|
30 |
|
31 public: |
|
32 |
|
33 /** |
|
34 * Two-phased constructor. |
|
35 * @param aServerSession Object of CMsvSession Class which |
|
36 * represents a channel of communication between a client thread |
|
37 * and the Message Server thread. |
|
38 */ |
|
39 static CMessagingAccessFolder* NewL( CMsvSession& aServerSession ); |
|
40 |
|
41 /** |
|
42 * Destructor. |
|
43 */ |
|
44 ~CMessagingAccessFolder(); |
|
45 |
|
46 private: |
|
47 |
|
48 /** |
|
49 * Constructor. |
|
50 * @param aServerSession Object of CMsvSession Class which |
|
51 * represents a channel of communication between a client thread |
|
52 * and the Message Server thread . |
|
53 * @return void |
|
54 */ |
|
55 CMessagingAccessFolder( CMsvSession& aServerSession ); |
|
56 |
|
57 |
|
58 public: |
|
59 |
|
60 /** |
|
61 * Gives Message id list of messages |
|
62 * @param aFolderId Folder to be used (Inbox/outbox/send/...) |
|
63 * @param aFilterParams Filter parameters |
|
64 * @param aEntrySelection output pararmeter for the result id array |
|
65 */ |
|
66 void GetIdListL(TMsvId aFolderId , |
|
67 CFilterParamInfo* aFilterParams, |
|
68 CMsvEntrySelection*& aEntrySelection ); |
|
69 |
|
70 /** |
|
71 * Gives next header based on inputs |
|
72 * @param aFilterParams Filter parameters |
|
73 * @param aEntrySelection array of message ids on which filteration to be done |
|
74 * @param aIndex starting position on aEntrySelection to be start search |
|
75 * @param aHeader output pararmeter for the result header |
|
76 */ |
|
77 void GetNextHeaderL( CFilterParamInfo* aFilterParams, |
|
78 CMsvEntrySelection* aEntrySelection, |
|
79 TInt& aIndex, |
|
80 CMessageHeader*& aHeader ); |
|
81 private: |
|
82 |
|
83 /** |
|
84 * Gives the list of message headers |
|
85 * @return void |
|
86 */ |
|
87 void GetListL(); |
|
88 |
|
89 /** |
|
90 * Gets next header which matches filter criteria |
|
91 * @param aEntrySelection Message Id list to be filtered for headers |
|
92 * @param aIndex starting position for filterting |
|
93 * @param aHeader return parameter for message header |
|
94 * @return void |
|
95 */ |
|
96 void GetNextFilteredHeaderL( CMsvEntrySelection* aEntrySelection, |
|
97 TInt& aIndex, |
|
98 CMessageHeader*& aHeader ); |
|
99 |
|
100 /** |
|
101 * Initializes the MtmID array by the Mtm string passed by user.\ |
|
102 */ |
|
103 void InitializeMtmArray(); |
|
104 |
|
105 /** |
|
106 * Checks whether filter on message id is set |
|
107 * @param aMessageId The message id to which user want to apply filter |
|
108 * @return TBool ETrue if filter on message id is set and entry matches with filter |
|
109 */ |
|
110 TBool FilterId( const TMsvId aMessageId) const; |
|
111 |
|
112 /** |
|
113 * Checks whether filter on Mtm is set |
|
114 * @param aEntry The message entry to which user want to apply filter |
|
115 * @return TBool ETrue if filter on mtm is set and entry matches with filter |
|
116 */ |
|
117 TBool FilterMtm( const TMsvEntry& aEntry ) const; |
|
118 |
|
119 /** |
|
120 * Checks whether filter on sender is set |
|
121 * @param aEntry The message entry to which user want to apply filter |
|
122 * @return TBool ETrue if filter on sender is set and entry matches with filter |
|
123 */ |
|
124 TBool FilterFrom( const TMsvEntry& aEntry ) const; |
|
125 |
|
126 /** |
|
127 * Checks whether filter on subject is set |
|
128 * @param aEntry The message entry to which user want to apply filter |
|
129 * @return TBool ETrue if filter on subject is set and entry matches with filter |
|
130 */ |
|
131 TBool FilterSubject( const TMsvEntry& aEntry ) const; |
|
132 |
|
133 /** |
|
134 * Checks whether filter on date is set |
|
135 * @param aEntry The message entry to which user want to apply filter |
|
136 * @return TBool ETrue if filter on date is set and entry matches with filter |
|
137 */ |
|
138 TBool FilterDate( const TMsvEntry& aEntry ) const; |
|
139 |
|
140 |
|
141 private: |
|
142 |
|
143 /** |
|
144 * Represents a channel of communication between a client thread |
|
145 * and the Message Server thread |
|
146 */ |
|
147 CMsvSession& iServerSession; |
|
148 |
|
149 /** |
|
150 * Message Id list |
|
151 */ |
|
152 CMsvEntrySelection* iEntrySelection; |
|
153 |
|
154 /** |
|
155 * Folder id from which list of message headers can be retrieved |
|
156 */ |
|
157 TMsvId iFolderId; |
|
158 |
|
159 /** |
|
160 * Folder id from which list of message headers can be retrieved |
|
161 */ |
|
162 RArray<TUid> iMtmArrayId; |
|
163 |
|
164 /** |
|
165 * Filter variable |
|
166 */ |
|
167 CFilterParamInfo* iFilter; |
|
168 |
|
169 }; |
|
170 |
|
171 #endif __ACCESSFOLDER_H |