1        ConeĀ©
2
3MAIL::ACCOUNT::READT(3x)Cone: COnsole Newsreader And EMAIL::ACCOUNT::READT(3x)
4
5
6

NAME

8       mail::account::readTopLevelFolders - Enumerate top-level folders
9

SYNOPSIS

11       #include <libmail/mail.H>
12
13
14       class myCallback : public mail::callback {
15       public:
16           void success(std::string msg);
17           void fail(std::string msg);
18       };
19
20       class myFolderCallback : public mail::callback::folderlist {
21       public:
22           void success(const std::vector<const mail::folder *> &folders);
23       };
24
25       mail::account *account;
26
27       account->readTopLevelFolders(myFolderCallback &folderCallback,
28                                    myCallback &callback);
29

USAGE

31       A mail account contains folders that are arranged in a tree-like
32       hierarchy.  mail::account::readTopLevelFolders enumerates the folders
33       at the top level of the mail account's hierarchy. The rest of the
34       folders may be enumerated by recursively invoking the
35       mail::folder::readSubFolders(3x) method.
36

RETURN CODES AND CALLBACKS

38       The application must wait until callback's success or fail method is
39       invoked. The success method is invoked when this request is succesfully
40       processed. The fail method is invoked if this request cannot be
41       processed. The application must not destroy callback until either the
42       success or fail method is invoked.
43
44           Note
45           callback's fail method may be invoked even after other callback
46           methods were invoked. This indicates that the request was partially
47           completed before the error was encountered.
48
49           Note
50           The application must not destroy folderCallback until this request
51           fails or succeeds.  folderCallback's success method is invoked just
52           before the callback's success method.
53
54       The folderCallback.success method receives a vector of pointers to
55       mail::folder objects, that enumerates the folders at the top level of
56       the mail account's folder hierarchy.
57
58           Note
59           mail::folders are linked to their corresponding mail::accounts. A
60           mail::folder created by one mail::account may not be used with a
61           different mail::folder. All mail::folders created by a
62           mail::account are invalidated when this mail::account object is
63           destroyed. Note that the mail::folder objects are not automatically
64           destroyed; the application is still responsible for destroying any
65           remaining mail::folders, after their a mail::account is destroyed.
66
67           Note
68           The folderCallback.success method receives a (possibly empty)
69           vector of pointers to mail::folder objects. These objects will be
70           destroyed when folderCallback.success terminates. The application
71           must use mail::folder::clone(3x) to create copies of mail::folder
72           objects it wants to use later.
73
74           Note
75           Both folderCallback.success and myCallback.success method will be
76           invoked if this request succeeds.  folderCallback.success will be
77           invoked before myCallback.success (since by definition this
78           indicates that the request has been completed).
79
80       callback's success method is then invoked, after all mail::folder
81       objects are destroyed.
82
83       The list of top-level folders depends on the mail account's type. Local
84       mail accounts have a single folder object representing the
85       locally-configured mail folder directory.  inbox and maildir accounts
86       also have a single folder named INBOX.  INBOX represents the system
87       mail folder where incoming mail is delivered.  pop3 accounts have a
88       single, lonely, INBOX folder.  imap accounts have a INBOX folder in
89       addition to top level folders identified by the IMAP server (using the
90       IMAP NAMESPACE extension). IMAP servers that do not explicitly identify
91       folder collections will have a single mail::folder object, representing
92       the root of the IMAP server's namespace.
93

SEE ALSO

95       mail::folder::readSubFolders(3x), mail::folder::clone(3x)..
96

AUTHOR

98       Sam Varshavchik
99
100
101
102ConeĀ©                             08/25/2016          MAIL::ACCOUNT::READT(3x)
Impressum