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 <tdeparts/part.h> 00031 00032 #include <tdeaction.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 TDERecentFilesAction; 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 (TDEConfig *sconfig, const TQString &sgroup); 00062 00066 ~KateMainWindow(); 00067 00071 Kate::MainWindow *mainWindow () { return m_mainWindow; } 00072 Kate::ToolViewManager *toolViewManager () { return m_toolViewManager; } 00073 00074 KateViewManager *viewManager () { return m_viewManager; } 00075 00076 DCOPObject *dcopObject () { return m_dcop; } 00077 00083 KURL activeDocumentUrl(); 00084 00085 uint mainWindowNumber () const { return myID; } 00086 00094 bool showModOnDiskPrompt(); 00095 00100 KateTabWidget *tabWidget (); 00101 00102 void readProperties(TDEConfig *config); 00103 void saveProperties(TDEConfig *config); 00104 00105 bool queryClose_internal(); 00106 00107 void openURL (const TQString &name=0L); 00108 00109 public slots: 00113 void slotSelectionChanged(); 00114 00121 void activateSession(int sessionId); 00122 00123 private: 00124 void setupMainWindow(); 00125 void setupActions(); 00126 bool queryClose(); 00127 00131 void readOptions(); 00132 00136 void saveOptions(); 00137 00138 void dragEnterEvent( TQDragEnterEvent * ); 00139 void dropEvent( TQDropEvent * ); 00140 00141 private slots: 00146 void newWindow (); 00147 00148 void slotConfigure(); 00149 00150 void slotOpenWithMenuAction(int idx); 00151 00152 void slotGrepToolItemSelected ( const TQString &filename, int linenumber ); 00153 void slotMail(); 00154 00155 void slotFileQuit(); 00156 void slotEditToolbars(); 00157 void slotNewToolbarConfig(); 00158 void slotWindowActivated (); 00159 void slotUpdateOpenWith(); 00160 void documentMenuAboutToShow(); 00161 void slotDropEvent(TQDropEvent *); 00162 void editKeys(); 00163 void mSlotFixOpenWithMenu(); 00164 00165 void fileSelected(const KFileItem *file); 00166 00167 void tipOfTheDay(); 00168 00169 /* to update the caption */ 00170 void slotDocumentCreated(Kate::Document *doc); 00171 void slotNameChanged(Kate::Document *doc); 00172 void updateCaption(Kate::Document *doc); 00173 00174 void pluginHelp(); 00175 void slotFullScreen(bool); 00176 00177 void updateGrepDir (bool visible); 00178 void slotDocumentCloseAll(); 00179 00180 protected: 00181 bool event( TQEvent * ); 00182 00183 private: 00184 static uint uniqueID; 00185 uint myID; 00186 00187 Kate::MainWindow *m_mainWindow; 00188 Kate::ToolViewManager *m_toolViewManager; 00189 00190 bool syncKonsole; 00191 bool useInstance; 00192 bool modNotification; 00193 00194 DCOPObject *m_dcop; 00195 00196 // console 00197 KateConsole *console; 00198 00199 // management items 00200 KateViewManager *m_viewManager; 00201 00202 TDERecentFilesAction *fileOpenRecent; 00203 00204 KateFileList *filelist; 00205 KateFileSelector *fileselector; 00206 KateSessionPanel *m_sessionpanel; 00207 00208 TDEActionMenu* documentOpenWith; 00209 00210 TQPopupMenu *documentMenu; 00211 00212 TDEToggleAction* settingsShowFilelist; 00213 TDEToggleAction* settingsShowFileselector; 00214 00215 KateExternalToolsMenuAction *externalTools; 00216 GrepTool * greptool; 00217 bool m_modignore, m_grrr; 00218 00219 KateTabWidget *m_tabWidget; 00220 }; 00221 00222 class KateSessionListActionMenu : public TDEActionMenu 00223 { 00224 Q_OBJECT 00225 00226 public: 00227 KateSessionListActionMenu(KateMainWindow *mw, const TQString &text, TQObject *parent = NULL, const char *name = NULL); 00228 ~KateSessionListActionMenu() {} 00229 00230 public slots: 00231 void slotAboutToShow(); 00232 00233 protected: 00234 KateMainWindow *m_mainWindow; 00235 }; 00236 00237 #endif 00238 00239 // kate: space-indent on; indent-width 2; replace-tabs on;
Trinity API Reference