X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c058d771426b4843f9096f68f919f5630b6f5879..c7fb814ac347c97d7e1d342ceb227dab50c721f6:/include/wx/protocol/protocol.h diff --git a/include/wx/protocol/protocol.h b/include/wx/protocol/protocol.h index d0126a922b..48bf1996af 100644 --- a/include/wx/protocol/protocol.h +++ b/include/wx/protocol/protocol.h @@ -15,10 +15,16 @@ #pragma interface #endif +#include "wx/defs.h" + + #include "wx/object.h" #include "wx/string.h" #include "wx/stream.h" + +#if wxUSE_SOCKETS #include "wx/socket.h" +#endif typedef enum { wxPROTO_NOERR = 0, @@ -30,7 +36,7 @@ typedef enum { wxPROTO_NOFILE, wxPROTO_ABRT, wxPROTO_RCNCT, - wxPROTO_STREAMING + wxPROTO_STREAMING } wxProtocolError; // For protocols @@ -53,27 +59,36 @@ protected: friend class wxURL; public: - wxProtoInfo(const char *name, const char *serv_name, const bool need_host1, + wxProtoInfo(const wxChar *name, const wxChar *serv_name, const bool need_host1, wxClassInfo *info); }; -class WXDLLEXPORT wxProtocol : public wxSocketClient { +class WXDLLEXPORT wxProtocol +#if wxUSE_SOCKETS + : public wxSocketClient { +#else + : public wxObject { +#endif DECLARE_ABSTRACT_CLASS(wxProtocol) public: wxProtocol(); +#if wxUSE_SOCKETS bool Reconnect(); - virtual bool Connect( const wxString& WXUNUSED(host) ) { return FALSE; } - virtual bool Connect( wxSockAddress& addr) { return wxSocketClient::Connect(addr); } + virtual bool Connect( const wxString& WXUNUSED(host) ) { return FALSE; } + virtual bool Connect( wxSockAddress& addr, bool WXUNUSED(wait) = TRUE) { return wxSocketClient::Connect(addr); } +#endif virtual bool Abort() = 0; virtual wxInputStream *GetInputStream(const wxString& path) = 0; virtual wxProtocolError GetError() = 0; - virtual wxString GetContentType() { return (char *)NULL; } + virtual wxString GetContentType() { return wxEmptyString; } virtual void SetUser(const wxString& WXUNUSED(user)) {} virtual void SetPassword(const wxString& WXUNUSED(passwd) ) {} }; +#if wxUSE_SOCKETS wxProtocolError WXDLLEXPORT GetLine(wxSocketBase *sock, wxString& result); - #endif + +#endif // _WX_PROTOCOL_PROTOCOL_H