]>
Commit | Line | Data |
---|---|---|
23324ae1 FM |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: protocol/protocol.h | |
e54c96f1 | 3 | // Purpose: interface of wxProtocol |
23324ae1 FM |
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 | |
7c913512 FM |
12 | |
13 | ||
23324ae1 FM |
14 | @library{wxnet} |
15 | @category{FIXME} | |
7c913512 | 16 | |
e54c96f1 | 17 | @see wxSocketBase, wxURL |
23324ae1 FM |
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 | ||
23324ae1 FM |
37 | @b wxPROTO_NOERR |
38 | ||
23324ae1 FM |
39 | No error. |
40 | ||
41 | @b wxPROTO_NETERR | |
42 | ||
23324ae1 FM |
43 | A generic network error occurred. |
44 | ||
45 | @b wxPROTO_PROTERR | |
46 | ||
23324ae1 FM |
47 | An error occurred during negotiation. |
48 | ||
49 | @b wxPROTO_CONNERR | |
50 | ||
23324ae1 FM |
51 | The client failed to connect the server. |
52 | ||
53 | @b wxPROTO_INVVAL | |
54 | ||
23324ae1 FM |
55 | Invalid value. |
56 | ||
57 | @b wxPROTO_NOHNDLR | |
58 | ||
23324ae1 FM |
59 | . |
60 | ||
61 | @b wxPROTO_NOFILE | |
62 | ||
23324ae1 FM |
63 | The remote file doesn't exist. |
64 | ||
65 | @b wxPROTO_ABRT | |
66 | ||
23324ae1 FM |
67 | Last action aborted. |
68 | ||
69 | @b wxPROTO_RCNCT | |
70 | ||
23324ae1 FM |
71 | An error occurred during reconnection. |
72 | ||
73 | @b wxPROTO_STREAM | |
74 | ||
23324ae1 FM |
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 | |
4cc4bfaf FM |
87 | yourself once you don't use it anymore. The destructor |
88 | closes the network connection. | |
23324ae1 | 89 | |
4cc4bfaf | 90 | @see wxInputStream |
23324ae1 | 91 | */ |
4cc4bfaf | 92 | wxInputStream* GetInputStream(const wxString& path); |
23324ae1 FM |
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 | }; | |
e54c96f1 | 112 |