|
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 DRMSTORAGE_H |
|
18 #define DRMSTORAGE_H |
|
19 |
|
20 #include "dmcommon.h" |
|
21 #include "dmpimpl.h" |
|
22 #include "downloadstore.h" |
|
23 #include "clientdownload.h" |
|
24 #include <caf/caf.h> |
|
25 #include <e32cmn.h> |
|
26 #include <QObject> |
|
27 |
|
28 |
|
29 // class declaration |
|
30 // concrete implementation class |
|
31 class DrmStorage : public DownloadStore |
|
32 { |
|
33 |
|
34 public: |
|
35 DrmStorage(const QString& clientName, ClientDownload* download); |
|
36 virtual ~DrmStorage(); |
|
37 |
|
38 // writes to the file |
|
39 int write(const QByteArray& data, bool lastChunk=0); |
|
40 // closes the file |
|
41 int close(); |
|
42 // opnes the file |
|
43 int open(QIODevice::OpenMode mode); |
|
44 // creates the storage |
|
45 int createStore(); |
|
46 // deletes the file storage |
|
47 int deleteStore(); |
|
48 //returns the size of loaded file |
|
49 int storedDataSize(); |
|
50 |
|
51 private: |
|
52 // moves the file |
|
53 void moveDlFile(); |
|
54 // convert symbian string to QString |
|
55 QString SymbianStringToQtString(TDesC& symbianString); |
|
56 // convert QString string to symbian string |
|
57 TPtrC SymbianStringToQtString(QString& qtString); |
|
58 |
|
59 // member variables |
|
60 private: |
|
61 // client name |
|
62 QString m_clientName; |
|
63 // folder paths |
|
64 QString m_tempPath; // temporary path till dl completes |
|
65 ClientDownload* m_download; // not owned |
|
66 ContentAccess::CImportFile* m_file; |
|
67 }; |
|
68 |
|
69 #endif |