kate
kateviewmanager.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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 <qguardedptr.h>
00030
00031 class KateMainWindow;
00032 class KateViewSpaceContainer;
00033
00034 class KConfig;
00035 class KAction;
00036
00037 class QToolButton;
00038
00039 class KateViewManager : public QObject
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 QPtrList<KateViewSpaceContainer> *containers() { return &m_viewSpaceContainerList; }
00052
00053 void updateViewSpaceActions ();
00054
00055 private:
00059 void setupActions ();
00060
00061 public:
00062
00063 void saveViewConfiguration(KConfig *config,const QString& group);
00064
00065
00066 void restoreViewConfiguration (KConfig *config,const QString& group);
00067
00068 uint openURL (const KURL &url, const QString& 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(QWidget*);
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 QGuardedPtr<Kate::View> guiMergedView;
00131
00132 signals:
00133 void statusChanged (Kate::View *, int, int, int, bool, int, const QString &);
00134 void statChanged ();
00135 void viewChanged ();
00136
00137 private:
00138 Kate::ViewManager *m_viewManager;
00139 QPtrList<KateViewSpaceContainer> m_viewSpaceContainerList;
00140 KateViewSpaceContainer *m_currentContainer;
00141
00142 KateMainWindow *m_mainWindow;
00143 bool m_init;
00144
00145 QToolButton *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