• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kate
 

kate

  • kate
  • app
katefilelist.h
1 /* This file is part of the KDE project
2  Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
3  Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
4  Copyright (C) 2001 Anders Lund <anders.lund@lund.tdcadsl.dk>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License version 2 as published by the Free Software Foundation.
9 
10  This library is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  Library General Public License for more details.
14 
15  You should have received a copy of the GNU Library General Public License
16  along with this library; see the file COPYING.LIB. If not, write to
17  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  Boston, MA 02110-1301, USA.
19 */
20 
21 #ifndef __KATE_FILELIST_H__
22 #define __KATE_FILELIST_H__
23 
24 #include "katemain.h"
25 
26 #include <kate/document.h>
27 
28 #include <tdelistview.h>
29 
30 #include <tqtooltip.h>
31 #include <tqcolor.h>
32 #include <tqptrlist.h>
33 
34 #define RTTI_KateFileListItem 1001
35 
36 class KateMainWindow;
37 
38 class TDEAction;
39 class TDESelectAction;
40 
41 class KateFileListItem : public TQListViewItem
42 {
43  public:
44  KateFileListItem( TQListView *lv,
45  Kate::Document *doc );
46  ~KateFileListItem();
47 
48  inline uint documentNumber () { return m_docNumber; }
49  inline Kate::Document * document() { return doc; }
50 
51  int rtti() const { return RTTI_KateFileListItem; }
52 
56  void setViewHistPos( int p ) { m_viewhistpos = p; }
60  void setEditHistPos( int p ) { m_edithistpos = p; }
61 
62  protected:
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;
69 
70  private:
71  Kate::Document *doc;
72  int m_viewhistpos;
73  int m_edithistpos;
74  uint m_docNumber;
75 };
76 
77 class KateFileList : public TDEListView
78 {
79  TQ_OBJECT
80 
81  friend class KFLConfigPage;
82 
83  public:
84  KateFileList (KateMainWindow *main, KateViewManager *_viewManager, TQWidget * parent = 0, const char * name = 0 );
85  ~KateFileList ();
86 
87  int sortType () const { return m_sort; };
88  void updateSort ();
89 
90  enum sorting {
91  sortByID = 0,
92  sortByName = 1,
93  sortByURL = 2,
94  sortManual = 3
95  };
96 
97  TQString tooltip( TQListViewItem *item, int );
98 
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; }
104 
105  void readConfig( class TDEConfig *config, const TQString &group );
106  void writeConfig( class TDEConfig *config, const TQString &group );
107 
111  void takeItem( TQListViewItem * );
112 
113  public slots:
114  void setSortType (int s);
115  void moveFileUp();
116  void moveFileDown();
117  void slotNextDocument();
118  void slotPrevDocument();
119 
120  private slots:
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();
130 
131  protected:
132  virtual void keyPressEvent( TQKeyEvent *e );
137  virtual void contentsMousePressEvent( TQMouseEvent *e );
142  virtual void resizeEvent( TQResizeEvent *e );
143 
144  private:
145  void setupActions ();
146  void updateActions ();
147 
148  private:
149  KateMainWindow *m_main;
150  KateViewManager *viewManager;
151 
152  int m_sort;
153  bool notify;
154 
155  TDEAction* windowNext;
156  TDEAction* windowPrev;
157  TDESelectAction* sortAction;
158  TDEAction* listMoveFileUp;
159  TDEAction* listMoveFileDown;
160 
161  TQPtrList<KateFileListItem> m_viewHistory;
162  TQPtrList<KateFileListItem> m_editHistory;
163 
164  TQColor m_viewShade, m_editShade;
165  bool m_enableBgShading;
166 
167  TQListViewItem *m_clickedMenuItem;
168 
169  TQPoint m_lastMouseDownPos;
170 
171  class ToolTip *m_tooltip;
172 };
173 
174 class KFLConfigPage : public Kate::ConfigPage {
175  TQ_OBJECT
176  public:
177  KFLConfigPage( TQWidget* parent=0, const char *name=0, KateFileList *fl=0 );
178  virtual ~KFLConfigPage() {};
179 
180  virtual void apply();
181  virtual void reload();
182 
183  public slots:
184  void slotEnableChanged();
185 
186  private slots:
187  void slotMyChanged();
188 
189  private:
190  class TQCheckBox *cbEnableShading;
191  class KColorButton *kcbViewShade, *kcbEditShade;
192  class TQLabel *lEditShade, *lViewShade, *lSort;
193  class TQComboBox *cmbSort;
194  KateFileList *m_filelist;
195 
196  bool m_changed;
197 };
198 
199 
200 #endif

kate

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

kate

Skip menu "kate"
  • kate
  • libkonq
  • twin
  •   lib
Generated for kate by doxygen 1.9.1
This website is maintained by Timothy Pearson.