OSDN Git Service

merge from k2ch
[kita/kita.git] / src / kitathreadview.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
11 #ifndef _KITATHREADVIEW_H_
12 #define _KITATHREADVIEW_H_
13
14 #include <qwidget.h>
15 #include <qcstring.h>
16 #include <qlineedit.h>
17
18 #include <kurl.h>
19 #include <dom/dom_node.h>
20 #include <kparts/browserextension.h>
21
22 #include "kitathreadviewbase.h"
23
24 class KURL;
25 class KHTMLPart;
26
27 namespace KIO {
28   class Job;
29 };
30
31 /**
32  * 
33  * Hideki Ikemoto
34  **/
35
36 class KitaThreadView : public KitaThreadViewBase
37 {
38   Q_OBJECT
39
40 public:
41   KitaThreadView(QWidget *parent, const char *name=0);
42   ~KitaThreadView();
43   QString threadSubject() const;
44   QStringList parseSearchQuery(const QString &input);
45   void searchNext(const QStringList &input);
46   void highLighten(bool yes, const QStringList &input);
47
48 signals:
49   void showThreadCompleted();
50   void datURLRedirected(const KURL& newDatURL);
51   void openURLRequest( const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() );
52   void createNewWindow( const KURL &url, const KParts::URLArgs &args = KParts::URLArgs() );
53   void setLocationBarURL( const QString &url );
54   void enableAction( const char * name, bool enabled );
55
56 public slots:
57   void slotReceiveThreadData(KIO::Job* job, const QByteArray& data);
58   void slotRedirection(KIO::Job* job, const KURL &);
59   void slotThreadResult(KIO::Job* job);
60   void slotWriteButtonClicked();
61   void slotReceiveWriteResult(KIO::Job* job,  const QByteArray & data);
62   void slotWriteResult(KIO::Job* job);
63   void slotCanceled(KIO::Job* job);
64   void slotDisplayContents(const QString& input, const KURL& urlOfInput = 0);
65
66 protected slots:
67   void slotDOMNodeActivated(const DOM::Node &node);
68
69 private: // Private attributes
70   KHTMLPart* threadPart;
71   QCString m_threadData;
72   KURL m_datURL;
73   KURL m_boardURL;
74   KURL m_threadURL;
75   QCString m_writeResult;
76   int serverTime;
77   QString m_boardID;
78   QString m_datName;
79   QString m_boardName;
80
81 private:
82   QWidget * m_parent;
83   KIO::Job * m_currentJob;
84   QString m_subject;
85   QString m_contents;
86   QStringList m_prevquery;
87   int m_labelMaxLength;
88   int m_rescount;
89   int m_hitcount;
90   int m_nextHit;
91   void highLightenNodes(DOM::NodeList nodes, const QStringList &query);
92   static QStringList lt_gt_spliter( const QString & input );
93   void insertSearchCombo();
94
95 private slots:
96   void slotSearchButton();
97   void slotHighLightenButton(bool yes);
98   void slotOnURL(const QString& url);
99   void slotShowThread(const KURL& _datURL, const KURL& _boardURL, const QString& boardName);
100 signals:
101   void signalChangeStatusbar(const QString&);
102 };
103
104 #endif