1 /***************************************************************************
2 * Copyright (C) 2004 by Kita Developers *
3 * ikemo@users.sourceforge.jp *
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 ***************************************************************************/
18 #include <kapplication.h>
19 #include <kparts/dockmainwindow.h>
27 class KitaBBSTabWidget;
28 class KitaBoardTabWidget;
31 class KitaThreadTabWidget;
33 class KitaImgTabWidget;
35 class KitaWriteTabWidget;
44 * This class serves as the main window for Kita. It handles the
45 * menus, toolbars, and status bars.
47 * @short Main window class
48 * @author $AUTHOR <$EMAIL>
49 * @version $APP_VERSION
52 class KitaMainWindow : public KParts::DockMainWindow
64 virtual ~KitaMainWindow();
67 * Use this method to load whatever file/URL you have
69 void load( const KURL& url );
73 * Overridden virtuals for Qt drag 'n drop (XDND)
75 virtual void dragEnterEvent( QDragEnterEvent* event );
76 virtual void dropEvent( QDropEvent* event );
79 * This function is called when it is time for the app to save its
80 * properties for session management purposes.
82 void saveProperties( KConfig* );
85 * This function is called when this app is restored. The KConfig
86 * object points to the session management config file that was saved
87 * with @ref saveProperties
89 void readProperties( KConfig* );
93 void optionsShowToolbar();
94 void optionsShowStatusbar();
95 void optionsConfigureKeys();
96 void optionsConfigureToolbars();
97 void optionsPreferences();
98 void newToolbarConfig();
99 void windowToggleView();
100 void settingsMenuAboutToShow();
102 void resetWindowsCust();
103 void resetWindowsDef1();
104 void resetWindowsDef2();
105 void resetWindowsDef3();
106 void closeSubjectView();
107 void slotCheckBoardToggleAction( bool check );
108 void slotCheckSubjectToggleAction( bool check );
109 void slotCheckNaviToggleAction( bool check );
110 void slotCheckImgToggleAction( bool check );
111 void slotCheckWriteToggleAction( bool check );
114 void slotSetMainStatusbar( const QString& statusStr );
115 void slotOpenURLRequest( const KURL& url, const KParts::URLArgs& );
116 void slotOpenURLRequestExt( const KURL& url, const KParts::URLArgs& args,
117 QString mimetype = QString::null,
119 const KURL& usrUrl1 = KURL() );
121 void setFont( const QFont& font );
123 void setUrl( const KURL& url );
124 void bookmark( const QString& datURL, bool on );
125 void slotSetMainCaption( const QString& captionStr );
128 KLineEdit* m_urlLine;
131 KToggleAction *m_toolbarAction;
132 KToggleAction *m_statusbarAction;
133 KToggleAction *m_boardListAction;
134 KToggleAction* m_subjectListAction;
135 KToggleAction* m_showImgViewAction;
136 KToggleAction* m_showNaviAction;
137 KToggleAction* m_showWriteDockAction;
138 KAction* m_toggleViewAction;
140 KDockWidget* m_dummyDock; /* dummy MainDockWidget */
141 KitaBBSDock* m_bbsDock;
142 KitaBoardDock* m_boardDock;
143 KitaThreadDock* m_threadDock;
144 KitaThreadDock* m_naviDock;
145 KitaImgDock* m_imageDock;
146 KitaWriteDock* m_writeDock;
148 KitaThreadTabWidget* m_threadTab;
149 KitaBBSTabWidget* m_bbsTab;
150 KitaBoardTabWidget* m_boardTab;
151 KitaImgTabWidget* m_imgTab;
152 KitaThreadTabWidget* m_naviTab;
153 KitaWriteTabWidget* m_writeTab;
160 void loadFavorites();
161 void saveFavorites();
162 void loadFavoriteBoards();
163 void saveFavoriteBoards();
164 void loadCompletion();
165 void saveCompletion();
166 void loadStyleSheet();
167 void saveStyleSheet();
170 void loadAboneIDList();
171 void saveAboneIDList();
172 void loadAboneNameList();
173 void saveAboneNameList();
174 void loadAboneWordList();
175 void saveAboneWordList();
176 void resetWindows( int pattern );
179 void favoritesUpdated();
180 void switchSubjectView();