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

KDE3Support

  • 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
25class QPoint;
26class QWidget;
27class QDropEvent;
28class KActionCollection;
29
30#include "kde3support_export.h"
31#include "kfileitem.h"
32#include "kfile.h"
33
38class KDE3SUPPORT_EXPORT K3FileViewSignaler : public QObject
39{
40 Q_OBJECT
41
42public:
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
61Q_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
89class KDE3SUPPORT_EXPORT K3FileView {
90
91public:
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
392protected:
397 K3FileViewSignaler *sig;
398
399private:
400 class K3FileViewPrivate;
401 K3FileViewPrivate* const d;
402};
403
404#endif // KFILEINFOLISTWIDGET_H
K3FileViewSignaler
internal class to make easier to use signals possible
Definition: k3fileview.h:39
K3FileViewSignaler::sortingChanged
void sortingChanged(QDir::SortFlags)
K3FileViewSignaler::fileSelected
void fileSelected(const KFileItem &item)
K3FileViewSignaler::activatedMenu
void activatedMenu(const KFileItem &item, const QPoint &pos)
K3FileViewSignaler::dirActivated
void dirActivated(const KFileItem &item)
K3FileViewSignaler::fileHighlighted
void fileHighlighted(const KFileItem &item)
the item maybe be a null item, indicating that we're in multiselection mode and the selection has cha...
K3FileViewSignaler::dropped
void dropped(const KFileItem &item, QDropEvent *event, const KUrl::List &urls)
K3FileView
This class defines an interface to all file views.
Definition: k3fileview.h:89
K3FileView::clearSelection
virtual void clearSelection()=0
Clears any selection, unhighlights everything.
K3FileView::nextItem
virtual KFileItem nextItem(const KFileItem &) const =0
K3FileView::DropOptions
DropOptions
Various options for drag and drop support.
Definition: k3fileview.h:348
K3FileView::sig
K3FileViewSignaler * sig
Definition: k3fileview.h:397
K3FileView::prevItem
virtual KFileItem prevItem(const KFileItem &) const =0
K3FileView::clearView
virtual void clearView()=0
pure virtual function, that should be implemented to clear the view.
K3FileView::setSelected
virtual void setSelected(const KFileItem &, bool enable)=0
Tells the view that it should highlight the item.
K3FileView::firstFileItem
virtual KFileItem firstFileItem() const =0
K3FileView::isSelected
virtual bool isSelected(const KFileItem &) const =0
K3FileView::setCurrentItem
virtual void setCurrentItem(const KFileItem &item)=0
Reimplement this to set item the current item in the view, e.g.
K3FileView::widget
virtual QWidget * widget()=0
a pure virtual function to get a QWidget, that can be added to other widgets.
K3FileView::currentFileItem
virtual KFileItem currentFileItem() const =0
K3FileView::ensureItemVisible
virtual void ensureItemVisible(const KFileItem &i)=0
pure virtual function, that should be implemented to make item i visible, i.e.
K3FileView::ViewMode
ViewMode
Definition: k3fileview.h:215
KActionCollection
KConfigGroup
KFileItemList
KFileItem
KFile::SelectionMode
SelectionMode
KUrl::List
QObject
QWidget
kde3support_export.h
kfile.h
kfileitem.h
readConfig
TsConfig readConfig(const QString &fname)
KIO::filesize_t
qulonglong filesize_t
list
QStringList list(const QString &fileClass)
selectAll
KAction * selectAll(const QObject *recvr, const char *slot, QObject *parent)
clear
KAction * clear(const QObject *recvr, const char *slot, QObject *parent)
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 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-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 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
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