katemainwindow.h
00001 /* This file is part of the KDE project 00002 Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org> 00003 Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org> 00004 Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License version 2 as published by the Free Software Foundation. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef __KATE_MAINWINDOW_H__ 00022 #define __KATE_MAINWINDOW_H__ 00023 00024 #include "katemain.h" 00025 #include "katemdi.h" 00026 00027 #include <kate/view.h> 00028 #include <kate/document.h> 00029 00030 #include <kparts/part.h> 00031 00032 #include <kaction.h> 00033 00034 class KateTabWidget; 00035 class GrepTool; 00036 00037 namespace Kate { 00038 class MainWindow; 00039 class ToolViewManager; 00040 } 00041 00042 class KFileItem; 00043 class KRecentFilesAction; 00044 class DCOPObject; 00045 00046 class KateExternalToolsMenuAction; 00047 00048 class KateMainWindow : public KateMDI::MainWindow, virtual public KParts::PartBase 00049 { 00050 Q_OBJECT 00051 00052 friend class KateConfigDialog; 00053 friend class KateViewManager; 00054 00055 public: 00061 KateMainWindow (KConfig *sconfig, const TQString &sgroup); 00062 00066 ~KateMainWindow(); 00067 00071 public: 00072 Kate::MainWindow *mainWindow () { return m_mainWindow; } 00073 Kate::ToolViewManager *toolViewManager () { return m_toolViewManager; } 00074 00075 KateViewManager *viewManager () { return m_viewManager; } 00076 00077 DCOPObject *dcopObject () { return m_dcop; } 00078 00082 public: 00085 KURL activeDocumentUrl(); 00086 00087 uint mainWindowNumber () const { return myID; } 00088 00096 bool showModOnDiskPrompt(); 00097 00102 KateTabWidget *tabWidget (); 00103 00104 public: 00105 void readProperties(KConfig *config); 00106 void saveProperties(KConfig *config); 00107 void saveGlobalProperties( KConfig* sessionConfig ); 00108 00109 public: 00110 bool queryClose_internal(); 00111 00112 private: 00113 void setupMainWindow(); 00114 void setupActions(); 00115 bool queryClose(); 00116 00120 void readOptions(); 00121 00125 void saveOptions(); 00126 00127 void dragEnterEvent( TQDragEnterEvent * ); 00128 void dropEvent( TQDropEvent * ); 00129 00134 private slots: 00135 void newWindow (); 00136 00137 void slotConfigure(); 00138 00139 void slotOpenWithMenuAction(int idx); 00140 00141 void slotGrepToolItemSelected ( const TQString &filename, int linenumber ); 00142 void slotMail(); 00143 00144 void slotFileQuit(); 00145 void slotEditToolbars(); 00146 void slotNewToolbarConfig(); 00147 void slotWindowActivated (); 00148 void slotUpdateOpenWith(); 00149 void documentMenuAboutToShow(); 00150 void slotDropEvent(TQDropEvent *); 00151 void editKeys(); 00152 void mSlotFixOpenWithMenu(); 00153 00154 void fileSelected(const KFileItem *file); 00155 00156 void tipOfTheDay(); 00157 00158 /* to update the caption */ 00159 void slotDocumentCreated (Kate::Document *doc); 00160 void updateCaption (Kate::Document *doc); 00161 00162 void pluginHelp (); 00163 void slotFullScreen(bool); 00164 00165 public: 00166 void openURL (const TQString &name=0L); 00167 00168 private slots: 00169 void updateGrepDir (bool visible); 00170 00171 protected: 00172 bool event( TQEvent * ); 00173 00174 private slots: 00175 void slotDocumentCloseAll(); 00176 00177 private: 00178 static uint uniqueID; 00179 uint myID; 00180 00181 Kate::MainWindow *m_mainWindow; 00182 Kate::ToolViewManager *m_toolViewManager; 00183 00184 bool syncKonsole; 00185 bool modNotification; 00186 00187 DCOPObject *m_dcop; 00188 00189 // console 00190 KateConsole *console; 00191 00192 // management items 00193 KateViewManager *m_viewManager; 00194 00195 KRecentFilesAction *fileOpenRecent; 00196 00197 KateFileList *filelist; 00198 KateFileSelector *fileselector; 00199 00200 KActionMenu* documentOpenWith; 00201 00202 TQPopupMenu *documentMenu; 00203 00204 KToggleAction* settingsShowFilelist; 00205 KToggleAction* settingsShowFileselector; 00206 00207 KateExternalToolsMenuAction *externalTools; 00208 GrepTool * greptool; 00209 bool m_modignore, m_grrr; 00210 00211 KateTabWidget *m_tabWidget; 00212 }; 00213 00214 #endif 00215 00216 // kate: space-indent on; indent-width 2; replace-tabs on;