File indexing completed on 2024-10-06 04:25:59
0001 /* 0002 SPDX-FileCopyrightText: 2003-2007 Sebastian Trueg <trueg@k3b.org> 0003 SPDX-FileCopyrightText: 2009 Gustavo Pichorim Boiko <gustavo.boiko@kdemail.net> 0004 SPDX-FileCopyrightText: 1998-2009 Sebastian Trueg <trueg@k3b.org> 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 0010 #ifndef K3BFILETREEVIEW_H 0011 #define K3BFILETREEVIEW_H 0012 0013 #include <QUrl> 0014 #include <QTreeView> 0015 0016 class QPoint; 0017 0018 namespace K3b { 0019 namespace Device { 0020 class Device; 0021 } 0022 0023 class FileTreeView : public QTreeView 0024 { 0025 Q_OBJECT 0026 0027 public: 0028 explicit FileTreeView( QWidget *parent = 0 ); 0029 ~FileTreeView() override; 0030 0031 /** 0032 * returns 0 if no device is selected 0033 */ 0034 Device::Device* selectedDevice() const; 0035 0036 /** 0037 * returns an empty url if no url is selected 0038 */ 0039 QUrl selectedUrl() const; 0040 0041 public Q_SLOTS: 0042 void setSelectedUrl( const QUrl& url ); 0043 void setSelectedDevice( K3b::Device::Device* dev ); 0044 0045 Q_SIGNALS: 0046 void activated( const QUrl& url ); 0047 void activated( K3b::Device::Device* dev ); 0048 0049 private Q_SLOTS: 0050 void slotClicked( const QModelIndex& index ); 0051 void slotExpandUrl( const QModelIndex& index ); 0052 void slotContextMenu( const QPoint& pos ); 0053 void slotAddFilesToProject(); 0054 0055 private: 0056 void initActions(); 0057 class Private; 0058 Private* const d; 0059 }; 0060 } 0061 0062 #endif