author | spiralman <spiralman> | 2002-07-19 18:37:09 (UTC) |
---|---|---|
committer | spiralman <spiralman> | 2002-07-19 18:37:09 (UTC) |
commit | 3d98febb63ff5dcbd2a711b6f120aa5e00a0b337 (patch) (unidiff) | |
tree | f4ca92851ae0f75a5d33c0badd7e81c9227b3571 /noncore/net/ubrowser/httpcomm.h | |
parent | e6b8378c45c717c11172b5af124aba6a0c6aecd3 (diff) | |
download | opie-3d98febb63ff5dcbd2a711b6f120aa5e00a0b337.zip opie-3d98febb63ff5dcbd2a711b6f120aa5e00a0b337.tar.gz opie-3d98febb63ff5dcbd2a711b6f120aa5e00a0b337.tar.bz2 |
initial add of ubrowser source
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 | }; | ||