21 #ifndef __KATE_FILELIST_H__
22 #define __KATE_FILELIST_H__
26 #include <kate/document.h>
28 #include <tdelistview.h>
30 #include <tqtooltip.h>
32 #include <tqptrlist.h>
34 #define RTTI_KateFileListItem 1001
39 class TDESelectAction;
41 class KateFileListItem :
public TQListViewItem
44 KateFileListItem( TQListView *lv,
45 Kate::Document *doc );
48 inline uint documentNumber () {
return m_docNumber; }
49 inline Kate::Document * document() {
return doc; }
51 int rtti()
const {
return RTTI_KateFileListItem; }
56 void setViewHistPos(
int p ) { m_viewhistpos = p; }
60 void setEditHistPos(
int p ) { m_edithistpos = p; }
63 virtual const TQPixmap *pixmap (
int column )
const;
64 void paintCell( TQPainter *painter,
const TQColorGroup & cg,
int column,
int width,
int align );
68 int compare ( TQListViewItem * i,
int col,
bool ascending )
const;
77 class KateFileList :
public TDEListView
81 friend class KFLConfigPage;
84 KateFileList (KateMainWindow *main, KateViewManager *_viewManager, TQWidget * parent = 0,
const char * name = 0 );
87 int sortType ()
const {
return m_sort; };
97 TQString tooltip( TQListViewItem *item,
int );
99 uint histCount()
const {
return m_viewHistory.count(); }
100 uint editHistCount()
const {
return m_editHistory.count(); }
101 TQColor editShade()
const {
return m_editShade; }
102 TQColor viewShade()
const {
return m_viewShade; }
103 bool shadingEnabled() {
return m_enableBgShading; }
105 void readConfig(
class TDEConfig *config,
const TQString &group );
106 void writeConfig(
class TDEConfig *config,
const TQString &group );
111 void takeItem( TQListViewItem * );
114 void setSortType (
int s);
117 void slotNextDocument();
118 void slotPrevDocument();
121 void slotDocumentCreated (Kate::Document *doc);
122 void slotDocumentDeleted (uint documentNumber);
123 void slotActivateView( TQListViewItem *item );
124 void slotModChanged (Kate::Document *doc);
125 void slotModifiedOnDisc (Kate::Document *doc,
bool b,
unsigned char reason);
126 void slotNameChanged (Kate::Document *doc);
127 void slotViewChanged ();
128 void slotMenu ( TQListViewItem *item,
const TQPoint &p,
int col );
129 void updateFileListLocations();
132 virtual void keyPressEvent( TQKeyEvent *e );
137 virtual void contentsMousePressEvent( TQMouseEvent *e );
142 virtual void resizeEvent( TQResizeEvent *e );
145 void setupActions ();
146 void updateActions ();
149 KateMainWindow *m_main;
150 KateViewManager *viewManager;
155 TDEAction* windowNext;
156 TDEAction* windowPrev;
157 TDESelectAction* sortAction;
158 TDEAction* listMoveFileUp;
159 TDEAction* listMoveFileDown;
161 TQPtrList<KateFileListItem> m_viewHistory;
162 TQPtrList<KateFileListItem> m_editHistory;
164 TQColor m_viewShade, m_editShade;
165 bool m_enableBgShading;
167 TQListViewItem *m_clickedMenuItem;
169 TQPoint m_lastMouseDownPos;
171 class ToolTip *m_tooltip;
174 class KFLConfigPage :
public Kate::ConfigPage {
177 KFLConfigPage( TQWidget* parent=0,
const char *name=0, KateFileList *fl=0 );
178 virtual ~KFLConfigPage() {};
180 virtual void apply();
181 virtual void reload();
184 void slotEnableChanged();
187 void slotMyChanged();
190 class TQCheckBox *cbEnableShading;
191 class KColorButton *kcbViewShade, *kcbEditShade;
192 class TQLabel *lEditShade, *lViewShade, *lSort;
193 class TQComboBox *cmbSort;
194 KateFileList *m_filelist;