author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Thu, 17 Dec 2009 09:09:50 +0200 | |
changeset 26 | 5d0ec8b709be |
parent 10 | fc9cf246af83 |
permissions | -rw-r--r-- |
5 | 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 |
*/ |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
28 |
class CMessagingAccessFolder : public CActive |
5 | 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: |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
59 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
60 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
61 |
* Sets message input parameters |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
62 |
* Ownership is transferred to this class |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
63 |
* @param aNotifyCallback Bydefault it is NULL to make function |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
64 |
* call synchronous , if provided then function call is asynchronous |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
65 |
* @param aAsyncRequestObserver Asynchronous request observer |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
66 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
67 |
void SetInputParamsL( CMsgCallbackBase* aNotifyCallback = NULL, |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
68 |
MAsyncRequestObserver* aAsyncRequestObserver = NULL); |
5 | 69 |
|
70 |
/** |
|
71 |
* Gives Message id list of messages |
|
72 |
* @param aFolderId Folder to be used (Inbox/outbox/send/...) |
|
73 |
* @param aFilterParams Filter parameters |
|
74 |
* @param aEntrySelection output pararmeter for the result id array |
|
75 |
*/ |
|
76 |
void GetIdListL(TMsvId aFolderId , |
|
77 |
CFilterParamInfo* aFilterParams, |
|
78 |
CMsvEntrySelection*& aEntrySelection ); |
|
79 |
||
80 |
/** |
|
81 |
* Gives next header based on inputs |
|
82 |
* @param aFilterParams Filter parameters |
|
83 |
* @param aEntrySelection array of message ids on which filteration to be done |
|
84 |
* @param aIndex starting position on aEntrySelection to be start search |
|
85 |
* @param aHeader output pararmeter for the result header |
|
86 |
*/ |
|
87 |
void GetNextHeaderL( CFilterParamInfo* aFilterParams, |
|
88 |
CMsvEntrySelection* aEntrySelection, |
|
89 |
TInt& aIndex, |
|
90 |
CMessageHeader*& aHeader ); |
|
91 |
private: |
|
92 |
||
93 |
/** |
|
94 |
* Gives the list of message headers |
|
95 |
* @return void |
|
96 |
*/ |
|
97 |
void GetListL(); |
|
98 |
||
99 |
/** |
|
100 |
* Gets next header which matches filter criteria |
|
101 |
* @param aEntrySelection Message Id list to be filtered for headers |
|
102 |
* @param aIndex starting position for filterting |
|
103 |
* @param aHeader return parameter for message header |
|
104 |
* @return void |
|
105 |
*/ |
|
106 |
void GetNextFilteredHeaderL( CMsvEntrySelection* aEntrySelection, |
|
107 |
TInt& aIndex, |
|
108 |
CMessageHeader*& aHeader ); |
|
109 |
||
110 |
/** |
|
111 |
* Initializes the MtmID array by the Mtm string passed by user.\ |
|
112 |
*/ |
|
113 |
void InitializeMtmArray(); |
|
114 |
||
115 |
/** |
|
116 |
* Checks whether filter on message id is set |
|
117 |
* @param aMessageId The message id to which user want to apply filter |
|
118 |
* @return TBool ETrue if filter on message id is set and entry matches with filter |
|
119 |
*/ |
|
120 |
TBool FilterId( const TMsvId aMessageId) const; |
|
121 |
||
122 |
/** |
|
123 |
* Checks whether filter on Mtm is set |
|
124 |
* @param aEntry The message entry to which user want to apply filter |
|
125 |
* @return TBool ETrue if filter on mtm is set and entry matches with filter |
|
126 |
*/ |
|
127 |
TBool FilterMtm( const TMsvEntry& aEntry ) const; |
|
128 |
||
129 |
/** |
|
130 |
* Checks whether filter on sender is set |
|
131 |
* @param aEntry The message entry to which user want to apply filter |
|
132 |
* @return TBool ETrue if filter on sender is set and entry matches with filter |
|
133 |
*/ |
|
134 |
TBool FilterFrom( const TMsvEntry& aEntry ) const; |
|
135 |
||
136 |
/** |
|
137 |
* Checks whether filter on subject is set |
|
138 |
* @param aEntry The message entry to which user want to apply filter |
|
139 |
* @return TBool ETrue if filter on subject is set and entry matches with filter |
|
140 |
*/ |
|
141 |
TBool FilterSubject( const TMsvEntry& aEntry ) const; |
|
142 |
||
143 |
/** |
|
144 |
* Checks whether filter on date is set |
|
145 |
* @param aEntry The message entry to which user want to apply filter |
|
146 |
* @return TBool ETrue if filter on date is set and entry matches with filter |
|
147 |
*/ |
|
148 |
TBool FilterDate( const TMsvEntry& aEntry ) const; |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
149 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
150 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
151 |
* Inherited from CActive class |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
152 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
153 |
virtual void DoCancel(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
154 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
155 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
156 |
* Inherited from CActive class |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
157 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
158 |
virtual void RunL(); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
159 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
160 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
161 |
* Activates the request and call SetActive() function |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
162 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
163 |
void ActivateRequest(TInt aReason); |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
164 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
165 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
166 |
* Gives the result for notification request. |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
167 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
168 |
void NotifyRequestResult(TInt aReason, CMsvEntrySelection* aEntrySelection, CFilterParamInfo* aFilter ); |
5 | 169 |
|
170 |
||
171 |
private: |
|
172 |
||
173 |
/** |
|
174 |
* Represents a channel of communication between a client thread |
|
175 |
* and the Message Server thread |
|
176 |
*/ |
|
177 |
CMsvSession& iServerSession; |
|
178 |
||
179 |
/** |
|
180 |
* Message Id list |
|
181 |
*/ |
|
182 |
CMsvEntrySelection* iEntrySelection; |
|
183 |
||
184 |
/** |
|
185 |
* Folder id from which list of message headers can be retrieved |
|
186 |
*/ |
|
187 |
TMsvId iFolderId; |
|
188 |
||
189 |
/** |
|
190 |
* Folder id from which list of message headers can be retrieved |
|
191 |
*/ |
|
192 |
RArray<TUid> iMtmArrayId; |
|
193 |
||
194 |
/** |
|
195 |
* Filter variable |
|
196 |
*/ |
|
197 |
CFilterParamInfo* iFilter; |
|
10
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
198 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
199 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
200 |
* A callback notification for asynchronous function |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
201 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
202 |
CMsgCallbackBase* iNotifyCallback; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
203 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
204 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
205 |
* Asynchronous request observer, Used to get infromed of completion or request |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
206 |
*/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
207 |
MAsyncRequestObserver* iAsyncRequestObserver; |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
208 |
|
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
209 |
/** |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
210 |
* Flag which specifies to cancel the request |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
211 |
* but not to call the NotifyResultL |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
212 |
* If false doesnot call the NotifyResultL |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
213 |
**/ |
fc9cf246af83
Revision: 200931
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
5
diff
changeset
|
214 |
TBool iCallNotifyForCancelFlag; |
5 | 215 |
|
216 |
}; |
|
217 |
||
218 |
#endif __ACCESSFOLDER_H |