OSDN Git Service

Move the directories
[kita/kita.git] / src / threadview.h
1 /***************************************************************************
2 *   Copyright (C) 2003 by Hideki Ikemoto                                  *
3 *   ikemo@users.sourceforge.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 KITATHREADVIEW_H
11 #define KITATHREADVIEW_H
12
13 #include <QtGui/QWidget>
14
15 #include <kurl.h>
16 #include <dom/html_base.h>
17
18 class QFrame;
19 class QHBoxLayout;
20 class QSpacerItem;
21 class QToolButton;
22 class QVBoxLayout;
23
24 class KComboBox;
25 class KXMLGUIClient;
26
27 /* mode , m_viewmode uses them. */
28 enum {
29     VIEWMODE_MAINVIEW,
30 };
31
32 namespace KIO
33 {
34     class Job;
35 }
36
37 namespace Kita
38 {
39     class HTMLPart;
40     class ThreadTabWidget;
41     class SubjectLabel;
42    
43     /**
44      *
45      * @author Hideki Ikemoto <ikemo@users.sourceforge.jp>
46      **/
47
48     class ThreadView : public QWidget
49     {
50         Q_OBJECT
51
52         ThreadTabWidget* m_parent;
53
54     public:
55         ThreadView(ThreadTabWidget* parent);
56         ~ThreadView();
57         const KUrl threadUrl() const;
58         const KUrl datUrl() const;
59         const QString selectedText() const;
60
61         void setup(const KUrl& datUrl, int mode);
62         void showStatusBar(const QString& information);
63         int getViewMode() { return m_viewmode; }
64
65     public slots:
66         virtual void setFocus();
67
68         void showThread(const KUrl& datUrl, int num);
69         void setFont(const QFont& font);
70         void slotReloadButton(int jumpNum = 0);
71         void slotStopLoading();
72         void focusSearchCombo();
73         void slotDeleteButtonClicked();
74         void slotSearchNext();
75         void slotSearchPrev();
76         void slotGobackAnchor();
77         void slotGotoHeader();
78         void slotGotoFooter();
79
80     protected slots:
81         void slotDOMNodeActivated(const DOM::Node& node);
82
83     private:
84         void insertSearchCombo();
85         void setSubjectLabel(const QString& boardName,
86                 const QString& threadName, const QString& boardUrl);
87         void updateButton();
88
89         ThreadView(const ThreadView&);
90         ThreadView& operator=(const ThreadView&);
91
92         int m_serverTime;
93         KUrl m_datUrl;
94         HTMLPart* m_threadPart;
95
96         bool m_revsearch;
97         int m_viewmode;
98         int m_rescode;
99
100         QToolButton* writeButton;
101         KComboBox* searchCombo;
102         QToolButton* highLightButton;
103         QToolButton* bookmarkButton;
104         QToolButton* reloadButton;
105         KComboBox* gotoCombo;
106         QToolButton* deleteButton;
107         QToolButton* closeButton;
108         QFrame* threadFrame;
109         QVBoxLayout* threadViewBaseLayout;
110         QHBoxLayout* layout2;
111         QSpacerItem* spacer2;
112
113     private slots:
114         void slotSearchButton();
115         void slotBookmarkButtonClicked(bool on);
116         void slotWriteButtonClicked(const QString& resstr = QString());
117         void slotComboActivated(int index);
118         void slotUpdateInfo();
119         void slotSearchPrivate(bool rev);
120         void slotCloseButton();
121
122     signals:
123         void showThreadCompleted(); /* to ThreadPart */
124     };
125 }
126
127 #endif