#ifndef TransferJob_H_
#define TransferJob_H_
#include "StringHash.h"
#include "Timer.h"
#include "TransferJobClient.h" // for PlatformResponse
#include <wtf/HashMap.h>
#ifdef WIN32
typedef unsigned long DWORD;
typedef unsigned long DWORD_PTR;
typedef void* LPVOID;
typedef LPVOID HINTERNET;
typedef unsigned WPARAM;
typedef long LPARAM;
typedef struct HWND__* HWND;
typedef _W64 long LONG_PTR;
typedef LONG_PTR LRESULT;
#endif
#if __APPLE__
#ifdef __OBJC__
@class WebCoreResourceLoaderImp;
#else
class WebCoreResourceLoaderImp;
#endif
#endif
namespace WebCore {
class DocLoader;
class FormData;
class KURL;
class TransferJobInternal;
class TransferJob {
public:
TransferJob(TransferJobClient*, const String& method, const KURL&);
TransferJob(TransferJobClient*, const String& method, const KURL&, const FormData& postData);
~TransferJob();
bool start(DocLoader*);
int error() const;
void setError(int);
String errorText() const;
bool isErrorPage() const;
String queryMetaData(const String&) const;
void addMetaData(const String& key, const String& value);
void addMetaData(const HashMap<String, String>&);
void kill();
KURL url() const;
String method() const;
FormData postData() const;
#if __APPLE__
void setLoader(WebCoreResourceLoaderImp*);
#endif
#if WIN32
void fileLoadTimer(Timer<TransferJob>* timer);
friend void __stdcall transferJobStatusCallback(HINTERNET, DWORD_PTR, DWORD, LPVOID, DWORD);
friend LRESULT __stdcall TransferJobWndProc(HWND, unsigned message, WPARAM, LPARAM);
#endif
#if PLATFORM(GDK)
TransferJobInternal * getInternal() { return d;}
#endif
void cancel();
TransferJobClient* client() const;
void receivedResponse(PlatformResponse);
private:
void assembleResponseHeaders() const;
void retrieveCharset() const;
TransferJobInternal* d;
};
}
#endif // TransferJob_H_