File indexing completed on 2024-12-29 05:00:16

0001 /*
0002  * SPDX-FileCopyrightText: 2015 Kai Uwe Broulik <kde@privat.broulik.de>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 #ifndef GRABWIDGET_H
0008 #define GRABWIDGET_H
0009 
0010 #include <QColor>
0011 #include <QObject>
0012 
0013 class GrabWidget : public QObject
0014 {
0015     Q_OBJECT
0016 
0017     Q_PROPERTY(QColor currentColor READ currentColor NOTIFY currentColorChanged)
0018 
0019 public:
0020     explicit GrabWidget(QObject *parent = nullptr);
0021 
0022     QColor currentColor() const;
0023     void setCurrentColor(const QColor &color);
0024 
0025     Q_INVOKABLE void pick();
0026     Q_INVOKABLE void copyToClipboard(const QString &text);
0027 
0028 Q_SIGNALS:
0029     void currentColorChanged();
0030 
0031 private:
0032     QColor m_currentColor;
0033 };
0034 
0035 #endif // GRABWIDGET_H