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