|
1 // Copyright (c) 2006-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 |
|
17 #ifndef __CIMAPFOLDERINFO_H__ |
|
18 #define __CIMAPFOLDERINFO_H__ |
|
19 |
|
20 #include <e32base.h> |
|
21 #include <msvstd.h> |
|
22 |
|
23 /** |
|
24 Stores the folder information that is returned by an IMAP server in its responses. |
|
25 @internalTechnology |
|
26 @prototype |
|
27 */ |
|
28 class CImapFolderInfo : public CBase |
|
29 { |
|
30 public: |
|
31 enum TIMapMailboxFlags { |
|
32 /** |
|
33 Message has been read |
|
34 */ |
|
35 ESeen = 0x1, |
|
36 /** |
|
37 Message has been answered |
|
38 */ |
|
39 EAnswered = 0x2, |
|
40 /** |
|
41 Message is "flagged" for urgent/special attention |
|
42 */ |
|
43 EFlagged = 0x4, |
|
44 /** |
|
45 Message is "deleted" for removal by later EXPUNGE |
|
46 */ |
|
47 EDeleted = 0x8, |
|
48 /** |
|
49 Message has not completed composition (marked as a draft). |
|
50 */ |
|
51 EDraft = 0x10, |
|
52 }; |
|
53 |
|
54 IMPORT_C static CImapFolderInfo* NewL(); |
|
55 |
|
56 ~CImapFolderInfo(); |
|
57 |
|
58 IMPORT_C void SetMsvId(TMsvId aMsvId); |
|
59 IMPORT_C TMsvId MsvId() const; |
|
60 |
|
61 IMPORT_C void SetNameL(const TDesC& aName); |
|
62 IMPORT_C const TDesC& Name() const; |
|
63 |
|
64 void SetFlag(TIMapMailboxFlags aFlagId, TBool aValue); |
|
65 IMPORT_C TBool QueryFlag(TIMapMailboxFlags aFlagId) const; |
|
66 |
|
67 void SetExists(TInt aExists); |
|
68 IMPORT_C TInt Exists() const; |
|
69 |
|
70 IMPORT_C void SetRecent(TInt aRecent); |
|
71 IMPORT_C TInt Recent() const; |
|
72 |
|
73 void AddExpungedMessageL(TUint aMessageSequenceNumber); |
|
74 IMPORT_C void ResetExpungedMessages(); |
|
75 IMPORT_C const RArray<TUint> ExpungedMessages(); |
|
76 |
|
77 IMPORT_C void SetMessageFlagsChanged(TBool aMessageFlagsChanged); |
|
78 IMPORT_C TBool MessageFlagsChanged() const; |
|
79 |
|
80 void SetUnseen(TUint aUnseen); |
|
81 IMPORT_C TUint Unseen() const; |
|
82 |
|
83 void SetUidNext(TUint aUidNext); |
|
84 IMPORT_C TUint UidNext() const; |
|
85 |
|
86 void SetUidValidity(TUint aUidValidity); |
|
87 IMPORT_C TUint UidValidity() const; |
|
88 |
|
89 void SetMessages(TInt aMessages); |
|
90 IMPORT_C TInt Messages() const; |
|
91 |
|
92 void SetReadWrite(TBool aMailboxWritable); |
|
93 IMPORT_C TBool GetReadWrite() const; |
|
94 private: |
|
95 TMsvId iMsvId; |
|
96 |
|
97 HBufC* iName; |
|
98 TUint8 iFlags; |
|
99 TInt iExists; |
|
100 TInt iRecent; |
|
101 RArray<TUint> iExpungedMessages; |
|
102 /** |
|
103 This is set to ETrue whenever an unsolicited FETCH response has been received. |
|
104 When ETrue, it means that one or more of the messages in the currently selected |
|
105 mailbox has recently had its flag's changed. |
|
106 */ |
|
107 TBool iMessageFlagsChanged; |
|
108 |
|
109 TBool iMailboxWritable; |
|
110 /** |
|
111 The meaning of iUnseen depends upon the context in which it is being used. |
|
112 In response to a SELECT command, iUnseen is the ID of the first unseen message |
|
113 See section 7.1 of RFC 3501. |
|
114 The CImapFolderInfo object returned by CImapSession::SelectedFolderInfo() will always |
|
115 have this meaning. |
|
116 In response to a STATUS command, iUnseen is the number of unseen messages. |
|
117 See section 6.3.10 of RFC 3501. |
|
118 The CImapFolderInfo object populated by CImapSession::StatusL() will always |
|
119 have this meaning. |
|
120 */ |
|
121 TUint iUnseen; |
|
122 TInt iMessages; |
|
123 TUint iUidNext; |
|
124 TUint iUidValidity; |
|
125 }; |
|
126 #endif // __CIMAPFOLDERINFO_H__ |