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

NAME

8       mail::folder::readSubFolders - Enumerate subfolders
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::folder *folder;
26
27       folder->readSubFolders(myFolderCallback &folderCallback,
28                              myCallback &callback);
29

USAGE

31       A mail account contains folders that are arranged in a tree-like
32       hierarchy.  mail::folder::readSubFolders enumerates folder's
33       subfolders.
34
35           Note
36           Use mail::folder::hasSubFolders(3x) to check if folder contains
37           subfolders, and invoke mail::folder::readSubFolders only if
38           mail::folder::hasSubFolders returns true.
39

RETURN CODES AND CALLBACKS

41       The application must wait until callback's success or fail method is
42       invoked. The success method is invoked when this request is succesfully
43       processed. The fail method is invoked if this request cannot be
44       processed. The application must not destroy callback until either the
45       success or fail method is invoked.
46
47           Note
48           callback's fail method may be invoked even after other callback
49           methods were invoked. This indicates that the request was partially
50           completed before the error was encountered.
51
52           Note
53           The application must not destroy folderCallback until this request
54           fails or succeeds.  folderCallback's success method is invoked just
55           before the callback's success method.
56
57       The folderCallback.success method receives a vector of pointers to
58       mail::folder objects, that enumerates folder's subfolders. The vector
59       will be empty if folder does not have any subfolders.
60
61           Note
62           Subfolders received by mail::callback::folder::success are linked
63           to the same account that folder is linked to.
64
65           Note
66           mail::folders are linked to their corresponding mail::accounts. A
67           mail::folder created by one mail::account may not be used with a
68           different mail::folder. All mail::folders created by a
69           mail::account are invalidated when this mail::account object is
70           destroyed. Note that the mail::folder objects are not automatically
71           destroyed; the application is still responsible for destroying any
72           remaining mail::folders, after their a mail::account is destroyed.
73
74           Note
75           The folderCallback.success method receives a (possibly empty)
76           vector of pointers to mail::folder objects. These objects will be
77           destroyed when folderCallback.success terminates. The application
78           must use mail::folder::clone(3x) to create copies of mail::folder
79           objects it wants to use later.
80
81           Note
82           Both folderCallback.success and myCallback.success method will be
83           invoked if this request succeeds.  folderCallback.success will be
84           invoked before myCallback.success (since by definition this
85           indicates that the request has been completed).
86
87       callback's success method is then invoked, after all mail::folder
88       objects are destroyed.
89

SEE ALSO

91       mail::account::readTopLevelFolders(3x), mail::folder::clone(3x),
92       mail::folder::getParentFolder(3x).
93

AUTHOR

95       Sam Varshavchik
96
97
98
99ConeĀ©                             08/25/2016          MAIL::FOLDER::READSU(3x)
Impressum