1MAIL::FOLDER::GETPAR(3x)Cone: COnsole Newsreader And EMAIL::FOLDER::GETPAR(3x)
2
3
4
6 mail::folder::getParentFolder - Find parent 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::folder *folder;
24
25 folder->getParentFolder(myFolderCallback &folderCallback,
26 myCallback &callback);
27
29 A mail account contains folders that are arranged in a tree-like
30 hierarchy. mail::folder::getParentFolder creates a new folder object
31 that refers to folder´s parent folder.
32
34 The application must wait until callback´s success or fail method is
35 invoked. The success method is invoked when this request is succesfully
36 processed. The fail method is invoked if this request cannot be
37 processed. The application must not destroy callback until either the
38 success or fail method is invoked.
39
40 Note
41 callback´s fail method may be invoked even after other callback
42 methods were invoked. This indicates that the request was partially
43 completed before the error was encountered.
44
45 Note
46 The application must not destroy folderCallback until this request
47 fails or succeeds. folderCallback´s success method is invoked just
48 before the callback´s success method.
49
50 The folderCallback.success method receives a vector that contains
51 exactly one pointer to a single mail::folder object, that refers to
52 folder´s parent folder The vector will be empty if folder´s parent
53 folder could not be determined.
54
55 Note
56 mail::folders are linked to their corresponding mail::accounts. A
57 mail::folder created by one mail::account may not be used with a
58 different mail::folder. All mail::folders created by a
59 mail::account are invalidated when this mail::account object is
60 destroyed. Note that the mail::folder objects are not automatically
61 destroyed; the application is still responsible for destroying any
62 remaining mail::folders, after their a mail::account is destroyed.
63
64 Note
65 The folderCallback.success method receives a (possibly empty)
66 vector of pointers to mail::folder objects. These objects will be
67 destroyed when folderCallback.success terminates. The application
68 must use mail::folder::clone(3x) to create copies of mail::folder
69 objects it wants to use later.
70
71 Note
72 Both folderCallback.success and myCallback.success method will be
73 invoked if this request succeeds. folderCallback.success will be
74 invoked before myCallback.success (since by definition this
75 indicates that the request has been completed).
76
77 callback´s success method is then invoked, after all mail::folder
78 objects are destroyed.
79
81 mail::account::readTopLevelFolders(3x), mail::folder::clone(3x),
82 mail::folder::readSubFolders(3x).
83
84
85
86[FIXME: source] 05/08/2010 MAIL::FOLDER::GETPAR(3x)