kate Library API Documentation

katefilelist.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_FILELIST_H__ 00022 #define __KATE_FILELIST_H__ 00023 00024 #include "katemain.h" 00025 00026 #include <kate/document.h> 00027 00028 #include <klistbox.h> 00029 00030 #include <qtooltip.h> 00031 #include <qcolor.h> 00032 00033 class KateFileListItem : public QListBoxItem 00034 { 00035 public: 00036 KateFileListItem( KateDocManager *_docManager, Kate::Document *doc, uint documentNumber, const QString& text); 00037 ~KateFileListItem(); 00038 00039 uint documentNumber (); 00040 00041 void setText(const QString &text); 00042 00043 int height( const QListBox* lb ) const; 00044 00045 int width( const QListBox* lb ) const; 00046 00047 protected: 00048 void paint( QPainter *painter ); 00049 00050 private: 00051 uint myDocID; 00052 Kate::Document *doc; 00053 KateDocManager *docManager; 00054 }; 00055 00056 class KateFileList : public KListBox 00057 { 00058 Q_OBJECT 00059 00060 public: 00061 KateFileList (KateDocManager *_docManager, KateViewManager *_viewManager, QWidget * parent = 0, const char * name = 0 ); 00062 ~KateFileList (); 00063 00069 void tip( const QPoint &p, QRect &r, QString &str ); 00070 00071 void setSortType (int s); 00072 int sortType () const { return m_sort; }; 00073 void updateSort (); 00074 00075 enum sorting { 00076 sortByID = 0, 00077 sortByName = 1 00078 }; 00079 00080 public slots: 00081 void slotNextDocument(); 00082 void slotPrevDocument(); 00083 00084 private: 00085 KateDocManager *docManager; 00086 KateViewManager *viewManager; 00087 int m_sort; 00088 bool notify; 00089 00090 private slots: 00091 void slotDocumentCreated (Kate::Document *doc); 00092 void slotDocumentDeleted (uint documentNumber); 00093 void slotActivateView( QListBoxItem *item ); 00094 void slotModChanged (Kate::Document *doc); 00095 void slotModifiedOnDisc (Kate::Document *doc, bool b, unsigned char reason); 00096 void slotNameChanged (Kate::Document *doc); 00097 void slotViewChanged (); 00098 void slotMenu ( QListBoxItem *item, const QPoint &p ); 00099 00100 private: 00102 // A private tooltip class to display the URL of a document in the 00103 // tooltip. 00104 // Thanks to KDevelop team for the code:) 00106 class KFLToolTip : public QToolTip 00107 { 00108 public: 00109 KFLToolTip(QWidget *parent); 00110 00111 protected: 00112 void maybeTip( const QPoint & ); 00113 }; 00114 KFLToolTip* tooltip; 00115 }; 00116 00117 #endif
KDE Logo
This file is part of the documentation for kate Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 16 15:59:27 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003