utilities/downloadmanager/inc/httpdownloadbackend.h
changeset 16 3c88a81ff781
equal deleted inserted replaced
14:6aeb7a756187 16:3c88a81ff781
       
     1 /**
       
     2    This file is part of CWRT package **
       
     3 
       
     4    Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). **
       
     5 
       
     6    This program is free software: you can redistribute it and/or modify
       
     7    it under the terms of the GNU (Lesser) General Public License as 
       
     8    published by the Free Software Foundation, version 2.1 of the License. 
       
     9    This program is distributed in the hope that it will be useful, but
       
    10    WITHOUT ANY WARRANTY; without even the implied warranty of 
       
    11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
       
    12    (Lesser) General Public License for more details. You should have 
       
    13    received a copy of the GNU (Lesser) General Public License along 
       
    14    with this program. If not, see <http://www.gnu.org/licenses/>.
       
    15 */
       
    16 
       
    17 #ifndef HTTPDOWNLOADBACKEND_H
       
    18 #define HTTPDOWNLOADBACKEND_H
       
    19 
       
    20 #include "downloadbackend.h"
       
    21 #include "dmcommon.h"
       
    22 
       
    23 // forward declarations
       
    24 class DownloadCore;
       
    25 class ClientDownload;
       
    26 class DownloadStore;
       
    27 class HttpDownloadBackendPrivate;
       
    28 
       
    29 // class declaration
       
    30 
       
    31 // concrete download implementation class for normal http downloads
       
    32 class HttpDownloadBackend : public DownloadBackend
       
    33 {
       
    34     DM_DECLARE_PRIVATE(HttpDownloadBackend); // private implementation
       
    35 public:
       
    36     HttpDownloadBackend(DownloadCore *dlCore, ClientDownload *dl, DownloadStore* store);
       
    37     ~HttpDownloadBackend();
       
    38 
       
    39     // overloaded function for resuming download
       
    40     int resume();
       
    41     // overloaded function for storing the data
       
    42     void store(QByteArray data, bool lastChunk=false);
       
    43     // overloaded function for deleting the storage
       
    44     void deleteStore();
       
    45     // overloaded function which returns the stored data size
       
    46     qint64 storedDataSize();
       
    47     // fetches the attributes
       
    48     QVariant getAttribute(DownloadAttribute attr);
       
    49     // sets the attributes
       
    50     int setAttribute(DownloadAttribute attr, const QVariant& value);
       
    51 public slots:
       
    52     void headerReceived();
       
    53 };
       
    54 
       
    55 #endif
       
    56 
       
    57