File indexing completed on 2024-04-28 03:51:14

0001 /*.
0002     SPDX-FileCopyrightText: 2007 Vladimir Kuznetsov <ks.vladimir@gmail.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef STEP_CLIPBOARD_H
0008 #define STEP_CLIPBOARD_H
0009 
0010 #include <QList>
0011 #include <QObject>
0012 
0013 namespace StepCore
0014 {
0015     class Factory;
0016     class Item;
0017 }
0018 
0019 class Clipboard : public QObject
0020 {
0021 public:
0022     explicit Clipboard(QObject* parent = nullptr);
0023     
0024     void copy(const QList<StepCore::Item*>& items);
0025     QList<StepCore::Item*> paste(const StepCore::Factory* factory);
0026     
0027     bool canPaste() const { return _canPaste; }
0028     
0029 signals:
0030     void canPasteChanged(bool value);
0031     
0032 private slots:
0033     void dataChanged();
0034     
0035 private:
0036     bool hasData() const;
0037     
0038     bool _canPaste;
0039     
0040     Q_OBJECT
0041 };
0042 
0043 #endif