File indexing completed on 2024-05-12 05:47:29
0001 /* 0002 * SPDX-FileCopyrightText: 2011 Peter Penz <peter.penz19@gmail.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #ifndef KFILEITEMCLIPBOARD_H 0008 #define KFILEITEMCLIPBOARD_H 0009 0010 #include "dolphin_export.h" 0011 0012 #include <QList> 0013 #include <QObject> 0014 #include <QSet> 0015 #include <QUrl> 0016 0017 /** 0018 * @brief Wrapper for QClipboard to provide fast access for checking 0019 * whether a KFileItem has been clipped. 0020 */ 0021 class DOLPHIN_EXPORT KFileItemClipboard : public QObject 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 static KFileItemClipboard *instance(); 0027 0028 bool isCut(const QUrl &url) const; 0029 0030 QList<QUrl> cutItems() const; 0031 0032 Q_SIGNALS: 0033 void cutItemsChanged(); 0034 0035 protected: 0036 ~KFileItemClipboard() override; 0037 0038 private Q_SLOTS: 0039 void updateCutItems(); 0040 0041 private: 0042 KFileItemClipboard(); 0043 0044 QSet<QUrl> m_cutItems; 0045 0046 friend class KFileItemClipboardSingleton; 0047 }; 0048 0049 #endif