1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
5 // Modified by: Ryan Norton
8 // Copyright: (c) 1997, 1998 Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
20 #include "wx/protocol/protocol.h"
22 #if wxUSE_PROTOCOL_HTTP
23 #include "wx/protocol/http.h"
37 class WXDLLIMPEXP_NET wxURL
;
39 class WXDLLIMPEXP_NET wxURLNativeImp
: public wxObject
42 virtual ~wxURLNativeImp() { }
43 virtual wxInputStream
*GetInputStream(wxURL
*owner
) = 0;
45 #endif // wxUSE_URL_NATIVE
47 class WXDLLIMPEXP_NET wxURL
: public wxURI
50 wxURL(const wxString
& sUrl
);
51 wxURL(const wxURI
& url
);
54 wxURL
& operator = (const wxString
& url
);
55 wxURL
& operator = (const wxURI
& url
);
57 wxProtocol
& GetProtocol() { return *m_protocol
; }
58 wxURLError
GetError() const { return m_error
; }
59 wxString
GetURL() const { return m_url
; }
61 wxInputStream
*GetInputStream();
63 #if wxUSE_PROTOCOL_HTTP
64 static void SetDefaultProxy(const wxString
& url_proxy
);
65 void SetProxy(const wxString
& url_proxy
);
66 #endif // wxUSE_PROTOCOL_HTTP
68 #if WXWIN_COMPATIBILITY_2_4
69 //Use the proper wxURI accessors instead
70 wxDEPRECATED( wxString
GetProtocolName() const );
71 wxDEPRECATED( wxString
GetHostName() const );
72 wxDEPRECATED( wxString
GetPath() const );
74 //Use wxURI instead - this does not work that well
75 wxDEPRECATED( static wxString
ConvertToValidURI(
77 const wxChar
* delims
= wxT(";/?:@&=+$,")
80 //Use wxURI::Unescape instead
81 wxDEPRECATED( static wxString
ConvertFromURI(const wxString
& uri
) );
85 static wxProtoInfo
*ms_protocols
;
87 #if wxUSE_PROTOCOL_HTTP
88 static wxHTTP
*ms_proxyDefault
;
89 static bool ms_useDefaultProxy
;
91 #endif // wxUSE_PROTOCOL_HTTP
94 friend class wxURLNativeImp
;
95 // pointer to a native URL implementation object
96 wxURLNativeImp
*m_nativeImp
;
97 // Creates on the heap and returns a native
98 // implementation object for the current platform.
99 static wxURLNativeImp
*CreateNativeImpObject();
101 wxProtoInfo
*m_protoinfo
;
102 wxProtocol
*m_protocol
;
108 void Init(const wxString
&);
111 bool FetchProtocol();
113 friend class wxProtoInfo
;
114 friend class wxURLModule
;
117 DECLARE_DYNAMIC_CLASS(wxURL
)