kate
katemainwindow.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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
00197 KateConsole *console;
00198
00199
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