13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 #include "nmapiemailservice.h" |
18 #include <nmapiemailservice.h> |
19 #include "nmapiengine.h" |
19 #include "nmapiengine.h" |
|
20 |
|
21 #include <nmapimailbox.h> |
|
22 #include <nmapimessageenvelope.h> |
|
23 |
20 namespace EmailClientApi |
24 namespace EmailClientApi |
21 { |
25 { |
22 NmEmailService::NmEmailService(QObject *parent) : |
26 |
23 QObject(parent), mEngine(NULL) |
27 /*! |
|
28 constructor for NmEmailService |
|
29 */ |
|
30 NmApiEmailService::NmApiEmailService(QObject *parent) : |
|
31 QObject(parent), mEngine(NULL), mIsRunning(false) |
24 { |
32 { |
25 |
33 |
26 } |
34 } |
27 |
35 |
28 NmEmailService::~NmEmailService() |
36 /*! |
|
37 destructor for NmApiEmailService |
|
38 */ |
|
39 NmApiEmailService::~NmApiEmailService() |
29 { |
40 { |
30 if (mEngine) { |
41 if (mEngine) { |
31 uninitialise(); |
42 uninitialise(); |
32 } |
43 } |
33 } |
44 } |
34 |
45 |
35 bool NmEmailService::getEnvelope( |
46 /*! |
|
47 gets mail message envelope by id (see also NmEventNotifier) |
|
48 */ |
|
49 bool NmApiEmailService::getEnvelope( |
36 const quint64 mailboxId, |
50 const quint64 mailboxId, |
37 const quint64 folderId, |
51 const quint64 folderId, |
38 const quint64 envelopeId, |
52 const quint64 envelopeId, |
39 NmMessageEnvelope &envelope) |
53 EmailClientApi::NmApiMessageEnvelope &envelope) |
40 { |
54 { |
41 if (!mEngine) { |
55 if (!mEngine) { |
42 return false; |
56 return false; |
43 } |
57 } |
44 return mEngine->envelopeById(mailboxId, folderId, envelopeId, envelope); |
58 return mEngine->getEnvelopeById(mailboxId, folderId, envelopeId, envelope); |
45 } |
59 } |
46 |
60 |
47 bool NmEmailService::getMailbox(const quint64 mailboxId, NmMailbox &mailboxInfo) |
61 /*! |
|
62 gets mailbox info by id (see also NmEventNotifier) |
|
63 */ |
|
64 bool NmApiEmailService::getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo) |
48 { |
65 { |
49 if (!mEngine) { |
66 if (!mEngine) { |
50 return false; |
67 return false; |
51 } |
68 } |
52 return mEngine->mailboxById(mailboxId, mailboxInfo); |
69 return mEngine->getMailboxById(mailboxId, mailboxInfo); |
53 } |
70 } |
54 |
71 |
55 void NmEmailService::initialise() |
72 /*! |
|
73 Initialises email service. this must be called and initialised signal received |
|
74 before services of the library are used. |
|
75 */ |
|
76 void NmApiEmailService::initialise() |
56 { |
77 { |
57 if (!mEngine) { |
78 if (!mEngine) { |
58 mEngine = NmEngine::instance(); |
79 mEngine = NmApiEngine::instance(); |
59 } |
80 } |
60 |
81 |
61 if (mEngine) { |
82 if (mEngine) { |
62 mIsRunning = true; |
83 mIsRunning = true; |
63 emit initialized(true); |
84 emit initialized(true); |