1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Guilhem Lavaux
5 // Modified by: Ryan Norton
8 // Copyright: (c) 1997, 1998 Guilhem Lavaux
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "url.h"
24 #include "wx/protocol/protocol.h"
26 #if wxUSE_PROTOCOL_HTTP
27 #include "wx/protocol/http.h"
41 class WXDLLIMPEXP_NET wxURL
;
43 class WXDLLIMPEXP_NET wxURLNativeImp
: public wxObject
46 virtual ~wxURLNativeImp() { }
47 virtual wxInputStream
*GetInputStream(wxURL
*owner
) = 0;
49 #endif // wxUSE_URL_NATIVE
51 class WXDLLIMPEXP_NET wxURL
: public wxURI
54 wxURL(const wxString
& sUrl
);
55 wxURL(const wxURI
& url
);
58 wxURL
& operator = (const wxString
& url
);
59 wxURL
& operator = (const wxURI
& url
);
61 wxProtocol
& GetProtocol() { return *m_protocol
; }
62 wxURLError
GetError() const { return m_error
; }
63 wxString
GetURL() const { return m_url
; }
65 wxInputStream
*GetInputStream();
68 static void SetDefaultProxy(const wxString
& url_proxy
);
69 void SetProxy(const wxString
& url_proxy
);
70 #endif // wxUSE_SOCKETS
72 #if WXWIN_COMPATIBILITY_2_4
73 //Use the proper wxURI accessors instead
74 wxString
GetProtocolName() const { return m_scheme
; }
75 wxString
GetHostName() const { return m_server
; }
76 wxString
GetPath() const { return m_path
; }
78 //Use wxURI instead - this does not work that well
79 wxDEPRECATED( static wxString
ConvertToValidURI(
81 const wxChar
* delims
= wxT(";/?:@&=+$,")
84 //Use wxURI::Unescape instead
85 wxDEPRECATED( static wxString
ConvertFromURI(const wxString
& uri
) );
89 static wxProtoInfo
*ms_protocols
;
91 #if wxUSE_PROTOCOL_HTTP
92 static wxHTTP
*ms_proxyDefault
;
93 static bool ms_useDefaultProxy
;
95 #endif // wxUSE_PROTOCOL_HTTP
98 friend class wxURLNativeImp
;
99 // pointer to a native URL implementation object
100 wxURLNativeImp
*m_nativeImp
;
101 // Creates on the heap and returns a native
102 // implementation object for the current platform.
103 static wxURLNativeImp
*CreateNativeImpObject();
105 wxProtoInfo
*m_protoinfo
;
106 wxProtocol
*m_protocol
;
112 void Init(const wxString
&);
115 bool FetchProtocol();
117 friend class wxProtoInfo
;
118 friend class wxURLModule
;
121 DECLARE_DYNAMIC_CLASS(wxURL
)