16 */ |
16 */ |
17 |
17 |
18 #ifndef NMAPIENGINE_H |
18 #ifndef NMAPIENGINE_H |
19 #define NMAPIENGINE_H |
19 #define NMAPIENGINE_H |
20 |
20 |
|
21 #include <CFSMailPlugin.h> |
|
22 |
21 #include "nmcommon.h" |
23 #include "nmcommon.h" |
22 #include "nmapiprivateclasses.h" |
24 #include "nmapiprivateclasses.h" |
23 |
25 |
24 class NmApiDataPluginFactory; |
26 class NmApiDataPluginFactory; |
25 |
27 |
26 namespace EmailClientApi |
28 namespace EmailClientApi |
27 { |
29 { |
28 class NmApiMailbox; |
30 class NmApiMailbox; |
29 class NmApiFolder; |
31 class NmApiFolder; |
30 class NmApiMessageEnvelope; |
32 class NmApiMessageEnvelope; |
|
33 class NmApiMessage; |
31 } |
34 } |
32 |
35 |
33 class NmApiEngine : public QObject |
36 class NmApiEngine : public QObject |
34 { |
37 { |
35 Q_OBJECT |
38 Q_OBJECT |
49 const quint64 envelopeId, |
52 const quint64 envelopeId, |
50 EmailClientApi::NmApiMessageEnvelope &envelope); |
53 EmailClientApi::NmApiMessageEnvelope &envelope); |
51 |
54 |
52 bool getMailboxById(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailbox); |
55 bool getMailboxById(const quint64 mailboxId, EmailClientApi::NmApiMailbox &mailbox); |
53 |
56 |
|
57 bool getMessageById( |
|
58 const quint64 mailboxId, |
|
59 const quint64 folderId, |
|
60 const quint64 messageId, |
|
61 EmailClientApi::NmApiMessage &message); |
|
62 |
54 void startCollectingEvents(); |
63 void startCollectingEvents(); |
55 |
64 |
|
65 bool listMailPlugins(RPointerArray<CFSMailPlugin> &mailPlugins); |
|
66 |
56 signals: |
67 signals: |
57 /*! |
68 /*! |
58 It contains info about event in emailstore. |
69 It contains info about event in emailstore. |
59 |
70 |
60 \arg Contains info about event and related object (message or mailbox list) |
71 \arg Contains info about event and related object (message or mailbox list) |
61 */ |
72 */ |
62 void emailStoreEvent(NmApiMessage message); |
73 void emailStoreEvent(NmApiEvent event); |
63 |
74 |
64 private slots: |
75 private slots: |
65 void mailboxChangedArrived(NmMailboxEvent, const QList<NmId> &mailboxIds); |
76 void mailboxChangedArrived(NmMailboxEvent, const QList<NmId> &mailboxIds); |
66 void messageChangedArrived( |
77 void messageChangedArrived( |
67 NmMessageEvent messageEvent, |
78 NmMessageEvent messageEvent, |
70 const NmId &mailboxId); |
81 const NmId &mailboxId); |
71 |
82 |
72 private: |
83 private: |
73 NmApiEngine(); |
84 NmApiEngine(); |
74 virtual ~NmApiEngine(); |
85 virtual ~NmApiEngine(); |
|
86 void listMailPlugins(); |
|
87 void listMailPluginsL(); |
75 |
88 |
76 private: |
89 private: |
77 static NmApiEngine *mInstance;//!<Static instance of NmApiEngine. There can be only one instance of engine |
90 static NmApiEngine *mInstance;//!<Static instance of NmApiEngine. There can be only one instance of engine |
78 static quint32 mReferenceCount;//!<Count of refences to engine instance |
91 static quint32 mReferenceCount;//!<Count of refences to engine instance |
79 |
92 |
80 NmApiDataPluginFactory *mFactory;//!<Plugin factory. Is needed to get plugins for emails |
93 NmApiDataPluginFactory *mFactory;//!<Plugin factory. Is needed to get plugins for emails |
|
94 RPointerArray<CFSMailPlugin> mMailPlugins; |
81 }; |
95 }; |
82 |
96 |
83 #endif /* NMAPIENGINE_H */ |
97 #endif /* NMAPIENGINE_H */ |