1mail::folder::readFoldermIaniflo:(:3fxo)lder Native APImraeifle:r:efnocleder::readFolderInfo(3x)
2
3
4
6 mail::folder::readFolderInfo - Get folder status
7
9 #include <libmail/mail.H>
10
11
12 class myCallback : public mail::callback {
13 public:
14 void success(std::string msg);
15 void fail(std::string msg);
16 };
17
18 mail::folder *folder;
19
20 class myFolderInfoCallback : public mail::callback::folderInfo {
21
22 public:
23 void success()
24 {
25 displayFolderStatus(messageCount, unreadCount);
26 }
27 };
28
29
30
31 folder->readFolderInfo (myFolderInfoCallback &folderInfoCallback,
32 myCallback &callback);
33
35 This function reads the current status of folder, which may refer to
36 any folder in the mail account (not necessarily the currently open
37 folder).
38
39 folderInfoCallback's success method will be invoked when the folder's
40 status is determined. The following variables will be initialized
41 prior to invoking success:
42
43 messageCount
44 Total number of messages in the folder.
45
46 unreadCount
47 Total number of unread messages in the folder.
48
49 fastInfo
50 This field should be initialized before calling this function.
51 If set to true the message counts are returned only if they can
52 be computed quickly. Otherwise folderInfoCallback's success
53 method will not be invoked at all, but callback's success method
54 will still be invoked.
55
56 If this field is set to false (the default), the message counts
57 are returned in all cases.
58
59 Note: folderInfoCallback's success method will be invoked just
60 prior to callback's success method (unless fastInfo is true and
61 message counts cannot be computed cheaply). The application
62 must still wait until callback's success, or fail is invoked,
63 and must not destroy the mail::callback::folderInfo object until
64 either method has been invoked.
65
66 Note: Message count computation is considered cheap with
67 maildir-based and POP3-based accounts. Message count computa‐
68 tion is considered expensive with mbox-based accounts, and with
69 IMAP-based accounts.
70
72 The application must wait until callback's success or fail method is
73 invoked. The success method is invoked when this request is succes‐
74 fully processed. The fail method is invoked if this request cannot be
75 processed. The application must not destroy callback until either the
76 success or fail method is invoked.
77
78 Note: callback's fail method may be invoked even after other
79 callback methods were invoked. This indicates that the request
80 was partially completed before the error was encountered.
81
83 mail::account::checkNewMail(3x), mail::folder::open(3x).
84
85
86
87 10 April 2006mail::folder::readFolderInfo(3x)