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

libkonq

  • libkonq
konq_dirpart.h
1 /* This file is part of the KDE projects
2  Copyright (C) 2000 David Faure <faure@kde.org>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; see the file COPYING. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifndef __konqdirpart_h
21 #define __konqdirpart_h
22 
23 #include <tqstring.h>
24 #include <tdeparts/part.h>
25 #include <tdeparts/browserextension.h>
26 #include <tdefileitem.h>
27 #include <kdatastream.h>
28 #include <tdeio/global.h>
29 #include <libkonq_export.h>
30 
31 class KDirLister;
32 namespace KParts { class BrowserExtension; }
33 class KonqPropsView;
34 class TQScrollView;
35 class TDEAction;
36 class TDEToggleAction;
37 class KonqDirPartBrowserExtension;
38 
39 class LIBKONQ_EXPORT KonqDirPart: public KParts::ReadOnlyPart
40 {
41  Q_OBJECT
42 
43  friend class KonqDirPartBrowserExtension;
44 
45 public:
46  KonqDirPart( TQObject *parent, const char *name );
47 
48  virtual ~KonqDirPart();
49 
53  void setBrowserExtension( KonqDirPartBrowserExtension * extension )
54  { m_extension = extension; }
55 
56  KonqDirPartBrowserExtension * extension()
57  { return m_extension; }
58 
62  void setDirLister( KDirLister* lister );
63  // TODO KDE4 create the KDirLister here and simplify the parts?
64 
65  TQScrollView * scrollWidget();
66 
67  virtual void saveState( TQDataStream &stream );
68  virtual void restoreState( TQDataStream &stream );
69 
73  void lmbClicked( KFileItem * fileItem );
74 
77  void mmbClicked( KFileItem * fileItem );
78 
79  void setNameFilter( const TQString & nameFilter ) { m_nameFilter = nameFilter; }
80 
81  TQString nameFilter() const { return m_nameFilter; }
82 
83  void setFilesToSelect( const TQStringList & filesToSelect ) { m_filesToSelect = filesToSelect; }
84 
99  void setMimeFilter (const TQStringList& filters);
100 
105  TQStringList mimeFilter() const;
106 
107 
108  KonqPropsView * props() const { return m_pProps; }
109 
113  virtual void disableIcons( const KURL::List & lst ) = 0;
114 
119  void resetCount();
120 
124  void newItems( const KFileItemList & entries );
125 
129  void deleteItem( KFileItem * fileItem );
130 
134  void refreshItems(const KFileItemList &entries);
135 
139  void emitTotalCount();
140 
141  // ##### TODO KDE 4: remove!
150  void emitCounts( const KFileItemList & lst, bool selectionChanged );
151 
159  void emitCounts( const KFileItemList & lst );
160 
161  void emitMouseOver( const KFileItem * item );
162 
168  void updatePasteAction();
169 
175  virtual void newIconSize( int size );
176 
181  void setIconSize( int size );
182 
186  void setFindPart( KParts::ReadOnlyPart * part );
187 
188  KParts::ReadOnlyPart * findPart() const { return m_findPart; }
189 
190  virtual const KFileItem * currentItem() = 0; // { return 0L; }
191 
192  virtual KFileItemList selectedFileItems() { return KFileItemList(); }
193 
198  bool closeURL ();
199 
200 signals:
201 
205  void aboutToOpenURL();
206 
211  void findOpen( KonqDirPart * );
212 
217  void findOpened( KonqDirPart * );
218 
222  void findClosed( KonqDirPart * );
223 
228  void itemsAdded(const KFileItemList &);
229 
234  void itemRemoved(const KFileItem *);
235 
240  void itemsRefresh(const KFileItemList &);
241 
246  void itemsFilteredByMime( const KFileItemList& );
247 
248 public slots:
249 
254  bool openURL (const KURL&);
255 
261  void slotFindClosed();
262 
266  void slotStartAnimationSearching();
267 
271  void slotStopAnimationSearching();
272 
273  void slotBackgroundSettings();
274 
279  void slotClipboardDataChanged();
280 
281  void slotIncIconSize();
282  void slotDecIconSize();
283 
284  void slotIconSizeToggled( bool );
285 
286  // slots connected to the directory lister - or to the kfind interface
287  virtual void slotStarted() = 0;
288  virtual void slotCanceled() = 0;
289  virtual void slotCompleted() = 0;
290  virtual void slotNewItems( const KFileItemList& ) = 0;
291  virtual void slotDeleteItem( KFileItem * ) = 0;
292  virtual void slotRefreshItems( const KFileItemList& ) = 0;
293  virtual void slotClear() = 0;
294  virtual void slotRedirection( const KURL & ) = 0;
295 
296 private slots:
297  void slotIconChanged(int group);
298 protected:
303  virtual bool doOpenURL( const KURL& ) = 0;
304  virtual bool doCloseURL () = 0;
305 
306 protected:
307 
308  TQString m_nameFilter;
309  TQStringList m_filesToSelect;
310 
311  KonqPropsView * m_pProps;
312 
313  TDEAction *m_paIncIconSize;
314  TDEAction *m_paDecIconSize;
315  TDEToggleAction *m_paDefaultIcons;
316  TDEToggleAction *m_paHugeIcons;
317  TDEToggleAction *m_paLargeIcons;
318  TDEToggleAction *m_paMediumIcons;
319  TDEToggleAction *m_paSmallIcons;
320 
321  KParts::ReadOnlyPart * m_findPart;
322  KonqDirPartBrowserExtension * m_extension;
323 
324  // Remove all those in KDE4
325  int m_iIconSize[5];
326  TDEIO::filesize_t m_lDirSize;
327  uint m_lFileCount;
328  uint m_lDirCount;
329 
330 private:
331  void saveFindState( TQDataStream& );
332  void restoreFindState( TQDataStream& );
333 
334  void adjustIconSizes();
335 
336  class KonqDirPartPrivate;
337  KonqDirPartPrivate* d;
338 };
339 
340 class LIBKONQ_EXPORT KonqDirPartBrowserExtension : public KParts::BrowserExtension
341 {
342 public:
343  KonqDirPartBrowserExtension( KonqDirPart* dirPart )
344  : KParts::BrowserExtension( dirPart )
345  , m_dirPart( dirPart )
346  {}
347 
355  virtual void saveState( TQDataStream &stream );
356  virtual void restoreState( TQDataStream &stream );
357 
358 private:
359  KonqDirPart* m_dirPart;
360 };
361 
362 #endif

libkonq

Skip menu "libkonq"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libkonq

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