emailuis/nmailui/inc/nmviewerviewnetreply.h
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63:d189ee25cf9d
       
     1 /*
       
     2 * Copyright (c) 2009 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 
       
    19 #ifndef NMVIEWERVIEWNETREPLY_H_
       
    20 #define NMVIEWERVIEWNETREPLY_H_
       
    21 
       
    22 #include <QNetworkReply>
       
    23 #include "nmcommon.h"
       
    24 
       
    25 class NmOperation;
       
    26 class NmMessage;
       
    27 class NmUiEngine;
       
    28 
       
    29 class NmViewerViewNetReply : public QNetworkReply
       
    30 {
       
    31     Q_OBJECT
       
    32 public:
       
    33     NmViewerViewNetReply(QVariant data, NmUiEngine &uiEngine);
       
    34     NmViewerViewNetReply(QVariant data, NmUiEngine &uiEngine, 
       
    35             const NmId &mailboxId, const NmId &folderId, const NmId &messageId, 
       
    36             const NmId &messagePartId);
       
    37     ~NmViewerViewNetReply();
       
    38     void setOriginalRequest(const QNetworkRequest &request);
       
    39     qint64 readData(char *data, qint64 maxlen);
       
    40     qint64 readBufferSize () const;
       
    41     qint64 bytesAvailable () const;
       
    42     bool isSequential () const;
       
    43     void abort();
       
    44 
       
    45 public slots:
       
    46     void signalReady();
       
    47     void fetchCompleted(int result);
       
    48     void fetchCancelled();
       
    49 
       
    50 private:
       
    51     QByteArray mDataArray;
       
    52     NmUiEngine &mUiEngine;
       
    53     NmId mMailboxId;
       
    54     NmId mFolderId;
       
    55     NmId mMessageId;
       
    56     NmId mMessagePartId;
       
    57     NmOperation *mOperation;    // Not owned
       
    58     qint64 mReadIndex;
       
    59 };
       
    60 
       
    61 #endif /* NMVIEWERVIEWNETREPLY_H_ */