kateviewspace.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_VIEWSPACE_H__ 00022 #define __KATE_VIEWSPACE_H__ 00023 00024 #include "katemain.h" 00025 00026 #include <kate/view.h> 00027 #include <kate/document.h> 00028 00029 #include <tqptrlist.h> 00030 #include <tqwidget.h> 00031 #include <tqvbox.h> 00032 #include <kstatusbar.h> 00033 00034 class KVSSBSep; 00035 00036 class KConfig; 00037 class KSqueezedTextLabel; 00038 class KateViewSpaceContainer; 00039 00040 class KateVSStatusBar : public KStatusBar 00041 { 00042 Q_OBJECT 00043 00044 public: 00045 KateVSStatusBar ( KateViewSpace *parent = 0L, const char *name = 0L ); 00046 virtual ~KateVSStatusBar (); 00047 00048 public slots: 00049 void setStatus( int r, int c, int ovr, bool block, int mod, const TQString &msg ); 00050 void updateMod( bool ); 00055 void modifiedChanged(); 00056 00057 protected: 00058 virtual bool eventFilter (TQObject*,TQEvent *); 00059 virtual void showMenu (); 00060 00061 private: 00062 TQLabel* m_lineColLabel; 00063 TQLabel* m_modifiedLabel; 00064 TQLabel* m_insertModeLabel; 00065 TQLabel* m_selectModeLabel; 00066 KSqueezedTextLabel* m_fileNameLabel; 00067 TQPixmap m_modPm, m_modDiscPm, m_modmodPm, m_noPm; 00068 class KateViewSpace *m_viewSpace; 00069 }; 00070 00071 class KateViewSpace : public TQVBox 00072 { 00073 friend class KateViewSpaceContainer; 00074 friend class KateVSStatusBar; 00075 00076 Q_OBJECT 00077 00078 public: 00079 KateViewSpace(KateViewSpaceContainer *, TQWidget* parent=0, const char* name=0); 00080 ~KateViewSpace(); 00081 bool isActiveSpace(); 00082 void setActive(bool b, bool showled=false); 00083 TQWidgetStack* stack; 00084 void addView(Kate::View* v, bool show=true); 00085 void removeView(Kate::View* v); 00086 bool showView(Kate::View* v); 00087 bool showView(uint docID); 00088 Kate::View* currentView(); 00089 int viewCount() const { return mViewList.count(); } 00090 00091 void saveConfig (KConfig* config, int myIndex,const TQString& viewConfGrp); 00092 void restoreConfig ( class KateViewSpaceContainer *viewMan, KConfig* config, const TQString &group ); 00093 00094 00095 protected: 00098 bool event( TQEvent * ); 00099 00100 private: 00101 bool mIsActiveSpace; 00102 KateVSStatusBar* mStatusBar; 00103 TQLabel* l; 00104 TQPixmap i_active; 00105 TQPixmap i_empty; 00106 TQPtrList<Kate::View> mViewList; 00107 int mViewCount; 00108 KVSSBSep *sep; 00109 KateViewSpaceContainer *m_viewManager; 00110 TQString m_group; 00111 00112 private slots: 00113 void slotStatusChanged (Kate::View *view, int r, int c, int ovr, bool block, int mod, const TQString &msg); 00114 00115 public slots: 00116 void polish(); 00117 void modifiedOnDisc(Kate::Document *, bool, unsigned char); 00118 }; 00119 00120 #endif 00121 // kate: space-indent on; indent-width 2; replace-tabs on;