OSDN Git Service

323c4188fa348a80d88a86f405cf96fefa097a30
[kita/kita.git] / kita / src / libkita / access.h
1 /***************************************************************************
2 *   Copyright (C) 2003 by Hideki Ikemoto                                  *
3 *   ikemo@wakaba.jp                                                       *
4 *                                                                         *
5 *   This program is free software; you can redistribute it and/or modify  *
6 *   it under the terms of the GNU General Public License as published by  *
7 *   the Free Software Foundation; either version 2 of the License, or     *
8 *   (at your option) any later version.                                   *
9 ***************************************************************************/
10 #ifndef KITAACCESS_H
11 #define KITAACCESS_H
12
13 #include <kurl.h>
14
15 #include <qobject.h>
16
17 namespace KIO
18 {
19     class Job;
20 }
21
22 namespace Kita
23 {
24     class Thread;
25
26     /**
27     @author Hideki Ikemoto
28     */
29     class Access : public QObject
30     {
31         Q_OBJECT
32
33     public:
34         Access( const KURL& url ) : m_url( url ), m_currentJob( 0 ) {};
35         ~Access() {};
36
37         QString get();
38         void killJob();
39         void stopJob();
40         int serverTime();
41         QString getcache();
42         QString getupdate();
43         int responseCode();
44         static bool deleteLog( const Thread* thread, QWidget* parent );
45
46     private:
47         void writeCacheData();
48         void parse_machiBBS();
49         void make_cacheDir( const KURL& url );
50
51         const KURL m_url;
52         KIO::Job* m_currentJob;
53         QString m_threadData;
54         QString m_header;
55         QString m_orgData;
56         bool m_firstReceive;
57         bool m_invalidDataReceived;
58
59     private slots:
60         void slotReceiveThreadData( KIO::Job* job, const QByteArray& data );
61         void slotThreadResult( KIO::Job* job );
62
63     signals:
64         void redirection( const QString& );
65         void receiveData( const QString& );
66         void finishLoad();
67     };
68
69 }
70
71 #endif