• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDE3Support

  • sources
  • kde-4.14
  • kdelibs
  • kde3support
  • kio
  • kfile
k3fileview.h
Go to the documentation of this file.
1 // -*- c++ -*-
2 /* This file is part of the KDE libraries
3  Copyright (C) 1997 Stephan Kulow <coolo@kde.org>
4  Copyright (C) 2001 Carsten Pfeiffer <pfeiffer@kde.org>
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 as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
21 
22 #ifndef KFILEVIEW_H
23 #define KFILEVIEW_H
24 
25 class QPoint;
26 class QWidget;
27 class QDropEvent;
28 class KActionCollection;
29 
30 #include "kde3support_export.h"
31 #include "kfileitem.h"
32 #include "kfile.h"
33 
38 class KDE3SUPPORT_EXPORT K3FileViewSignaler : public QObject
39 {
40  Q_OBJECT
41 
42 public:
47  void activate( const KFileItem &item );
48 
53  void highlightFile( const KFileItem &item );
54 
55  void activateMenu( const KFileItem &item, const QPoint& pos );
56 
57  void changeSorting( QDir::SortFlags sorting );
58 
59  void dropURLs( const KFileItem &item, QDropEvent *event, const KUrl::List &urls);
60 
61 Q_SIGNALS:
62  void dirActivated( const KFileItem &item );
63 
64  void sortingChanged( QDir::SortFlags );
65 
70  void fileHighlighted( const KFileItem &item );
71  void fileSelected( const KFileItem &item );
72  void activatedMenu( const KFileItem &item, const QPoint &pos );
73  void dropped( const KFileItem &item, QDropEvent *event, const KUrl::List &urls );
74 };
75 
89 class KDE3SUPPORT_EXPORT K3FileView {
90 
91 public:
95  K3FileView();
96 
100  virtual ~K3FileView();
101 
105  void addItemList(const KFileItemList &list);
106 
112  virtual QWidget *widget() = 0;
113 
117  QWidget *widget() const;
118 
122  void setCurrentItem( const QString &filename );
123 
128  virtual void setCurrentItem( const KFileItem &item ) = 0;
129 
135  virtual KFileItem currentFileItem() const = 0;
136 
140  virtual void clear();
141 
150  virtual void updateView(bool f = true);
151 
152  virtual void updateView(const KFileItem&);
153 
158  virtual void removeItem(const KFileItem &item);
159 
165  virtual void listingCompleted();
166 
171  QDir::SortFlags sorting() const;
172 
187  virtual void setSorting(QDir::SortFlags sort);
188 
193  bool isReversed() const;
194 
195  void sortReversed();
196 
200  uint count() const;
201 
205  uint numFiles() const;
206 
210  uint numDirs() const;
211 
212  virtual void setSelectionMode( KFile::SelectionMode sm );
213  virtual KFile::SelectionMode selectionMode() const;
214 
215  enum ViewMode {
216  Files = 1,
217  Directories = 2,
218  All = Files | Directories
219  };
220  virtual void setViewMode( ViewMode vm );
221  virtual ViewMode viewMode() const;
222 
228  QString viewName() const;
229 
234  void setViewName( const QString& name );
235 
236  virtual void setParentView(K3FileView *parent);
237 
246  virtual void insertItem( const KFileItem &i);
247 
252  virtual void clearView() = 0;
253 
258  virtual void ensureItemVisible( const KFileItem &i ) = 0;
259 
264  virtual void clearSelection() = 0;
265 
271  virtual void selectAll();
272 
277  virtual void invertSelection();
278 
283  virtual void setSelected(const KFileItem &, bool enable) = 0;
284 
289  virtual bool isSelected( const KFileItem & ) const = 0;
290 
294  KFileItemList selectedItems() const;
295 
299  KFileItemList items() const;
300 
301  virtual KFileItem firstFileItem() const = 0;
302  virtual KFileItem nextItem( const KFileItem & ) const = 0;
303  virtual KFileItem prevItem( const KFileItem & ) const = 0;
304 
315  void setOnlyDoubleClickSelectsFiles( bool enable );
316 
322  bool onlyDoubleClickSelectsFiles() const;
323 
328  bool updateNumbers(const KFileItem &i);
329 
335  virtual KActionCollection * actionCollection() const;
336 
337  K3FileViewSignaler * signaler() const;
338 
339  virtual void readConfig( KConfigGroup *);
340  virtual void writeConfig( KConfigGroup *);
341 
348  enum DropOptions {
349  AutoOpenDirs = 1
350  };
355  virtual void setDropOptions(int options);
356 
361  int dropOptions();
362 
376  static QString sortingKey( const QString& value, bool isDir, QDir::SortFlags SortFlags);
377 
384  static QString sortingKey( KIO::filesize_t value, bool isDir,QDir::SortFlags SortFlags);
385 
390  static int autoOpenDelay();
391 
392 protected:
397  K3FileViewSignaler *sig;
398 
399 private:
400  class K3FileViewPrivate;
401  K3FileViewPrivate* const d;
402 };
403 
404 #endif // KFILEINFOLISTWIDGET_H
KActionCollection
QWidget
KIO::filesize_t
qulonglong filesize_t
QDir::SortFlags
typedef SortFlags
K3FileViewSignaler
internal class to make easier to use signals possible
Definition: k3fileview.h:38
kfile.h
prevItem
static Q3ListViewItem * prevItem(Q3ListViewItem *pi)
Definition: k3listview.cpp:254
QPoint
K3FileView
This class defines an interface to all file views.
Definition: k3fileview.h:89
readConfig
TsConfig readConfig(const QString &fname)
kde3support_export.h
QObject
QDropEvent
KFileItemList
clear
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
QString
K3FileView::DropOptions
DropOptions
Various options for drag and drop support.
Definition: k3fileview.h:348
KConfigGroup
KUrl::List
KFile::SelectionMode
SelectionMode
K3FileView::sig
K3FileViewSignaler * sig
Definition: k3fileview.h:397
selectAll
KAction * selectAll(const QObject *recvr, const char *slot, QObject *parent)
kfileitem.h
KFileItem
list
QStringList list(const QString &fileClass)
K3FileView::ViewMode
ViewMode
Definition: k3fileview.h:215
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:26:47 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDE3Support

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal