emailservices/nmailagent/inc/nmmailagent.h
changeset 23 2dc6caa42ec3
parent 20 ecc8def7944a
child 27 9ba4404ef423
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
    28 {
    28 {
    29 public:
    29 public:
    30     NmId mId;
    30     NmId mId;
    31     int mIndicatorIndex;
    31     int mIndicatorIndex;
    32     QString mName;
    32     QString mName;
       
    33     QString mIconName;
    33     NmId mInboxFolderId;
    34     NmId mInboxFolderId;
    34     NmId mOutboxFolderId;
    35     NmId mOutboxFolderId;
    35     NmSyncState mSyncState;
    36     NmSyncState mSyncState;
    36     NmConnectState mConnectState;
    37     NmConnectState mConnectState;
    37     int mInboxCreatedMessages;
    38     int mInboxCreatedMessages;
    38     int mInboxChangedMessages;
    39     int mInboxChangedMessages;
    39     int mInboxDeletedMessages;
    40     int mInboxDeletedMessages;
    40     int mUnreadMails;
    41     QList<NmId> mUnreadMailIdList;
    41     int mOutboxMails;
    42     int mOutboxMails;
    42     bool mActive;
    43     bool mActive;
    43 
    44 
    44     NmMailboxInfo();
    45     NmMailboxInfo();
    45 };
    46 };
    72             const NmOperationCompletionEvent &event);
    73             const NmOperationCompletionEvent &event);
    73 
    74 
    74     void handleConnectionEvent(NmConnectState state, const NmId mailboxId);
    75     void handleConnectionEvent(NmConnectState state, const NmId mailboxId);
    75 
    76 
    76     void delayedStart();
    77     void delayedStart();
       
    78     
       
    79     void enableAlertTone();
    77 
    80 
    78 private:
    81 private:
    79 
    82 
    80     void initMailboxStatus();
    83     void initMailboxStatus();
    81 
    84 
    82     int getUnreadCount(const NmId& mailboxId, int maxCount);
    85     bool updateUnreadCount(const NmId &mailboxId, NmMailboxInfo &mailboxInfo);
    83 
    86 
    84     int getOutboxCount(const NmId& mailboxId);
    87     int getOutboxCount(const NmId& mailboxId);
    85 
    88 
    86     int getIndicatorIndex();
    89     int getIndicatorIndex();
    87 
       
    88     bool isMailboxActive(const NmMailboxInfo& mailboxInfo);
       
    89 
    90 
    90     bool updateIndicator(bool active,
    91     bool updateIndicator(bool active,
    91         const NmMailboxInfo& mailboxInfo);
    92         const NmMailboxInfo& mailboxInfo);
    92 
    93 
    93     NmMailboxInfo* getMailboxInfo(const NmId &id);
    94     NmMailboxInfo* getMailboxInfo(const NmId &id);
   101 
   102 
   102     bool updateMailboxState(const NmId &mailboxId,
   103     bool updateMailboxState(const NmId &mailboxId,
   103         bool active, bool refreshAlways);
   104         bool active, bool refreshAlways);
   104 
   105 
   105     static QStringList pluginFolders();
   106     static QStringList pluginFolders();
   106 
   107     
       
   108     bool getMessageUnreadInfo(const NmId &folderId, 
       
   109         const NmId &messageId, const NmId &mailboxId, bool &unreadMessage);
       
   110     
       
   111     void playAlertTone();
       
   112     
   107 private: // data
   113 private: // data
   108 
   114 
   109     NmDataPluginFactory *mPluginFactory;
   115     NmDataPluginFactory *mPluginFactory;
   110     QList<NmMailboxInfo*> mMailboxes;
   116     QList<NmMailboxInfo*> mMailboxes;
   111     bool mSendingState;
   117     bool mSendingState;
       
   118     bool mAlertToneAllowed;
   112 };
   119 };
   113 
   120 
   114 
   121 
   115 #endif // NMMAILAGENT_H
   122 #endif // NMMAILAGENT_H