kate Library API Documentation

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