• 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 <kparts/part.h>
25 #include <kparts/browserextension.h>
26 #include <kfileitem.h>
27 #include <kdatastream.h>
28 #include <kio/global.h>
29 #include <libkonq_export.h>
30 
31 class KDirLister;
32 namespace KParts { class BrowserExtension; }
33 class KonqPropsView;
34 class TQScrollView;
35 class KAction;
36 class KToggleAction;
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 emitTotalCount();
135 
136  // ##### TODO KDE 4: remove!
145  void emitCounts( const KFileItemList & lst, bool selectionChanged );
146 
154  void emitCounts( const KFileItemList & lst );
155 
156  void emitMouseOver( const KFileItem * item );
157 
163  void updatePasteAction();
164 
170  virtual void newIconSize( int size );
171 
176  void setIconSize( int size );
177 
181  void setFindPart( KParts::ReadOnlyPart * part );
182 
183  KParts::ReadOnlyPart * findPart() const { return m_findPart; }
184 
185  virtual const KFileItem * currentItem() = 0; // { return 0L; }
186 
187  virtual KFileItemList selectedFileItems() { return KFileItemList(); }
188 
193  bool closeURL ();
194 
195 signals:
196 
200  void aboutToOpenURL();
201 
206  void findOpen( KonqDirPart * );
207 
212  void findOpened( KonqDirPart * );
213 
217  void findClosed( KonqDirPart * );
218 
223  void itemsAdded( const KFileItemList& );
224 
229  void itemRemoved( const KFileItem* );
230 
235  void itemsFilteredByMime( const KFileItemList& );
236 
237 public slots:
238 
243  bool openURL (const KURL&);
244 
250  void slotFindClosed();
251 
255  void slotStartAnimationSearching();
256 
260  void slotStopAnimationSearching();
261 
262  void slotBackgroundSettings();
263 
268  void slotClipboardDataChanged();
269 
270  void slotIncIconSize();
271  void slotDecIconSize();
272 
273  void slotIconSizeToggled( bool );
274 
275  // slots connected to the directory lister - or to the kfind interface
276  virtual void slotStarted() = 0;
277  virtual void slotCanceled() = 0;
278  virtual void slotCompleted() = 0;
279  virtual void slotNewItems( const KFileItemList& ) = 0;
280  virtual void slotDeleteItem( KFileItem * ) = 0;
281  virtual void slotRefreshItems( const KFileItemList& ) = 0;
282  virtual void slotClear() = 0;
283  virtual void slotRedirection( const KURL & ) = 0;
284 
285 private slots:
286  void slotIconChanged(int group);
287 protected:
292  virtual bool doOpenURL( const KURL& ) = 0;
293  virtual bool doCloseURL () = 0;
294 
295 protected:
296 
297  TQString m_nameFilter;
298  TQStringList m_filesToSelect;
299 
300  KonqPropsView * m_pProps;
301 
302  KAction *m_paIncIconSize;
303  KAction *m_paDecIconSize;
304  KToggleAction *m_paDefaultIcons;
305  KToggleAction *m_paHugeIcons;
306  KToggleAction *m_paLargeIcons;
307  KToggleAction *m_paMediumIcons;
308  KToggleAction *m_paSmallIcons;
309 
310  KParts::ReadOnlyPart * m_findPart;
311  KonqDirPartBrowserExtension * m_extension;
312 
313  // Remove all those in KDE4
314  int m_iIconSize[5];
315  KIO::filesize_t m_lDirSize;
316  uint m_lFileCount;
317  uint m_lDirCount;
318 
319 private:
320  void saveFindState( TQDataStream& );
321  void restoreFindState( TQDataStream& );
322 
323  void adjustIconSizes();
324 
325  class KonqDirPartPrivate;
326  KonqDirPartPrivate* d;
327 };
328 
329 class LIBKONQ_EXPORT KonqDirPartBrowserExtension : public KParts::BrowserExtension
330 {
331 public:
332  KonqDirPartBrowserExtension( KonqDirPart* dirPart )
333  : KParts::BrowserExtension( dirPart )
334  , m_dirPart( dirPart )
335  {}
336 
344  virtual void saveState( TQDataStream &stream );
345  virtual void restoreState( TQDataStream &stream );
346 
347 private:
348  KonqDirPart* m_dirPart;
349 };
350 
351 #endif

libkonq

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

libkonq

Skip menu "libkonq"
  • kate
  • kwin
  •   lib
  • libkonq
Generated for libkonq by doxygen 1.8.3.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |