1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
5 // Modified by: Ryan Norton
7 // Copyright: (c) 1997, 1998 Guilhem Lavaux
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
19 #include "wx/protocol/protocol.h"
21 #if wxUSE_PROTOCOL_HTTP
22 #include "wx/protocol/http.h"
36 class WXDLLIMPEXP_FWD_NET wxURL
;
38 class WXDLLIMPEXP_NET wxURLNativeImp
: public wxObject
41 virtual ~wxURLNativeImp() { }
42 virtual wxInputStream
*GetInputStream(wxURL
*owner
) = 0;
44 #endif // wxUSE_URL_NATIVE
46 class WXDLLIMPEXP_NET wxURL
: public wxURI
49 wxURL(const wxString
& sUrl
= wxEmptyString
);
50 wxURL(const wxURI
& uri
);
51 wxURL(const wxURL
& url
);
54 wxURL
& operator = (const wxString
& url
);
55 wxURL
& operator = (const wxURI
& uri
);
56 wxURL
& operator = (const wxURL
& url
);
58 wxProtocol
& GetProtocol() { return *m_protocol
; }
59 wxURLError
GetError() const { return m_error
; }
60 wxString
GetURL() const { return m_url
; }
62 wxURLError
SetURL(const wxString
&url
)
63 { *this = url
; return m_error
; }
66 { return m_error
== wxURL_NOERR
; }
68 wxInputStream
*GetInputStream();
70 #if wxUSE_PROTOCOL_HTTP
71 static void SetDefaultProxy(const wxString
& url_proxy
);
72 void SetProxy(const wxString
& url_proxy
);
73 #endif // wxUSE_PROTOCOL_HTTP
76 static wxProtoInfo
*ms_protocols
;
78 #if wxUSE_PROTOCOL_HTTP
79 static wxHTTP
*ms_proxyDefault
;
80 static bool ms_useDefaultProxy
;
83 #endif // wxUSE_PROTOCOL_HTTP
86 friend class wxURLNativeImp
;
87 // pointer to a native URL implementation object
88 wxURLNativeImp
*m_nativeImp
;
89 // Creates on the heap and returns a native
90 // implementation object for the current platform.
91 static wxURLNativeImp
*CreateNativeImpObject();
92 #endif // wxUSE_URL_NATIVE
94 wxProtoInfo
*m_protoinfo
;
95 wxProtocol
*m_protocol
;
100 void Init(const wxString
&);
104 bool FetchProtocol();
106 friend class wxProtoInfo
;
107 friend class wxURLModule
;
110 DECLARE_DYNAMIC_CLASS(wxURL
)