File indexing completed on 2024-05-05 04:51:43
0001 /* 0002 SPDX-FileCopyrightText: 1998-2008 Sebastian Trueg <trueg@k3b.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 0008 #ifndef K3BDATADIRTREEVIEW_H 0009 #define K3BDATADIRTREEVIEW_H 0010 0011 #include <QUrl> 0012 #include <QTreeView> 0013 0014 0015 class QItemSelection; 0016 0017 /** 0018 *@author Sebastian Trueg 0019 */ 0020 0021 namespace K3b { 0022 class DataDoc; 0023 class DataItem; 0024 class DirItem; 0025 class View; 0026 0027 class DataDirTreeView : public QTreeView 0028 { 0029 Q_OBJECT 0030 0031 public: 0032 DataDirTreeView( View*, DataDoc*, QWidget* parent ); 0033 ~DataDirTreeView() override; 0034 0035 /** 0036 * \return The item at position \p pos (local coordinates) 0037 * or 0 if there is no item at that position. 0038 */ 0039 DataItem* itemAt( const QPoint& pos ); 0040 0041 DirItem* selectedDir() const; 0042 0043 public Q_SLOTS: 0044 void setCurrentDir( K3b::DirItem* ); 0045 0046 Q_SIGNALS: 0047 void dirSelected( K3b::DirItem* ); 0048 0049 private Q_SLOTS: 0050 void slotSelectionChanged( const QItemSelection& selected, const QItemSelection& ); 0051 void slotAddUrlsRequested( QList<QUrl> urls, K3b::DirItem* targetDir ); 0052 void slotMoveItemsRequested( QList<K3b::DataItem*> items, K3b::DirItem* targetDir ); 0053 0054 private: 0055 void startDropAnimation( DirItem* ); 0056 void stopDropAnimation(); 0057 0058 View* m_view; 0059 0060 DataDoc* m_doc; 0061 0062 class Private; 0063 Private* d; 0064 }; 0065 } 0066 0067 #endif