emailuis/nmailui/inc/nmattachmentmanager.h
changeset 23 2dc6caa42ec3
child 27 9ba4404ef423
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef NMATTACHMENTMANAGER_H_
       
    19 #define NMATTACHMENTMANAGER_H_
       
    20 
       
    21 #include <QObject>
       
    22 #include <QPointer>
       
    23 
       
    24 #include <nmcommon.h>
       
    25 
       
    26 class NmUiEngine;
       
    27 class NmOperation;
       
    28 class NmAttachmentFetchObserver;
       
    29 
       
    30 class NmAttachmentManager : public QObject
       
    31 {
       
    32     Q_OBJECT
       
    33 public:
       
    34     NmAttachmentManager(NmUiEngine &uiEngine);
       
    35     virtual ~NmAttachmentManager();
       
    36     void fetchAttachment(
       
    37             const NmId &mailboxId, 
       
    38             const NmId &folderId, 
       
    39             const NmId &messageId, 
       
    40             const NmId &messagePartId);
       
    41     bool isFetching() const;
       
    42     NmId partIdUnderFetch() const;
       
    43     int progressValue() const;
       
    44     void setObserver(NmAttachmentFetchObserver *observer);
       
    45     void clearObserver();
       
    46     void cancelFetch();
       
    47     
       
    48 private slots:
       
    49     void changeProgress(int value);
       
    50     void attachmentFetchCompleted(int result);
       
    51     
       
    52 private:
       
    53     NmUiEngine &mUiEngine;
       
    54     QPointer<NmOperation> mFetchOperation;      // Not owned
       
    55     NmAttachmentFetchObserver *mFetchObserver;  // Not owned
       
    56     NmId mAttaId;
       
    57     int mProgressValue;
       
    58     bool mIsFetching;
       
    59 };
       
    60 
       
    61 
       
    62 #endif /* NMATTACHMENTMANAGER_H_ */