File indexing completed on 2024-04-14 03:53:06

0001 /*
0002     SPDX-FileCopyrightText: 2007 Peter Penz <peter.penz@gmx.at>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-only
0005 */
0006 
0007 #ifndef KDIROPERATORDETAILVIEW_P_H
0008 #define KDIROPERATORDETAILVIEW_P_H
0009 
0010 #include <QTreeView>
0011 
0012 #include <kfile.h>
0013 
0014 class QAbstractItemModel;
0015 
0016 /**
0017  * Default detail view for KDirOperator using
0018  * custom resizing options and columns.
0019  */
0020 class KDirOperatorDetailView : public QTreeView
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     explicit KDirOperatorDetailView(QWidget *parent = nullptr);
0026     ~KDirOperatorDetailView() override;
0027 
0028     /**
0029      * Displays either Detail, Tree or DetailTree modes.
0030      */
0031     virtual bool setViewMode(KFile::FileView viewMode);
0032 
0033 protected:
0034     void initViewItemOption(QStyleOptionViewItem *option) const override;
0035 
0036     bool event(QEvent *event) override;
0037     void dragEnterEvent(QDragEnterEvent *event) override;
0038     void mousePressEvent(QMouseEvent *event) override;
0039     void currentChanged(const QModelIndex &current, const QModelIndex &previous) override;
0040 
0041 private:
0042     bool m_hideDetailColumns;
0043 };
0044 
0045 #endif