1mail::folder::readSubFolmdaeirls:(:3fxo)lder Native APImraeifle:r:efnocleder::readSubFolders(3x)
2
3
4

NAME

6       mail::folder::readSubFolders - Enumerate subfolders
7

SYNOPSIS

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       class myFolderCallback : public mail::callback::folderlist {
19       public:
20           void success(const std::vector<const mail::folder *> &folders);
21       };
22
23       mail::folder *folder;
24
25
26
27       folder->readSubFolders  (myFolderCallback  &folderCallback,  myCallback
28       &callback);
29

USAGE

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

RETURN CODES AND CALLBACKS

39       The  application  must  wait until callback's success or fail method is
40       invoked.  The success method is invoked when this  request  is  succes‐
41       fully  processed.  The fail method is invoked if this request cannot be
42       processed.  The application must not destroy callback until either  the
43       success or fail method is invoked.
44
45              Note:  callback's  fail  method  may be invoked even after other
46              callback methods were invoked.  This indicates that the  request
47              was partially completed before the error was encountered.
48
49              Note: The application must not destroy folderCallback until this
50              request fails or succeeds.  folderCallback's success  method  is
51              invoked just before the callback's success method.
52
53       The  folderCallback.success  method  receives  a  vector of pointers to
54       mail::folder objects, that enumerates folder's subfolders.  The  vector
55       will be empty if folder does not have any subfolders.
56
57              Note: Subfolders received by mail::callback::folder::success are
58              linked to the same account that folder is linked to.
59
60              Note:  mail::folders   are   linked   to   their   corresponding
61              mail::accounts.  A mail::folder created by one mail::account may
62              not be used with a different  mail::folder.   All  mail::folders
63              created   by   a   mail::account   are   invalidated  when  this
64              mail::account object is destroyed.  Note that  the  mail::folder
65              objects  are  not  automatically  destroyed;  the application is
66              still responsible for destroying  any  remaining  mail::folders,
67              after their a mail::account is destroyed.
68
69              Note:  The  folderCallback.success  method  receives a (possibly
70              empty)  vector  of  pointers  to  mail::folder  objects.   These
71              objects  will  be  destroyed  when folderCallback.success termi‐
72              nates.  The application must use mail::folder::clone(3x) to cre‐
73              ate copies of mail::folder objects it wants to use later.
74
75              Note:  Both folderCallback.success and myCallback.success method
76              will be invoked if this request  succeeds.   folderCallback.suc‐
77              cess will be invoked before myCallback.success (since by defini‐
78              tion this 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

SEE ALSO

84       mail::account::readTopLevelFolders(3x),        mail::folder::clone(3x),
85       mail::folder::getParentFolder(3x).
86
87
88
89                                 10 April 2006mail::folder::readSubFolders(3x)
Impressum