File indexing completed on 2025-01-26 05:07:37

0001 /*
0002     SPDX-FileCopyrightText: 2016 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 #pragma once
0008 
0009 #include <QDateTime>
0010 #include <QObject>
0011 
0012 class QAction;
0013 
0014 class ClipboardMenu : public QObject
0015 {
0016     Q_OBJECT
0017 
0018     Q_PROPERTY(QDateTime currentDate READ currentDate WRITE setCurrentDate NOTIFY currentDateChanged)
0019     Q_PROPERTY(bool secondsIncluded READ secondsIncluded WRITE setSecondsIncluded NOTIFY secondsIncludedChanged)
0020 
0021 public:
0022     explicit ClipboardMenu(QObject *parent = nullptr);
0023     virtual ~ClipboardMenu();
0024 
0025     QDateTime currentDate() const;
0026     void setCurrentDate(const QDateTime &date);
0027 
0028     bool secondsIncluded() const;
0029     void setSecondsIncluded(bool secondsIncluded);
0030 
0031     Q_INVOKABLE void setupMenu(QAction *action);
0032 
0033 Q_SIGNALS:
0034     void currentDateChanged();
0035     void secondsIncludedChanged();
0036 
0037 private:
0038     QDateTime m_currentDate;
0039     bool m_secondsIncluded = false;
0040 };