kate Library API Documentation

kateviewmanager.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_VIEWMANAGER_H__
00022 #define __KATE_VIEWMANAGER_H__
00023 
00024 #include "katemain.h"
00025 #include "../interfaces/viewmanager.h"
00026 
00027 #include <kate/view.h>
00028 #include <kate/document.h>
00029 #include <kmdi/tabwidget.h>
00030 #include <qguardedptr.h>
00031 
00032 class KateSplitter;
00033 class KateMainWindow;
00034 class KateViewSpaceContainer;
00035 
00036 class KConfig;
00037 class KAction;
00038 
00039 class QToolButton;
00040 
00041 class KateViewManager : public QObject
00042 {
00043   Q_OBJECT
00044 
00045   public:
00046     KateViewManager (KateMainWindow *parent);
00047     ~KateViewManager ();
00048 
00049     Kate::ViewManager *viewManager () const { return m_viewManager; };
00050 
00051     KateViewSpaceContainer *activeContainer () { return m_currentContainer; }
00052 
00053     QPtrList<KateViewSpaceContainer> *containers() { return &m_viewSpaceContainerList; }
00054 
00055     void updateViewSpaceActions ();
00056 
00057   private:
00061     void setupActions ();
00062 
00063   public:
00064     /* This will save the splitter configuration */
00065     void saveViewConfiguration(KConfig *config,const QString& group);
00066 
00067     /* restore it */
00068     void restoreViewConfiguration (KConfig *config,const QString& group);
00069 
00070     uint openURL (const KURL &url, const QString& encoding, bool activate = true);
00071 
00072   public slots:
00073     void openURL (const KURL &url);
00074 
00075   private:
00076     void removeViewSpace (KateViewSpace *viewspace);
00077 
00078     bool showFullPath;
00079 
00080   public:
00081     Kate::View* activeView ();
00082     KateViewSpace* activeViewSpace ();
00083 
00084     uint viewCount ();
00085     uint viewSpaceCount ();
00086 
00087     void setViewActivationBlocked (bool block);
00088 
00089   public:
00090     void closeViews(uint documentNumber);
00091     KateMainWindow *mainWindow();
00092 
00093   private slots:
00094     void activateView ( Kate::View *view );
00095     void activateSpace ( Kate::View* v );
00096 
00097     void tabChanged(QWidget*);
00098 
00099   public slots:
00100     bool getShowFullPath() const { return showFullPath; }
00101 
00102     void activateView ( uint documentNumber );
00103     void activateView ( int documentNumber ) { activateView((uint) documentNumber); };
00104 
00105     void slotDocumentNew ();
00106     void slotDocumentOpen ();
00107     void slotDocumentClose ();
00108 
00110     void slotSplitViewSpaceHoriz ();
00112     void slotSplitViewSpaceVert ();
00113 
00114     void slotNewTab();
00115     void slotCloseTab ();
00116     void activateNextTab ();
00117     void activatePrevTab ();
00118 
00119     void slotCloseCurrentViewSpace();
00120 
00121     void setActiveSpace ( KateViewSpace* vs );
00122     void setActiveView ( Kate::View* view );
00123 
00124     void setShowFullPath(bool enable);
00125 
00126     void activateNextView();
00127     void activatePrevView();
00128 
00129   protected:
00130     friend class KateViewSpaceContainer;
00131 
00132     bool eventFilter(QObject *o,QEvent *e);
00133 
00134     QGuardedPtr<Kate::View> guiMergedView;
00135 
00136   signals:
00137     void statusChanged (Kate::View *, int, int, int, bool, int, const QString &);
00138     void statChanged ();
00139     void viewChanged ();
00140 
00141   private:
00142     Kate::ViewManager *m_viewManager;
00143     QPtrList<KateViewSpaceContainer> m_viewSpaceContainerList;
00144     KateViewSpaceContainer *m_currentContainer;
00145 
00146     KateMainWindow *m_mainWindow;
00147     bool m_init;
00148 
00149     QToolButton *m_closeTabButton;
00150     KAction *m_closeView;
00151     KAction *m_closeTab;
00152     KAction *m_activateNextTab;
00153     KAction *m_activatePrevTab;
00154     KAction *goNext;
00155     KAction *goPrev;
00156 };
00157 
00158 #endif
KDE Logo
This file is part of the documentation for kate Library Version 3.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jun 14 16:46:24 2006 by doxygen 1.4.4 written by Dimitri van Heesch, © 1997-2003