Upstream tarball 9452
[amule.git] / src / HTTPDownload.h
blobba1416901e2c298aaa87887484ae2c8e56b9db82
1 //
2 // This file is part of the aMule Project.
3 //
4 // Copyright (c) 2003-2008 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2002-2008 Timo Kujala ( tiku@users.sourceforge.net )
6 // Copyright (c) 2002-2008 Patrizio Bassi ( hetfield@amule.org )
7 //
8 // Any parts of this program derived from the xMule, lMule or eMule project,
9 // or contributed by third-party developers are copyrighted by their
10 // respective authors.
12 // This program is free software; you can redistribute it and/or modify
13 // it under the terms of the GNU General Public License as published by
14 // the Free Software Foundation; either version 2 of the License, or
15 // (at your option) any later version.
17 // This program is distributed in the hope that it will be useful,
18 // but WITHOUT ANY WARRANTY; without even the implied warranty of
19 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 // GNU General Public License for more details.
21 //
22 // You should have received a copy of the GNU General Public License
23 // along with this program; if not, write to the Free Software
24 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
27 #ifndef HTTPDOWNLOAD_H
28 #define HTTPDOWNLOAD_H
30 #include "GuiEvents.h" // Needed for HTTP_Download_File
31 #include "MuleThread.h" // Needed for CMuleThread
33 class wxEvtHandler;
34 class wxHTTP;
35 class wxInputStream;
38 class CHTTPDownloadThread : public CMuleThread
40 public:
41 /** Note: wxChar* is used to circument the thread-unsafe wxString reference counting. */
42 CHTTPDownloadThread(const wxChar* url, const wxChar* filename, HTTP_Download_File file_id, bool showDialog = true);
44 private:
45 ExitCode Entry();
46 virtual void OnExit();
48 wxString m_url;
49 wxString m_tempfile;
50 int m_result;
51 HTTP_Download_File m_file_id;
52 wxEvtHandler* m_companion;
54 wxInputStream* GetInputStream(wxHTTP** url_handler, const wxString& location, bool proxy);
57 #endif // HTTPDOWNLOAD_H
58 // File_checked_for_headers