emailuis/nmailui/inc/nmattachmentmanager.h
changeset 27 9ba4404ef423
parent 23 2dc6caa42ec3
child 30 759dc5235cdb
equal deleted inserted replaced
23:2dc6caa42ec3 27:9ba4404ef423
    24 #include <nmcommon.h>
    24 #include <nmcommon.h>
    25 
    25 
    26 class NmUiEngine;
    26 class NmUiEngine;
    27 class NmOperation;
    27 class NmOperation;
    28 class NmAttachmentFetchObserver;
    28 class NmAttachmentFetchObserver;
       
    29 class NmMessage;
    29 
    30 
    30 class NmAttachmentManager : public QObject
    31 class NmAttachmentManager : public QObject
    31 {
    32 {
    32     Q_OBJECT
    33     Q_OBJECT
    33 public:
    34 public:
    36     void fetchAttachment(
    37     void fetchAttachment(
    37             const NmId &mailboxId, 
    38             const NmId &mailboxId, 
    38             const NmId &folderId, 
    39             const NmId &folderId, 
    39             const NmId &messageId, 
    40             const NmId &messageId, 
    40             const NmId &messagePartId);
    41             const NmId &messagePartId);
       
    42     void fetchAttachments(
       
    43             const NmId &mailboxId, 
       
    44             const NmId &folderId, 
       
    45             const NmId &messageId,
       
    46             QList<NmId> &messagePartIds);
       
    47     void fetchAllMessageParts(
       
    48             const NmId &mailboxId, 
       
    49             const NmId &folderId, 
       
    50             const NmId &messageId);
    41     bool isFetching() const;
    51     bool isFetching() const;
    42     NmId partIdUnderFetch() const;
    52     NmId partIdUnderFetch() const;
    43     int progressValue() const;
    53     int progressValue() const;
    44     void setObserver(NmAttachmentFetchObserver *observer);
    54     void setObserver(NmAttachmentFetchObserver *observer);
    45     void clearObserver();
    55     void clearObserver();
    46     void cancelFetch();
    56     void cancelFetch();
    47     
    57     
    48 private slots:
    58 private slots:
    49     void changeProgress(int value);
    59     void changeProgress(int value);
    50     void attachmentFetchCompleted(int result);
    60     void attachmentFetchCompleted(int result);
       
    61     void messageFetched(int result);
    51     
    62     
    52 private:
    63 private:
    53     NmUiEngine &mUiEngine;
    64     NmUiEngine &mUiEngine;
    54     QPointer<NmOperation> mFetchOperation;      // Not owned
    65     QPointer<NmOperation> mFetchOperation;      // Not owned
       
    66     QPointer<NmOperation> mMsgFetchOperation;      // Not owned
    55     NmAttachmentFetchObserver *mFetchObserver;  // Not owned
    67     NmAttachmentFetchObserver *mFetchObserver;  // Not owned
       
    68     NmMessage *fetchMsg;
    56     NmId mAttaId;
    69     NmId mAttaId;
    57     int mProgressValue;
    70     int mProgressValue;
    58     bool mIsFetching;
    71     bool mIsFetching;
    59 };
    72 };
    60 
    73