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