1MAIL::FOLDER::READSU(3x)Cone: COnsole Newsreader And EMAIL::FOLDER::READSU(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       folder->readSubFolders(myFolderCallback &folderCallback,
26                              myCallback &callback);
27

USAGE

29       A mail account contains folders that are arranged in a tree-like
30       hierarchy.  mail::folder::readSubFolders enumerates folder´s
31       subfolders.
32
33           Note
34           Use mail::folder::hasSubFolders(3x) to check if folder contains
35           subfolders, and invoke mail::folder::readSubFolders only if
36           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 succesfully
41       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
46           callback´s fail method may be invoked even after other callback
47           methods were invoked. This indicates that the request was partially
48           completed before the error was encountered.
49
50           Note
51           The application must not destroy folderCallback until this request
52           fails or succeeds.  folderCallback´s success method is invoked just
53           before the callback´s success method.
54
55       The folderCallback.success method receives a vector of pointers to
56       mail::folder objects, that enumerates folder´s subfolders. The vector
57       will be empty if folder does not have any subfolders.
58
59           Note
60           Subfolders received by mail::callback::folder::success are linked
61           to the same account that folder is linked to.
62
63           Note
64           mail::folders are linked to their corresponding mail::accounts. A
65           mail::folder created by one mail::account may not be used with a
66           different mail::folder. All mail::folders created by a
67           mail::account are invalidated when this mail::account object is
68           destroyed. Note that the mail::folder objects are not automatically
69           destroyed; the application is still responsible for destroying any
70           remaining mail::folders, after their a mail::account is destroyed.
71
72           Note
73           The folderCallback.success method receives a (possibly empty)
74           vector of pointers to mail::folder objects. These objects will be
75           destroyed when folderCallback.success terminates. The application
76           must use mail::folder::clone(3x) to create copies of mail::folder
77           objects it wants to use later.
78
79           Note
80           Both folderCallback.success and myCallback.success method will be
81           invoked if this request succeeds.  folderCallback.success will be
82           invoked before myCallback.success (since by definition this
83           indicates that the request has been completed).
84
85       callback´s success method is then invoked, after all mail::folder
86       objects are destroyed.
87

SEE ALSO

89       mail::account::readTopLevelFolders(3x), mail::folder::clone(3x),
90       mail::folder::getParentFolder(3x).
91
92
93
94[FIXME: source]                   05/08/2010          MAIL::FOLDER::READSU(3x)
Impressum