|
0
|
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 |
#ifndef __W32FILECONNECTION_H__
|
|
|
19 |
#define __W32FILECONNECTION_H_
|
|
|
20 |
|
|
|
21 |
#include <e32base.h>
|
|
|
22 |
#include "UrlConnection.h"
|
|
|
23 |
|
|
|
24 |
class CW32FileReader;
|
|
|
25 |
|
|
|
26 |
class CW32FileConnection : public MUrlConnection
|
|
|
27 |
{
|
|
|
28 |
public:
|
|
|
29 |
/**
|
|
|
30 |
*/
|
|
|
31 |
CW32FileConnection(WebCore::ResourceHandle* _handle);
|
|
|
32 |
/**
|
|
|
33 |
*/
|
|
|
34 |
virtual ~CW32FileConnection();
|
|
|
35 |
/**
|
|
|
36 |
*/
|
|
|
37 |
virtual int submit();
|
|
|
38 |
/**
|
|
|
39 |
*/
|
|
|
40 |
virtual void cancel();
|
|
|
41 |
/**
|
|
|
42 |
*/
|
|
|
43 |
virtual void download(WebCore::ResourceHandle* handle, const WebCore::ResourceRequest& request, const WebCore::ResourceResponse& response);
|
|
|
44 |
|
|
|
45 |
virtual int totalContentSize() { return m_maxSize; }
|
|
|
46 |
/**
|
|
|
47 |
*/
|
|
|
48 |
void response();
|
|
|
49 |
/**
|
|
|
50 |
*/
|
|
|
51 |
void complete(int error);
|
|
|
52 |
|
|
|
53 |
private:
|
|
|
54 |
/**
|
|
|
55 |
*/
|
|
|
56 |
TInt submitL();
|
|
|
57 |
/**
|
|
|
58 |
*/
|
|
|
59 |
void responseL();
|
|
|
60 |
/**
|
|
|
61 |
*/
|
|
|
62 |
HBufC* parseFileNameL(const TDesC8& aUrl );
|
|
|
63 |
/**
|
|
|
64 |
* Determine the content type of the file.
|
|
|
65 |
*/
|
|
|
66 |
HBufC8* contentTypeL();
|
|
|
67 |
|
|
|
68 |
/**
|
|
|
69 |
* Determine the content encoding of the file.
|
|
|
70 |
*/
|
|
|
71 |
TPtrC8 contentEncoding(const TDesC8& aContentTypeString ) const;
|
|
|
72 |
private:
|
|
|
73 |
HBufC* m_fileName;
|
|
|
74 |
int m_maxSize;
|
|
|
75 |
CW32FileReader* m_fileReader;
|
|
|
76 |
int m_chunkIndex;
|
|
|
77 |
HBufC* m_charset;
|
|
|
78 |
HBufC* m_contentType;
|
|
|
79 |
};
|
|
|
80 |
|
|
|
81 |
|
|
|
82 |
#endif // __W32FileConnection_H__
|
|
|
83 |
// end of file
|