|
1 /* |
|
2 * Copyright (c) 2007-2009 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: common email folder base object |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __FSMAILFOLDERBASE_H |
|
20 #define __FSMAILFOLDERBASE_H |
|
21 |
|
22 #include "cfsmailmessage.h" |
|
23 #include "cemailextensionbase.h" |
|
24 |
|
25 /** |
|
26 * class for handling mailbox folder data |
|
27 * |
|
28 * @lib FSFWCommonLib |
|
29 |
|
30 */ |
|
31 class CFSMailFolderBase : public CExtendableEmail |
|
32 { |
|
33 public: |
|
34 |
|
35 /** |
|
36 * Two-phased constructor. |
|
37 * |
|
38 * @param aFolderId folder id in plugin containing folder |
|
39 */ |
|
40 IMPORT_C static CFSMailFolderBase* NewL(const TFSMailMsgId aFolderId); |
|
41 |
|
42 /** |
|
43 * Two-phased constructor. |
|
44 * |
|
45 * @param aFolderId folder id in plugin containing folder |
|
46 */ |
|
47 IMPORT_C static CFSMailFolderBase* NewLC(const TFSMailMsgId aFolderId); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 * |
|
52 */ |
|
53 IMPORT_C virtual ~CFSMailFolderBase(); |
|
54 |
|
55 /** |
|
56 * folder id accessor |
|
57 * |
|
58 * @return folder id |
|
59 */ |
|
60 IMPORT_C TFSMailMsgId GetFolderId() const; |
|
61 |
|
62 /** |
|
63 * parent folder id accessor |
|
64 * |
|
65 * @return parent folder id |
|
66 */ |
|
67 IMPORT_C TFSMailMsgId GetParentFolderId() const; |
|
68 |
|
69 /** |
|
70 * parent folder id mutator |
|
71 * |
|
72 * @param aFolderId parent folder id to be set |
|
73 */ |
|
74 IMPORT_C void SetParentFolderId( const TFSMailMsgId aFolderId ); |
|
75 |
|
76 /** |
|
77 * folder name accessor |
|
78 * |
|
79 * @return folder name |
|
80 */ |
|
81 IMPORT_C TDesC& GetFolderName() const; |
|
82 |
|
83 /** |
|
84 * Folder name mutator. Note ! Some clients may ignore names set for |
|
85 * standard folders (TFSFolderType being EFSInbox, EFSOutbox, EFSDraftsFolder, |
|
86 * EFSSentFolder, or EFSDeleted) and display own localized names for them. |
|
87 * E.g. Email UI behaves this way. |
|
88 * |
|
89 * @param aFolderName folder name to be set |
|
90 */ |
|
91 IMPORT_C void SetFolderName(const TDesC& aFolderName); |
|
92 |
|
93 /** |
|
94 * folder type accessor |
|
95 * |
|
96 * @return folder type |
|
97 */ |
|
98 IMPORT_C TFSFolderType GetFolderType() const; |
|
99 |
|
100 /** |
|
101 * folder type mutator |
|
102 * |
|
103 * @param aFolderType folder type to be set |
|
104 */ |
|
105 IMPORT_C void SetFolderType( const TFSFolderType aFolderType ); |
|
106 |
|
107 /** |
|
108 * returns id of mailbox containing this folder |
|
109 * |
|
110 * @return mailbox id |
|
111 */ |
|
112 IMPORT_C TFSMailMsgId GetMailBoxId() const; |
|
113 |
|
114 /** |
|
115 * folder mailbox id mutator |
|
116 * |
|
117 * @param aMailBoxId mailbox id to be set |
|
118 */ |
|
119 IMPORT_C void SetMailBoxId( const TFSMailMsgId aMailBoxId ); |
|
120 |
|
121 /** |
|
122 * returns message count contained by this folder |
|
123 * |
|
124 * @return message count |
|
125 */ |
|
126 IMPORT_C TUint GetMessageCount() const; |
|
127 |
|
128 /** |
|
129 * returns unread message count contained by this folder |
|
130 * |
|
131 * @return unread message count |
|
132 */ |
|
133 IMPORT_C TUint GetUnreadCount() const; |
|
134 |
|
135 /** |
|
136 * returns unseen message count contained by this folder |
|
137 * |
|
138 * @return unseen message count |
|
139 */ |
|
140 IMPORT_C TUint GetUnseenCount() const; |
|
141 |
|
142 /** |
|
143 * returns subfolder count contained by this folder |
|
144 * |
|
145 * @return subfolder count |
|
146 */ |
|
147 IMPORT_C TUint GetSubFolderCount() const; |
|
148 |
|
149 /** |
|
150 * set message count contained by this folder |
|
151 * |
|
152 * @param aMessageCount message count |
|
153 */ |
|
154 IMPORT_C void SetMessageCount( const TUint aMessageCount ); |
|
155 |
|
156 /** |
|
157 * set unread message count contained by this folder |
|
158 * |
|
159 * @param aMessageCount unread message count |
|
160 */ |
|
161 IMPORT_C void SetUnreadCount( const TUint aMessageCount ); |
|
162 |
|
163 /** |
|
164 * set unseen message count contained by this folder |
|
165 * |
|
166 * @param aMessageCount unseen message count |
|
167 */ |
|
168 IMPORT_C void SetUnseenCount( const TUint aMessageCount ); |
|
169 |
|
170 /** |
|
171 * set subfolder count contained by this folder |
|
172 * |
|
173 * @param subfolder count |
|
174 */ |
|
175 IMPORT_C void SetSubFolderCount( const TUint aMessageCount ); |
|
176 |
|
177 /** |
|
178 * blocks copying to this folder from given folder types |
|
179 * |
|
180 * @param aFolderTypes blocked folder types |
|
181 * @param aMailBoxStatus mailbox status (online / offline) when |
|
182 * blocking is done |
|
183 */ |
|
184 IMPORT_C void BlockCopyFromL( RArray<TFSFolderType> aFolderTypes, |
|
185 TFSMailBoxStatus aMailBoxStatus ); |
|
186 /** |
|
187 * blocks moving to this folder from given folder types |
|
188 * |
|
189 * @param aFolderTypes blocked folder types |
|
190 * @param aMailBoxStatus mailbox status (online / offline) when |
|
191 * blocking is done |
|
192 */ |
|
193 IMPORT_C void BlockMoveFromL( RArray<TFSFolderType> aFolderTypes, |
|
194 TFSMailBoxStatus aMailBoxStatus ); |
|
195 |
|
196 protected: |
|
197 |
|
198 /** |
|
199 * C++ default constructor. |
|
200 */ |
|
201 CFSMailFolderBase(); |
|
202 |
|
203 /** |
|
204 * folder id |
|
205 */ |
|
206 TFSMailMsgId iFolderId; |
|
207 |
|
208 /** |
|
209 * blocked folders in copying |
|
210 */ |
|
211 RArray<TFSFolderType> iCopyOfflineBlocked; |
|
212 RArray<TFSFolderType> iCopyOnlineBlocked; |
|
213 |
|
214 /** |
|
215 * blocked folders in moving |
|
216 */ |
|
217 RArray<TFSFolderType> iMoveOfflineBlocked; |
|
218 RArray<TFSFolderType> iMoveOnlineBlocked; |
|
219 |
|
220 private: |
|
221 |
|
222 /** |
|
223 * Two-phased constructor |
|
224 */ |
|
225 void ConstructL( const TFSMailMsgId aFolderId ); |
|
226 |
|
227 private: // data |
|
228 |
|
229 /** |
|
230 * folder name |
|
231 */ |
|
232 HBufC* iFolderName; |
|
233 |
|
234 /** |
|
235 * folder type |
|
236 */ |
|
237 TFSFolderType iFolderType; |
|
238 |
|
239 /** |
|
240 * folder total message count |
|
241 */ |
|
242 TUint iMessageCount; |
|
243 |
|
244 /** |
|
245 * folder unread message count |
|
246 */ |
|
247 TUint iUnreadMessageCount; |
|
248 |
|
249 /** |
|
250 * folder unseen message count |
|
251 */ |
|
252 TUint iUnseenCount; |
|
253 |
|
254 /** |
|
255 * mailbox id |
|
256 */ |
|
257 TFSMailMsgId iMailBoxId; |
|
258 |
|
259 |
|
260 /** |
|
261 * parent folder id |
|
262 */ |
|
263 TFSMailMsgId iParentFolderId; |
|
264 |
|
265 /** |
|
266 * subfolder count |
|
267 */ |
|
268 TUint iSubFolderCount; |
|
269 }; |
|
270 |
|
271 #endif // __FSMAILFOLDERBASE_H |