File indexing completed on 2024-04-28 05:48:12

0001 // SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0002 // SPDX-FileCopyrightText: 2022 Harald Sitter <sitter@kde.org>
0003 
0004 #pragma once
0005 
0006 #include <memory>
0007 
0008 #include <QObject>
0009 
0010 class File;
0011 
0012 namespace RadialMap
0013 {
0014 class Segment;
0015 } // namespace RadialMap
0016 
0017 namespace Filelight
0018 {
0019 class FileModel;
0020 
0021 class ContextMenuContext : public QObject
0022 {
0023     Q_OBJECT
0024     Q_PROPERTY(bool deleting MEMBER m_deleting WRITE setDeleting NOTIFY deletingChanged)
0025 public:
0026     using QObject::QObject;
0027 
0028 public Q_SLOTS:
0029     void openTerminal(RadialMap::Segment *segment);
0030     void openTerminal(const QUrl &url);
0031 
0032     void doNotScan(RadialMap::Segment *segment);
0033     void doNotScan(const QUrl &url);
0034 
0035     void copyClipboard(RadialMap::Segment *segment);
0036     void copyClipboard(const QUrl &url);
0037 
0038     void deleteFileFromSegment(RadialMap::Segment *segment);
0039     void deleteFile(const std::shared_ptr<File> &file);
0040 
0041     void setDeleting(bool status);
0042 
0043 Q_SIGNALS:
0044     void deletingChanged();
0045 
0046 private:
0047     bool m_deleting = false;
0048 };
0049 
0050 } // namespace Filelight