|
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __CIMAPSYNCDOWNLOADRULES_H__ |
|
17 #define __CIMAPSYNCDOWNLOADRULES_H__ |
|
18 |
|
19 #include <e32std.h> |
|
20 #include <imapset.h> |
|
21 |
|
22 /** |
|
23 Maximum number of download rules that can be stored |
|
24 |
|
25 @publishedPartner |
|
26 @released |
|
27 */ |
|
28 const TInt KMaxImapSyncDownloadRules = 32; |
|
29 |
|
30 /** |
|
31 Stores the download rules to be used during the IMAP synchronisation phase. |
|
32 |
|
33 Each rule consists of a bearer types field, and a set of get mail options. |
|
34 The bearer types are defined by the TCommDbBearer enumeration and it is |
|
35 possible to specify multiple bearer types for one rule by performing a |
|
36 bitwise OR operation on the values from the enumeration and passing the |
|
37 resulting value to the various APIs. The get mail options are defined by |
|
38 the TImImap4GetPartialMailInfo structure. |
|
39 |
|
40 There are two sets of download rules, one set for the inbox and one set for |
|
41 other folders. Generally each of the APIs takes a flag to indicate which set |
|
42 to operate upon. |
|
43 |
|
44 @publishedPartner |
|
45 @released |
|
46 */ |
|
47 class CImapSyncDownloadRules : public CBase |
|
48 { |
|
49 public: |
|
50 /** |
|
51 Defines the type of folder (inbox or other folder) |
|
52 */ |
|
53 enum TRulesType |
|
54 { |
|
55 EInboxRulesType, |
|
56 EFolderRulesType |
|
57 }; |
|
58 |
|
59 public: |
|
60 IMPORT_C static CImapSyncDownloadRules* NewL(); |
|
61 IMPORT_C static CImapSyncDownloadRules* NewLC(); |
|
62 ~CImapSyncDownloadRules(); |
|
63 |
|
64 IMPORT_C CImapSyncDownloadRules* CopyL(); |
|
65 IMPORT_C CImapSyncDownloadRules* CopyLC(); |
|
66 IMPORT_C TInt AddRuleL(TRulesType aType, TInt aPos, TUint32 aBearerTypes, const TImImap4GetPartialMailInfo& aMailInfo); |
|
67 IMPORT_C TBool DeleteRuleL(TRulesType aType, TInt aPos); |
|
68 IMPORT_C TInt DeleteBearerTypesL(TRulesType aType, TUint32 aBearerTypes, TBool& aRuleRemoved); |
|
69 IMPORT_C TBool GetRuleL(TRulesType aType, TInt aPos, TUint32& aBearerTypes, TImImap4GetPartialMailInfo& aMailInfo) const; |
|
70 IMPORT_C TInt GetMailInfoL(TRulesType aType, TUint32 aBearerTypes, TImImap4GetPartialMailInfo& aMailInfo) const; |
|
71 IMPORT_C void Reset(); |
|
72 |
|
73 private: |
|
74 CImapSyncDownloadRules(); |
|
75 void ConstructL(); |
|
76 |
|
77 private: |
|
78 struct TImapSyncDownloadRules |
|
79 { |
|
80 TUint32 iBearerTypes; |
|
81 TImImap4GetPartialMailInfo iMailInfo; |
|
82 }; |
|
83 |
|
84 private: |
|
85 RArray<TImapSyncDownloadRules> iRulesList[2]; |
|
86 }; |
|
87 |
|
88 #endif //__CIMAPSYNCDOWNLOADRULES_H__ |