Diffstat (limited to 'noncore/net/ubrowser/httpcomm.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/ubrowser/httpcomm.h | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/noncore/net/ubrowser/httpcomm.h b/noncore/net/ubrowser/httpcomm.h new file mode 100644 index 0000000..c20fe72 --- a/dev/null +++ b/noncore/net/ubrowser/httpcomm.h | |||
@@ -0,0 +1,57 @@ | |||
1 | /* | ||
2 | Opie-uBrowser. a very small web browser, using on QTextBrowser for html display/parsing | ||
3 | Copyright (C) 2002 Thomas Stephens | ||
4 | |||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | ||
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | ||
7 | version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | ||
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | ||
11 | Public License for more details. | ||
12 | |||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | ||
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
15 | */ | ||
16 | |||
17 | #include <qobject.h> | ||
18 | #include <qstring.h> | ||
19 | #include <qsocket.h> | ||
20 | #include <qstringlist.h> | ||
21 | #include <qdragobject.h> | ||
22 | #include <qtextbrowser.h> | ||
23 | |||
24 | #include <stdio.h> | ||
25 | |||
26 | class HttpComm : public QObject | ||
27 | { | ||
28 | Q_OBJECT | ||
29 | public: | ||
30 | HttpComm(QSocket *newSocket, QTextBrowser *newBrowser); | ||
31 | void setUp(QString *newName); | ||
32 | void setStuff(QString newHost, QString newPortS, QString newFile, QTextDrag *newText); | ||
33 | void parseHeader(); | ||
34 | void processBody(); | ||
35 | public slots: | ||
36 | void hostFound(); | ||
37 | void connected(); | ||
38 | void connectionClosed(); | ||
39 | void incoming(); | ||
40 | private: | ||
41 | QString *name; | ||
42 | QSocket *socket; | ||
43 | QString host; | ||
44 | QString portS; | ||
45 | QString file; | ||
46 | bool headerRead; | ||
47 | QString header; | ||
48 | QString body; | ||
49 | unsigned int length; | ||
50 | unsigned int bRead; | ||
51 | QTextDrag *text; | ||
52 | QTextBrowser *browser; | ||
53 | bool chunked; | ||
54 | bool lengthset; | ||
55 | unsigned int clength; | ||
56 | int status; | ||
57 | }; | ||