OSDN Git Service

refactoring.
[kita/kita.git] / kita / src / mainwindow.h
1 /***************************************************************************
2 *   Copyright (C) 2004 by Kita Developers                                 *
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
11 #ifndef _KITA_H_
12 #define _KITA_H_
13
14 #ifdef HAVE_CONFIG_H
15 #include <config.h>
16 #endif
17
18 #include <kapplication.h>
19 #include <kparts/dockmainwindow.h>
20
21 class KPrinter;
22 class KToggleAction;
23 class KURL;
24 class KLineEdit;
25
26 class KitaBBSDock;
27 class KitaBBSTabWidget;
28 class KitaBoardTabWidget;
29 class KitaBoardDock;
30 class KitaThreadDock;
31 class KitaThreadTabWidget;
32 class KitaWriteDock;
33 class KitaWriteTabWidget;
34
35 namespace KParts
36 {
37     class URLArgs;
38     class Part;
39 }
40
41 /**
42  * This class serves as the main window for Kita.  It handles the
43  * menus, toolbars, and status bars.
44  *
45  * @short Main window class
46  * @author $AUTHOR <$EMAIL>
47  * @version $APP_VERSION
48  */
49
50 class KitaMainWindow : public KDockMainWindow
51 {
52     Q_OBJECT
53 public:
54     KitaMainWindow();
55     virtual ~KitaMainWindow();
56
57     void load( const KURL& url );
58     void slotSetMainStatusbar( const QString& statusStr );
59     void setUrl( const KURL& url );
60     void bookmark( const QString& datURL, bool on );
61
62 private slots:
63     void closeSubjectView();
64     void login();
65     void newToolbarConfig();
66     void optionsShowToolbar();
67     void optionsShowStatusbar();
68     void optionsConfigureKeys();
69     void optionsConfigureToolbars();
70     void optionsPreferences();
71     void settingsMenuAboutToShow();
72     void setFont( const QFont& font );
73
74     void slotCheckSubjectToggleAction( bool check );
75     void slotCheckWriteToggleAction( bool check );
76     void slotEditCopy();
77     void slotURLLine();
78
79 private:
80     KLineEdit* m_urlLine;
81
82     KToggleAction *m_toolbarAction;
83     KToggleAction *m_statusbarAction;
84     KToggleAction* m_subjectListAction;
85     KToggleAction* m_showWriteDockAction;
86     KAction* m_toggleViewAction;
87
88     KDockWidget* m_dummyDock; /* dummy MainDockWidget */
89     KitaBoardDock* m_boardDock;
90     KitaThreadDock* m_threadDock;
91     KitaWriteDock* m_writeDock;
92
93     KitaThreadTabWidget* m_threadTab;
94     KitaBBSTabWidget* m_bbsTab;
95     KitaBoardTabWidget* m_boardTab;
96     KitaWriteTabWidget* m_writeTab;
97
98     void setupActions();
99     void setupView();
100     void loadCache();
101     void saveCache();
102     void loadFavorites();
103     void saveFavorites();
104     void loadFavoriteBoards();
105     void saveFavoriteBoards();
106     void loadCompletion();
107     void loadStyleSheet();
108     void saveStyleSheet();
109     void loadAsciiArt();
110     void loadAboneIDList();
111     void loadAboneNameList();
112     void loadAboneWordList();
113 };
114
115 #endif // _KITA_H_