• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kate

katefilelist.h

Go to the documentation of this file.
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_FILELIST_H__
00022 #define __KATE_FILELIST_H__
00023 
00024 #include "katemain.h"
00025 
00026 #include <kate/document.h>
00027 
00028 #include <klistview.h>
00029 
00030 #include <qtooltip.h>
00031 #include <qcolor.h>
00032 #include <qptrlist.h>
00033 
00034 #define RTTI_KateFileListItem 1001
00035 
00036 class KateMainWindow;
00037 
00038 class KAction;
00039 class KSelectAction;
00040 
00041 class KateFileListItem : public QListViewItem
00042 {
00043   public:
00044     KateFileListItem( QListView *lv,
00045               Kate::Document *doc );
00046     ~KateFileListItem();
00047 
00048     inline uint documentNumber () { return m_docNumber; }
00049     inline Kate::Document * document() { return doc; }
00050 
00051     int rtti() const { return RTTI_KateFileListItem; }
00052 
00056     void setViewHistPos( int p ) {  m_viewhistpos = p; }
00060     void setEditHistPos( int p ) { m_edithistpos = p; }
00061 
00062   protected:
00063     virtual const QPixmap *pixmap ( int column ) const;
00064     void paintCell( QPainter *painter, const QColorGroup & cg, int column, int width, int align );
00068     int compare ( QListViewItem * i, int col, bool ascending ) const;
00069 
00070   private:
00071     Kate::Document *doc;
00072     int m_viewhistpos; 
00073     int m_edithistpos; 
00074     uint m_docNumber;
00075 };
00076 
00077 class KateFileList : public KListView
00078 {
00079   Q_OBJECT
00080 
00081   friend class KFLConfigPage;
00082 
00083   public:
00084     KateFileList (KateMainWindow *main, KateViewManager *_viewManager, QWidget * parent = 0, const char * name = 0 );
00085     ~KateFileList ();
00086 
00087     int sortType () const { return m_sort; };
00088     void updateSort ();
00089 
00090     enum sorting {
00091       sortByID = 0,
00092       sortByName = 1,
00093       sortByURL = 2
00094     };
00095 
00096     QString tooltip( QListViewItem *item, int );
00097 
00098     uint histCount() const { return m_viewHistory.count(); }
00099     uint editHistCount() const { return m_editHistory.count(); }
00100     QColor editShade() const { return m_editShade; }
00101     QColor viewShade() const { return m_viewShade; }
00102     bool shadingEnabled() { return m_enableBgShading; }
00103 
00104     void readConfig( class KConfig *config, const QString &group );
00105     void writeConfig( class KConfig *config, const QString &group );
00106 
00110     void takeItem( QListViewItem * );
00111 
00112   public slots:
00113     void setSortType (int s);
00114     void slotNextDocument();
00115     void slotPrevDocument();
00116 
00117   private slots:
00118     void slotDocumentCreated (Kate::Document *doc);
00119     void slotDocumentDeleted (uint documentNumber);
00120     void slotActivateView( QListViewItem *item );
00121     void slotModChanged (Kate::Document *doc);
00122     void slotModifiedOnDisc (Kate::Document *doc, bool b, unsigned char reason);
00123     void slotNameChanged (Kate::Document *doc);
00124     void slotViewChanged ();
00125     void slotMenu ( QListViewItem *item, const QPoint &p, int col );
00126 
00127   protected:
00128     virtual void keyPressEvent( QKeyEvent *e );
00133     virtual void contentsMousePressEvent( QMouseEvent *e );
00138     virtual void resizeEvent( QResizeEvent *e );
00139 
00140   private:
00141     void setupActions ();
00142     void updateActions ();
00143 
00144   private:
00145     KateMainWindow *m_main;
00146     KateViewManager *viewManager;
00147 
00148     int m_sort;
00149     bool notify;
00150 
00151     KAction* windowNext;
00152     KAction* windowPrev;
00153     KSelectAction* sortAction;
00154 
00155     QPtrList<KateFileListItem> m_viewHistory;
00156     QPtrList<KateFileListItem> m_editHistory;
00157 
00158     QColor m_viewShade, m_editShade;
00159     bool m_enableBgShading;
00160 
00161     class ToolTip *m_tooltip;
00162 };
00163 
00164 class KFLConfigPage : public Kate::ConfigPage {
00165   Q_OBJECT
00166   public:
00167     KFLConfigPage( QWidget* parent=0, const char *name=0, KateFileList *fl=0 );
00168     virtual ~KFLConfigPage() {};
00169 
00170     virtual void apply();
00171     virtual void reload();
00172 
00173   public slots:
00174     void slotEnableChanged();
00175 
00176   private slots:
00177     void slotMyChanged();
00178 
00179   private:
00180     class QCheckBox *cbEnableShading;
00181     class KColorButton *kcbViewShade, *kcbEditShade;
00182     class QLabel *lEditShade, *lViewShade, *lSort;
00183     class QComboBox *cmbSort;
00184     KateFileList *m_filelist;
00185 
00186     bool m_changed;
00187 };
00188 
00189 
00190 #endif
00191 // kate: space-indent on; indent-width 2; replace-tabs on;

kate

Skip menu "kate"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kate
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal