40 class NmHsWidgetEmailEngine : public QObject |
39 class NmHsWidgetEmailEngine : public QObject |
41 { |
40 { |
42 Q_OBJECT |
41 Q_OBJECT |
43 |
42 |
44 public: |
43 public: |
45 NmHsWidgetEmailEngine( const NmId& monitoredMailboxId ); |
44 NmHsWidgetEmailEngine( const NmId& monitoredMailboxId); |
46 bool initialize(); |
45 bool initialize(); |
47 ~NmHsWidgetEmailEngine(); |
46 ~NmHsWidgetEmailEngine(); |
48 |
47 |
49 int getEnvelopes(QList<NmMessageEnvelope*> &list, int maxEnvelopeAmount); |
|
50 int unreadCount(); |
48 int unreadCount(); |
51 QString accountName(); |
49 QString accountName(); |
52 void deleteAiwRequest(); |
50 void deleteAiwRequest(); |
53 |
51 |
54 public slots: |
52 public slots: |
67 void handleMailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds); |
65 void handleMailboxEvent(NmMailboxEvent event, const QList<NmId> &mailboxIds); |
68 |
66 |
69 //Activity control |
67 //Activity control |
70 void suspend(); |
68 void suspend(); |
71 void activate(); |
69 void activate(); |
|
70 void forceUpdate(); |
|
71 |
72 void launchMailAppInboxView(); |
72 void launchMailAppInboxView(); |
73 void launchMailAppMailViewer(const NmId &messageId); |
73 void launchMailAppMailViewer(const NmId &messageId); |
74 void handleUpdateTimeout(); |
|
75 |
74 |
76 void aiwRequestOk(const QVariant& result); |
75 void aiwRequestOk(const QVariant& result); |
77 void aiwRequestError(int errorCode, const QString& errorMessage); |
76 void aiwRequestError(int errorCode, const QString& errorMessage); |
78 |
77 |
79 signals: |
78 signals: |
80 void mailDataChanged(); |
79 //all mail data was refreshed (list contains all items) |
|
80 void mailDataRefreshed(const QList<NmMessageEnvelope*>&); |
|
81 //all mail data was cleared |
|
82 void mailDataCleared(); |
|
83 //new mails received (list contains the only items) |
|
84 void mailsReceived(const QList<NmMessageEnvelope*>&); |
|
85 //mail items updated (list contains changed items) |
|
86 void mailsUpdated(const QList<NmMessageEnvelope*>&); |
|
87 //mails deleted (list contains the id's of the deleted items) |
|
88 void mailsDeleted(const QList<NmId>&); |
|
89 |
81 void accountNameChanged(const QString& accountName); |
90 void accountNameChanged(const QString& accountName); |
82 void unreadCountChanged(const int& unreadCount); |
91 void unreadCountChanged(const int& unreadCount); |
83 void exceptionOccured(const int& err); |
92 void exceptionOccured(const int& err); |
84 |
93 |
85 private: |
94 private: |
86 bool constructNmPlugin(); |
95 bool constructNmPlugin(); |
87 bool updateData(); |
96 bool updateData(); |
|
97 bool updateUnreadCount(); |
88 bool updateAccount(); |
98 bool updateAccount(); |
89 void resetEnvelopeList(); |
99 QList<NmMessageEnvelope*> getEnvelopesFromIds(const QList<NmId> messageIds); |
|
100 NmMessageEnvelope* envelopeById(const NmId &messageId); |
90 |
101 |
91 private: |
102 private: |
92 NmId mMailboxId; |
103 NmId mMailboxId; |
93 NmId mFolderId; |
104 NmId mFolderId; |
94 QString mAccountName; |
105 QString mAccountName; |
95 int mUnreadCount; |
106 int mUnreadCount; |
96 QList<NmMessageEnvelope*> mEnvelopeList; |
|
97 NmDataPluginInterface *mEmailInterface; |
107 NmDataPluginInterface *mEmailInterface; |
98 NmDataPluginFactory* mFactory; |
108 NmDataPluginFactory* mFactory; |
99 //suspension variables |
109 //suspension variables |
100 bool mAccountEventReceivedWhenSuspended; |
110 bool mAccountDataNeedsUpdate; |
101 bool mMessageEventReceivedWhenSuspended; |
111 bool mMessageDataNeedsUpdate; |
102 bool mSuspended; |
112 bool mSuspended; |
103 QTimer* mUpdateTimer; |
|
104 XQAiwRequest* mAiwRequest; |
113 XQAiwRequest* mAiwRequest; |
105 }; |
114 }; |
106 |
115 |
107 #endif /* NMHSWIDGETEMAILENGINE_H_ */ |
116 #endif /* NMHSWIDGETEMAILENGINE_H_ */ |