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
= wxEmptyString
);
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 wxURLError
SetURL(const wxString
&url
)
62 { *this = url
; return m_error
; }
65 { return m_error
== wxURL_NOERR
; }
67 wxInputStream
*GetInputStream();
69 #if wxUSE_PROTOCOL_HTTP
70 static void SetDefaultProxy(const wxString
& url_proxy
);
71 void SetProxy(const wxString
& url_proxy
);
72 #endif // wxUSE_PROTOCOL_HTTP
74 #if WXWIN_COMPATIBILITY_2_4
75 //Use the proper wxURI accessors instead
76 wxDEPRECATED( wxString
GetProtocolName() const );
77 wxDEPRECATED( wxString
GetHostName() const );
78 wxDEPRECATED( wxString
GetPath() const );
80 //Use wxURI instead - this does not work that well
81 wxDEPRECATED( static wxString
ConvertToValidURI(
83 const wxChar
* delims
= wxT(";/?:@&=+$,")
86 //Use wxURI::Unescape instead
87 wxDEPRECATED( static wxString
ConvertFromURI(const wxString
& uri
) );
91 static wxProtoInfo
*ms_protocols
;
93 #if wxUSE_PROTOCOL_HTTP
94 static wxHTTP
*ms_proxyDefault
;
95 static bool ms_useDefaultProxy
;
97 #endif // wxUSE_PROTOCOL_HTTP
100 friend class wxURLNativeImp
;
101 // pointer to a native URL implementation object
102 wxURLNativeImp
*m_nativeImp
;
103 // Creates on the heap and returns a native
104 // implementation object for the current platform.
105 static wxURLNativeImp
*CreateNativeImpObject();
107 wxProtoInfo
*m_protoinfo
;
108 wxProtocol
*m_protocol
;
114 void Init(const wxString
&);
117 bool FetchProtocol();
119 friend class wxProtoInfo
;
120 friend class wxURLModule
;
123 DECLARE_DYNAMIC_CLASS(wxURL
)