File: clipboardmenu.h

package info (click to toggle)
plasma-workspace 4%3A6.3.6-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 104,900 kB
  • sloc: cpp: 125,434; xml: 31,579; python: 3,976; perl: 572; sh: 234; javascript: 74; ruby: 39; ansic: 13; makefile: 9
file content (42 lines) | stat: -rw-r--r-- 1,038 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
    SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>

    SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
*/

#pragma once

#include <QAction>
#include <QDateTime>
#include <QObject>
#include <QQmlEngine>

class ClipboardMenu : public QObject
{
    Q_OBJECT
    QML_ELEMENT
    QML_SINGLETON

    Q_PROPERTY(QDateTime currentDate READ currentDate WRITE setCurrentDate NOTIFY currentDateChanged)
    Q_PROPERTY(bool secondsIncluded READ secondsIncluded WRITE setSecondsIncluded NOTIFY secondsIncludedChanged)

public:
    explicit ClipboardMenu(QObject *parent = nullptr);
    virtual ~ClipboardMenu();

    QDateTime currentDate() const;
    void setCurrentDate(const QDateTime &date);

    bool secondsIncluded() const;
    void setSecondsIncluded(bool secondsIncluded);

    Q_INVOKABLE void setupMenu(QAction *action);

Q_SIGNALS:
    void currentDateChanged();
    void secondsIncludedChanged();

private:
    QDateTime m_currentDate;
    bool m_secondsIncluded = false;
};