]> git.saurik.com Git - wxWidgets.git/blob - interface/protocol/protocol.h
further wxPenStyle/wxBrushStyle fixes for builds with compat off (partially by Marcin...
[wxWidgets.git] / interface / protocol / protocol.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: protocol/protocol.h
3 // Purpose: interface of wxProtocol
4 // Author: wxWidgets team
5 // RCS-ID: $Id$
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
8
9 /**
10 @class wxProtocol
11 @headerfile protocol.h wx/protocol/protocol.h
12
13
14 @library{wxnet}
15 @category{FIXME}
16
17 @see wxSocketBase, wxURL
18 */
19 class wxProtocol : public wxSocketClient
20 {
21 public:
22 /**
23 Abort the current stream.
24
25 @returns Returns @true, if successful, else @false.
26 */
27 bool Abort();
28
29 /**
30 Returns the type of the content of the last opened stream. It is a mime-type.
31 */
32 wxString GetContentType();
33
34 /**
35 Returns the last occurred error.
36
37 @b wxPROTO_NOERR
38
39 No error.
40
41 @b wxPROTO_NETERR
42
43 A generic network error occurred.
44
45 @b wxPROTO_PROTERR
46
47 An error occurred during negotiation.
48
49 @b wxPROTO_CONNERR
50
51 The client failed to connect the server.
52
53 @b wxPROTO_INVVAL
54
55 Invalid value.
56
57 @b wxPROTO_NOHNDLR
58
59 .
60
61 @b wxPROTO_NOFILE
62
63 The remote file doesn't exist.
64
65 @b wxPROTO_ABRT
66
67 Last action aborted.
68
69 @b wxPROTO_RCNCT
70
71 An error occurred during reconnection.
72
73 @b wxPROTO_STREAM
74
75 Someone tried to send a command during a transfer.
76 */
77 wxProtocolError GetError();
78
79 /**
80 Creates a new input stream on the specified path. You can use all but seek
81 functionality of wxStream. Seek isn't available on all streams. For example,
82 HTTP or FTP streams don't deal with it. Other functions like StreamSize and
83 Tell aren't available for the moment for this sort of stream.
84 You will be notified when the EOF is reached by an error.
85
86 @returns Returns the initialized stream. You will have to delete it
87 yourself once you don't use it anymore. The destructor
88 closes the network connection.
89
90 @see wxInputStream
91 */
92 wxInputStream* GetInputStream(const wxString& path);
93
94 /**
95 Tries to reestablish a previous opened connection (close and renegotiate
96 connection).
97
98 @returns @true, if the connection is established, else @false.
99 */
100 bool Reconnect();
101
102 /**
103 Sets the authentication password. It is mainly useful when FTP is used.
104 */
105 void SetPassword(const wxString& user);
106
107 /**
108 Sets the authentication user. It is mainly useful when FTP is used.
109 */
110 void SetUser(const wxString& user);
111 };
112