equal
deleted
inserted
replaced
13 * |
13 * |
14 * Description: |
14 * Description: |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
|
18 #include "emailtrace.h" |
|
19 |
18 #include <nmapiemailservice.h> |
20 #include <nmapiemailservice.h> |
19 #include "nmapiengine.h" |
21 #include "nmapiengine.h" |
20 |
22 |
21 #include <nmapimailbox.h> |
23 #include <nmapimailbox.h> |
22 #include <nmapimessageenvelope.h> |
24 #include <nmapimessageenvelope.h> |
28 constructor for NmEmailService |
30 constructor for NmEmailService |
29 */ |
31 */ |
30 NmApiEmailService::NmApiEmailService(QObject *parent) : |
32 NmApiEmailService::NmApiEmailService(QObject *parent) : |
31 QObject(parent), mEngine(NULL), mIsRunning(false) |
33 QObject(parent), mEngine(NULL), mIsRunning(false) |
32 { |
34 { |
33 |
35 NM_FUNCTION; |
34 } |
36 } |
35 |
37 |
36 /*! |
38 /*! |
37 destructor for NmApiEmailService |
39 destructor for NmApiEmailService |
38 */ |
40 */ |
39 NmApiEmailService::~NmApiEmailService() |
41 NmApiEmailService::~NmApiEmailService() |
40 { |
42 { |
|
43 NM_FUNCTION; |
|
44 |
41 if (mEngine) { |
45 if (mEngine) { |
42 uninitialise(); |
46 uninitialise(); |
43 } |
47 } |
44 } |
48 } |
45 |
49 |
50 const quint64 mailboxId, |
54 const quint64 mailboxId, |
51 const quint64 folderId, |
55 const quint64 folderId, |
52 const quint64 envelopeId, |
56 const quint64 envelopeId, |
53 EmailClientApi::NmApiMessageEnvelope &envelope) |
57 EmailClientApi::NmApiMessageEnvelope &envelope) |
54 { |
58 { |
|
59 NM_FUNCTION; |
|
60 |
55 if (!mEngine) { |
61 if (!mEngine) { |
56 return false; |
62 return false; |
57 } |
63 } |
58 return mEngine->getEnvelopeById(mailboxId, folderId, envelopeId, envelope); |
64 return mEngine->getEnvelopeById(mailboxId, folderId, envelopeId, envelope); |
59 } |
65 } |
61 /*! |
67 /*! |
62 gets mailbox info by id (see also NmEventNotifier) |
68 gets mailbox info by id (see also NmEventNotifier) |
63 */ |
69 */ |
64 bool NmApiEmailService::getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo) |
70 bool NmApiEmailService::getMailbox(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailboxInfo) |
65 { |
71 { |
|
72 NM_FUNCTION; |
|
73 |
66 if (!mEngine) { |
74 if (!mEngine) { |
67 return false; |
75 return false; |
68 } |
76 } |
69 return mEngine->getMailboxById(mailboxId, mailboxInfo); |
77 return mEngine->getMailboxById(mailboxId, mailboxInfo); |
70 } |
78 } |
73 Initialises email service. this must be called and initialised signal received |
81 Initialises email service. this must be called and initialised signal received |
74 before services of the library are used. |
82 before services of the library are used. |
75 */ |
83 */ |
76 void NmApiEmailService::initialise() |
84 void NmApiEmailService::initialise() |
77 { |
85 { |
|
86 NM_FUNCTION; |
|
87 |
78 if (!mEngine) { |
88 if (!mEngine) { |
79 mEngine = NmApiEngine::instance(); |
89 mEngine = NmApiEngine::instance(); |
80 } |
90 } |
81 |
91 |
82 if (mEngine) { |
92 if (mEngine) { |
91 /*! |
101 /*! |
92 frees resources. |
102 frees resources. |
93 */ |
103 */ |
94 void NmApiEmailService::uninitialise() |
104 void NmApiEmailService::uninitialise() |
95 { |
105 { |
|
106 NM_FUNCTION; |
|
107 |
96 NmApiEngine::releaseInstance(mEngine); |
108 NmApiEngine::releaseInstance(mEngine); |
97 mIsRunning = false; |
109 mIsRunning = false; |
98 } |
110 } |
99 |
111 |
100 /*! |
112 /*! |
101 returns isrunning flag value |
113 returns isrunning flag value |
102 */ |
114 */ |
103 bool NmApiEmailService::isRunning() const |
115 bool NmApiEmailService::isRunning() const |
104 { |
116 { |
|
117 NM_FUNCTION; |
|
118 |
105 return mIsRunning; |
119 return mIsRunning; |
106 } |
120 } |
107 |
121 |
108 } |
122 } |
109 |
123 |