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., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, 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 <tqguardedptr.h> 00030 00031 class KateMainWindow; 00032 class KateViewSpaceContainer; 00033 00034 class KConfig; 00035 class KAction; 00036 00037 class TQToolButton; 00038 00039 class KateViewManager : public TQObject 00040 { 00041 Q_OBJECT 00042 00043 public: 00044 KateViewManager (KateMainWindow *parent); 00045 ~KateViewManager (); 00046 00047 Kate::ViewManager *viewManager () const { return m_viewManager; }; 00048 00049 KateViewSpaceContainer *activeContainer () { return m_currentContainer; } 00050 00051 TQPtrList<KateViewSpaceContainer> *containers() { return &m_viewSpaceContainerList; } 00052 00053 void updateViewSpaceActions (); 00054 00055 private: 00059 void setupActions (); 00060 00061 public: 00062 /* This will save the splitter configuration */ 00063 void saveViewConfiguration(KConfig *config,const TQString& group); 00064 00065 /* restore it */ 00066 void restoreViewConfiguration (KConfig *config,const TQString& group); 00067 00068 uint openURL (const KURL &url, const TQString& encoding, bool activate = true, bool isTempFile=false); 00069 00070 public slots: 00071 void openURL (const KURL &url); 00072 00073 private: 00074 void removeViewSpace (KateViewSpace *viewspace); 00075 00076 bool showFullPath; 00077 00078 public: 00079 Kate::View* activeView (); 00080 KateViewSpace* activeViewSpace (); 00081 00082 uint viewCount (); 00083 uint viewSpaceCount (); 00084 00085 void setViewActivationBlocked (bool block); 00086 00087 public: 00088 void closeViews(uint documentNumber); 00089 KateMainWindow *mainWindow(); 00090 00091 private slots: 00092 void activateView ( Kate::View *view ); 00093 void activateSpace ( Kate::View* v ); 00094 00095 void tabChanged(TQWidget*); 00096 00097 public slots: 00098 bool getShowFullPath() const { return showFullPath; } 00099 00100 void activateView ( uint documentNumber ); 00101 void activateView ( int documentNumber ) { activateView((uint) documentNumber); }; 00102 00103 void slotDocumentNew (); 00104 void slotDocumentOpen (); 00105 void slotDocumentClose (); 00106 00108 void slotSplitViewSpaceHoriz (); 00110 void slotSplitViewSpaceVert (); 00111 00112 void slotNewTab(); 00113 void slotCloseTab (); 00114 void activateNextTab (); 00115 void activatePrevTab (); 00116 00117 void slotCloseCurrentViewSpace(); 00118 00119 void setActiveSpace ( KateViewSpace* vs ); 00120 void setActiveView ( Kate::View* view ); 00121 00122 void setShowFullPath(bool enable); 00123 00124 void activateNextView(); 00125 void activatePrevView(); 00126 00127 protected: 00128 friend class KateViewSpaceContainer; 00129 00130 TQGuardedPtr<Kate::View> guiMergedView; 00131 00132 signals: 00133 void statusChanged (Kate::View *, int, int, int, bool, int, const TQString &); 00134 void statChanged (); 00135 void viewChanged (); 00136 00137 private: 00138 Kate::ViewManager *m_viewManager; 00139 TQPtrList<KateViewSpaceContainer> m_viewSpaceContainerList; 00140 KateViewSpaceContainer *m_currentContainer; 00141 00142 KateMainWindow *m_mainWindow; 00143 bool m_init; 00144 00145 TQToolButton *m_closeTabButton; 00146 KAction *m_closeView; 00147 KAction *m_closeTab; 00148 KAction *m_activateNextTab; 00149 KAction *m_activatePrevTab; 00150 KAction *goNext; 00151 KAction *goPrev; 00152 }; 00153 00154 #endif