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

NAME

8       mail::account::findFolder - A direct short-cut to a folder
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       mail::folder *folder;
28
29       std::string folderPath=folder->getPath();
30
31       mail::folder *folder=account->findFolder(std::string folderPath,
32                                                myFolderCallback &folderCallback,
33                                                myCallback &callback);
34

USAGE

36       This function is very similar to mail::account::folderFromString(3x).
37       mail::account::findFolder recreates a mail::folder object, given its
38       server path (which is returned by mail::folder::getPath(3x). The
39       differences between mail::account::findFolder and
40       mail::account::folderFromString are:
41
42       ·   mail::account::folderFromString uses a string created by
43           mail::account::folder::toString, which includes all of the folder's
44           properties (such as whether the folder contains messages,
45           subfolders, or both, and its canonical name).
46           mail::account::findFolder uses only the folder's "path", or
47           "address" on the server.
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 with a single
55       pointer mail::folder object, that's initialized to represent the folder
56       referenced by folderPath.
57

RETURN CODES AND CALLBACKS

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

SEE ALSO

93       mail::account::folderFromString(3x).
94

AUTHOR

96       Sam Varshavchik
97
98
99
100Cone©                             08/25/2016          MAIL::ACCOUNT::FINDF(3x)
Impressum