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 "../interfaces/mainwindow.h"
00026
#include "../interfaces/toolviewmanager.h"
00027
00028
#include "kateviewmanager.h"
00029
00030
#include "kateprojectmanager.h"
00031
00032
#include <kate/view.h>
00033
#include <kate/document.h>
00034
00035
#include <kparts/part.h>
00036
#include <kparts/dockmainwindow.h>
00037
#include <kmdimainfrm.h>
00038
00039
#include <qguardedptr.h>
00040
00041
#include <scriptmanager.h>
00042
#include <kaction.h>
00043
00044
class GrepTool;
00045
00046
class KFileItem;
00047
class KRecentFilesAction;
00048
class DCOPObject;
00049
00050
class KateMainWindow :
public KMdiMainFrm,
virtual public KParts::PartBase
00051 {
00052 Q_OBJECT
00053
00054
friend class KateConfigDialog;
00055
friend class KateApp;
00056
friend class KateViewManager;
00057
friend class KateView;
00058
friend class KateDocument;
00059
00060
public:
00061 KateMainWindow ( KateDocManager *_docManager, KatePluginManager *_pluginManager,
00062 KateProjectManager *projectMan, KMdi::MdiMode guiMode );
00063 ~KateMainWindow();
00064
00065 Kate::MainWindow *mainWindow () {
return m_mainWindow; }
00066
Kate::ToolViewManager *toolViewManager () {
return m_toolViewManager; }
00067
00068
Kate::Project *activeProject () {
return m_project; }
00069
00076
Kate::Project *createProject (
const QString &type,
const QString &name,
const QString &filename);
00077
00082
Kate::Project *openProject (
const QString &filename);
00083
00084
void activateProject (
Kate::Project *project);
00085
00088 KURL activeDocumentUrl();
00089
00090 DCOPObject *dcopObject () {
return m_dcop; }
00091
00092 DCOPObject *m_dcop;
00093
00094
00095 KateConsole *console;
00096
00097
00098 KateDocManager *m_docManager;
00099 KateViewManager *m_viewManager;
00100 KateProjectManager *m_projectManager;
00101
00102
00103 KRecentFilesAction *fileOpenRecent;
00104
00105 KateFileList *filelist;
00106
class KateProjectList *projectlist;
00107
class KateProjectViews *projectviews;
00108 KateFileSelector *fileselector;
00109
00110
private:
00111 uint myID;
00112
bool syncKonsole;
00113
bool modNotification;
00114
00115
public:
00116
bool notifyMod()
const {
return modNotification; }
00117 uint mainWindowNumber ()
const {
return myID; }
00118
00119
protected:
00120 KatePluginManager *m_pluginManager;
00121
00122
private:
00123 QGuardedPtr<Kate::Project> m_project;
00124 uint m_projectNumber;
00125 QGuardedPtr<Kate::View> activeView;
00126
00127 KAction *closeCurrentViewSpace;
00128
00129 KAction *goNext;
00130 KAction *goPrev;
00131
00132 KAction *saveProject;
00133 KAction *closeProject;
00134 KRecentFilesAction *recentProjects;
00135
00136 KActionMenu* documentOpenWith;
00137
00138 KAction *gotoLine;
00139 KAction* windowNext;
00140 KAction* windowPrev;
00141
00142 QPopupMenu *documentMenu;
00143
00144 KToggleAction* settingsShowFilelist;
00145 KToggleAction* settingsShowFileselector;
00146 KToggleAction* showFullScreenAction;
00147
00148 KAction* settingsConfigure;
00149
00150 KActionMenu *scriptMenu;
00151 KScriptManager* kscript;
00152
00153
public slots:
00154
void newWindow ();
00155
00156
void slotConfigure();
00157
00158
void slotOpenWithMenuAction(
int idx);
00159
00160
private:
00161 GrepTool * greptool;
00162
00163
public slots:
00164
void slotGrepToolItemSelected (
const QString &filename,
int linenumber );
00165
void runScript(
int menuItemId);
00166
void slotMail();
00167
00168
public:
00169
void readProperties(KConfig *config);
00170
void saveProperties(KConfig *config);
00171
void saveGlobalProperties( KConfig* sessionConfig );
00172
00173
private:
00174
void setupMainWindow();
00175
void setupActions();
00176
void setupScripts();
00177
bool queryClose();
00178
00179
void readOptions(KConfig *);
00180
void saveOptions(KConfig *);
00181
00182
void dragEnterEvent( QDragEnterEvent * );
00183
void dropEvent( QDropEvent * );
00184
00185
private slots:
00186
void slotFileQuit();
00187
void slotEditToolbars();
00188
void slotDocumentChanged();
00189
void slotWindowActivated ();
00190
void slotUpdateOpenWith();
00191
void documentMenuAboutToShow();
00192
void slotDropEvent(QDropEvent *);
00193
void editKeys();
00194
void mSlotFixOpenWithMenu();
00195
void slotGoNext();
00196
void slotGoPrev();
00197
00198
void fileSelected(
const KFileItem *file);
00199
00200
void tipOfTheDay();
00201
00202
00203
void slotDocumentCreated (Kate::Document *doc);
00204
void updateCaption (Kate::Document *doc);
00205
00206
public:
00207
void openURL (
const QString &name=0L);
00208
00209
static KMdi::MdiMode defaultMode;
00210
00211
protected:
00212
bool eventFilter( QObject*, QEvent * );
00213
static uint uniqueID;
00214 Kate::MainWindow *m_mainWindow;
00215
Kate::ToolViewManager *m_toolViewManager;
00216
00217
public:
00218
Kate::ViewManager *viewManager () {
return m_viewManager->viewManager(); }
00219 KateViewManager *kateViewManager () {
return m_viewManager; }
00220
00221
public:
00222 KMdiToolViewAccessor *addToolView(KDockWidget::DockPosition position, QWidget *widget,
const QPixmap &icon,
const QString &sname,
const QString &tabToolTip = 0,
const QString &tabCaption = 0);
00223
00224
bool removeToolView(QWidget *);
00225
bool removeToolView(KMdiToolViewAccessor *);
00226
00227
bool showToolView(QWidget *);
00228
bool showToolView(KMdiToolViewAccessor *);
00229
00230
bool hideToolView(QWidget *);
00231
bool hideToolView(KMdiToolViewAccessor *);
00232
00233
private slots:
00234
void pluginHelp ();
00235
void slotFullScreen(
bool);
00236
00237
00238
public slots:
00239
void slotProjectNew ();
00240
void slotProjectOpen ();
00241
void slotProjectSave ();
00242
void slotProjectClose ();
00243
00244
00245
void openConstURLProject (
const KURL&);
00246
00247
private slots:
00248
void projectDeleted (uint projectNumber);
00249 };
00250
00251
#endif
00252
00253