|
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 DOWNLOADSTORE_H |
|
18 #define DOWNLOADSTORE_H |
|
19 |
|
20 #include <QObject> |
|
21 #include <QByteArray> |
|
22 #include <QIODevice> |
|
23 |
|
24 // class declaration |
|
25 |
|
26 // abstract class for all concrete storage implementations |
|
27 class DownloadStore |
|
28 { |
|
29 public: |
|
30 virtual ~DownloadStore(){} |
|
31 |
|
32 // to write the data to storage |
|
33 virtual int write(const QByteArray& data,bool lastChunk=0) = 0 ; |
|
34 // closes storage |
|
35 virtual int close() = 0 ; |
|
36 // opens storage |
|
37 virtual int open(QIODevice::OpenMode) = 0; |
|
38 // creates the storage |
|
39 virtual int createStore() = 0; |
|
40 // deletes the storage |
|
41 virtual int deleteStore() = 0; |
|
42 // returns the size of stored data in the storage |
|
43 virtual int storedDataSize() = 0; |
|
44 }; |
|
45 |
|
46 #endif |