64 |
67 |
65 void handleMessageEvent( |
68 void handleMessageEvent( |
66 NmMessageEvent event, |
69 NmMessageEvent event, |
67 const NmId &folderId, |
70 const NmId &folderId, |
68 const QList<NmId> &messageIds, |
71 const QList<NmId> &messageIds, |
69 const NmId& mailboxId); |
72 const NmId &mailboxId); |
70 |
73 |
71 void handleSyncStateEvent( |
74 void handleSyncStateEvent( |
72 NmSyncState state, |
75 NmSyncState state, |
73 const NmOperationCompletionEvent &event); |
76 const NmOperationCompletionEvent &event); |
74 |
77 |
75 void handleConnectionEvent(NmConnectState state, const NmId mailboxId, int errorcode); |
78 void handleConnectionEvent(NmConnectState state, const NmId mailboxId, int errorcode); |
76 |
79 |
77 void delayedStart(); |
80 void delayedStart(); |
78 |
81 |
79 void enableAlertTone(); |
82 void enableAlertTone(); |
|
83 |
|
84 void indicatorActivated(const QString &type, const QVariantMap &data); |
80 |
85 |
81 private: |
86 private: |
82 |
87 |
83 void initMailboxStatus(); |
88 void initMailboxStatus(); |
84 |
89 |
85 bool updateUnreadCount(const NmId &mailboxId, NmMailboxInfo &mailboxInfo); |
90 bool updateUnreadCount(const NmId &mailboxId, NmMailboxInfo &mailboxInfo); |
86 |
91 |
87 int getOutboxCount(const NmId& mailboxId); |
92 int getOutboxCount(const NmId &mailboxId); |
88 |
93 |
89 int getIndicatorIndex(); |
94 NmMailboxInfo *getMailboxByType(const QString &type); |
90 |
95 |
|
96 int getFreeIndicatorIndex(); |
|
97 |
|
98 int getTotalUnreadCount() const; |
|
99 |
|
100 bool updateUnreadIndicator(); |
|
101 |
|
102 bool updateUnreadIndicator(bool active); |
|
103 |
91 bool updateIndicator(bool active, |
104 bool updateIndicator(bool active, |
92 const NmMailboxInfo& mailboxInfo); |
105 const NmMailboxInfo& mailboxInfo); |
93 |
106 |
94 NmMailboxInfo* getMailboxInfo(const NmId &id); |
107 NmMailboxInfo* getMailboxInfo(const NmId &id); |
95 |
108 |
106 static QStringList pluginFolders(); |
119 static QStringList pluginFolders(); |
107 |
120 |
108 bool getMessageUnreadInfo(const NmId &folderId, |
121 bool getMessageUnreadInfo(const NmId &folderId, |
109 const NmId &messageId, const NmId &mailboxId, bool &unreadMessage); |
122 const NmId &messageId, const NmId &mailboxId, bool &unreadMessage); |
110 |
123 |
111 void playAlertTone(); |
124 bool playAlertTone(); |
|
125 |
|
126 void updateSendIndicator(); |
|
127 |
|
128 bool launchMailbox(quint64 mailboxId); |
112 |
129 |
113 private: // data |
130 private: // data |
114 |
131 |
|
132 HbIndicator *mIndicator; |
|
133 XQSystemToneService *mSystemTone; |
115 NmDataPluginFactory *mPluginFactory; |
134 NmDataPluginFactory *mPluginFactory; |
116 QList<NmMailboxInfo*> mMailboxes; |
135 QList<NmMailboxInfo*> mMailboxes; |
117 bool mSendingState; |
|
118 bool mAlertToneAllowed; |
136 bool mAlertToneAllowed; |
|
137 int mLastOutboxCount; |
|
138 bool mUnreadIndicatorActive; |
119 }; |
139 }; |
120 |
140 |
121 |
141 |
122 #endif // NMMAILAGENT_H |
142 #endif // NMMAILAGENT_H |