KFile
kfiletreeview.h
Go to the documentation of this file.
00001 /* 00002 This file is part of the KDE project 00003 00004 Copyright (C) 2007 Tobias Koenig <tokoe@kde.org> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef KFILETREEVIEW_H 00023 #define KFILETREEVIEW_H 00024 00025 #include <QtGui/QTreeView> 00026 00027 #include <kurl.h> 00028 00029 #include <kfile_export.h> 00030 00034 class KFILE_EXPORT KFileTreeView : public QTreeView // KDE5: remove KFILE_EXPORT? Seems internal only. 00035 { 00036 Q_OBJECT 00037 00038 public: 00042 KFileTreeView(QWidget *parent = 0); 00043 00047 ~KFileTreeView(); 00048 00052 KUrl currentUrl() const; 00053 00057 KUrl selectedUrl() const; 00058 00062 KUrl::List selectedUrls() const; 00063 00067 KUrl rootUrl() const; 00068 00073 bool showHiddenFiles() const; 00074 00078 QSize sizeHint() const; 00079 00080 public Q_SLOTS: 00087 void setDirOnlyMode(bool enabled); 00088 00092 void setShowHiddenFiles(bool enabled); 00093 00097 void setCurrentUrl(const KUrl &url); 00098 00104 void setRootUrl(const KUrl &url); 00105 00106 Q_SIGNALS: 00110 void activated(const KUrl &url); 00111 00115 void currentChanged(const KUrl &url); 00116 00117 protected: 00118 virtual void contextMenuEvent( QContextMenuEvent* ); 00119 00120 private: 00121 class Private; 00122 Private* const d; 00123 00124 Q_PRIVATE_SLOT(d, void _k_activated(const QModelIndex&)) 00125 Q_PRIVATE_SLOT(d, void _k_currentChanged(const QModelIndex&, const QModelIndex&)) 00126 Q_PRIVATE_SLOT(d, void _k_expanded(const QModelIndex&)) 00127 }; 00128 00129 #endif
KDE 4.7 API Reference