1MAIL::ACCOUNT::FINDF(3x)Cone: COnsole Newsreader And EMAIL::ACCOUNT::FINDF(3x)
2
3
4
6 mail::account::findFolder - A direct short-cut to a folder
7
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::account *account;
24
25 mail::folder *folder;
26
27 std::string folderPath=folder->getPath();
28
29 mail::folder *folder=account->findFolder(std::string folderPath,
30 myFolderCallback &folderCallback,
31 myCallback &callback);
32
34 This function is very similar to mail::account::folderFromString(3x).
35 mail::account::findFolder recreates a mail::folder object, given its
36 server path (which is returned by mail::folder::getPath(3x). The
37 differences between mail::account::findFolder and
38 mail::account::folderFromString are:
39
40 · mail::account::folderFromString uses a string created by
41 mail::account::folder::toString, which includes all of the folder´s
42 properties (such as whether the folder contains messages,
43 subfolders, or both, and its canonical name).
44 mail::account::findFolder uses only the folder´s "path", or
45 "address" on the server.
46
47 Note
48 The application must not destroy folderCallback until this request
49 fails or succeeds. folderCallback´s success method is invoked just
50 before the callback´s success method.
51
52 The folderCallback.success method receives a vector with a single
53 pointer mail::folder object, that´s initialized to represent the folder
54 referenced by folderPath.
55
57 The application must wait until callback´s success or fail method is
58 invoked. The success method is invoked when this request is succesfully
59 processed. The fail method is invoked if this request cannot be
60 processed. The application must not destroy callback until either the
61 success or fail method is invoked.
62
63 Note
64 callback´s fail method may be invoked even after other callback
65 methods were invoked. This indicates that the request was partially
66 completed before the error was encountered.
67
68 Note
69 The folderCallback.success method receives a (possibly empty)
70 vector of pointers to mail::folder objects. These objects will be
71 destroyed when folderCallback.success terminates. The application
72 must use mail::folder::clone(3x) to create copies of mail::folder
73 objects it wants to use later.
74
75 Note
76 Both folderCallback.success and myCallback.success method will be
77 invoked if this request succeeds. folderCallback.success will be
78 invoked before myCallback.success (since by definition this
79 indicates that the request has been completed).
80
81 Note
82 mail::folders are linked to their corresponding mail::accounts. A
83 mail::folder created by one mail::account may not be used with a
84 different mail::folder. All mail::folders created by a
85 mail::account are invalidated when this mail::account object is
86 destroyed. Note that the mail::folder objects are not automatically
87 destroyed; the application is still responsible for destroying any
88 remaining mail::folders, after their a mail::account is destroyed.
89
91 mail::account::folderFromString(3x).
92
93
94
95[FIXME: source] 05/08/2010 MAIL::ACCOUNT::FINDF(3x)