2 This file is part of the KDE project
4 Copyright (C) 2007 Tobias Koenig <tokoe@kde.org>
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.
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.
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.
22 #ifndef KFILETREEVIEW_H
23 #define KFILETREEVIEW_H
25 #include <QtGui/QTreeView>
29 #include <kfile_export.h>
32 * The file treeview offers a treeview on the filesystem.
34 class KFILE_EXPORT KFileTreeView
: public QTreeView
40 * Creates a new file tree view.
42 KFileTreeView(QWidget
*parent
= 0);
45 * Destroys the file tree view.
50 * Returns the current url.
52 KUrl
currentUrl() const;
55 * Returns the selected url.
57 KUrl
selectedUrl() const;
60 * Returns all selected urls.
62 KUrl::List
selectedUrls() const;
65 * Returns the current root url of the view.
71 * Sets whether the dir-only mode is @p enabled.
73 * In dir-only mode, only directories and subdirectories
74 * are listed in the view.
76 void setDirOnlyMode(bool enabled
);
79 * Sets whether hidden files shall be listed.
81 void setShowHiddenFiles(bool enabled
);
84 * Sets the current @p url of the view.
86 void setCurrentUrl(const KUrl
&url
);
89 * Sets the root @p url of the view.
91 * The default is file:///.
93 void setRootUrl(const KUrl
&url
);
97 * This signal is emitted whenever an @p url has been activated.
99 void activated(const KUrl
&url
);
102 * This signal is emitted whenever the current @p url has been changed.
104 void currentChanged(const KUrl
&url
);
107 virtual void contextMenuEvent( QContextMenuEvent
* );
113 Q_PRIVATE_SLOT(d
, void _k_activated(const QModelIndex
&))
114 Q_PRIVATE_SLOT(d
, void _k_currentChanged(const QModelIndex
&, const QModelIndex
&))
115 Q_PRIVATE_SLOT(d
, void _k_expanded(const QModelIndex
&))