-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMailDaemon.cpp
31 lines (24 loc) · 1.04 KB
/
MailDaemon.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include <pybind11/iostream.h>
#include <pybind11/operators.h>
#include <mail/E-mail.h>
#include <mail/MailDaemon.h>
namespace py = pybind11;
PYBIND11_MODULE(MailDaemon, m)
{
//m.attr("B_MAIL_BODY_FETCHED") = py::cast(B_MAIL_BODY_FETCHED); //
m.attr("B_MAIL_BODY_FETCHED") = '_Mbf';
py::class_<BMailDaemon>(m, "BMailDaemon")
.def(py::init(), "")
.def("IsRunning", &BMailDaemon::IsRunning, "")
.def("CheckMail", &BMailDaemon::CheckMail, "", py::arg("accountID")=- 1)
.def("CheckAndSendQueuedMail", &BMailDaemon::CheckAndSendQueuedMail, "", py::arg("accountID")=- 1)
.def("SendQueuedMail", &BMailDaemon::SendQueuedMail, "")
.def("CountNewMessages", &BMailDaemon::CountNewMessages, "", py::arg("waitForFetchCompletion")=false)
.def("MarkAsRead", &BMailDaemon::MarkAsRead, "", py::arg("account"), py::arg("ref"), py::arg("flag")=B_READ)
.def("FetchBody", &BMailDaemon::FetchBody, "", py::arg("ref"), py::arg("listener")=NULL)
.def("Quit", &BMailDaemon::Quit, "")
.def("Launch", &BMailDaemon::Launch, "")
;
}