1// SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: GPL-3.0-or-later
4
5#ifndef TREEVIEW_H
6#define TREEVIEW_H
7
8#include <QTreeView>
9#include "services/project/projectservice.h"
10
11class TreeViewPrivate;
12class TreeView : public QTreeView
13{
14 Q_OBJECT
15 TreeViewPrivate *const d;
16public:
17 explicit TreeView(QWidget *parent = nullptr);
18 virtual ~TreeView();
19 void setProjectInfo(const dpfservice::ProjectInfo &proInfo);
20public slots:
21 void selOpen();
22 void selMoveToTrash();
23 void selRemove();
24 void selNewDocument();
25 void selNewFolder();
26 void recoverFromTrash();
27 void doDoubleClicked(const QModelIndex &index);
28signals:
29 void rootPathChanged(const QString &folder);
30protected:
31 void contextMenuEvent(QContextMenuEvent *event);
32 virtual QMenu *createContextMenu(const QModelIndexList &indexs);
33 virtual QMenu *createEmptyMenu();
34};
35
36#endif // TREEVIEW_H
37