File indexing completed on 2024-12-08 07:55:46

0001 // SPDX-FileCopyrightText: 2021 Devin Lin <devin@kde.org>
0002 // SPDX-License-Identifier: GPL-2.0-or-later
0003 
0004 #pragma once
0005 
0006 #include <QKeySequence>
0007 #include <QObject>
0008 #include <QQuickItem>
0009 
0010 class Util : public QObject
0011 {
0012     Q_OBJECT
0013 
0014     Q_PROPERTY(QString initialCommand MEMBER m_initialCommand NOTIFY initialCommandChanged)
0015     Q_PROPERTY(QString initialWorkDir MEMBER m_initialWorkDir NOTIFY initialWorkDirChanged)
0016 
0017 public:
0018     explicit Util(QObject *parent = nullptr);
0019 
0020     static Util *self()
0021     {
0022         static Util *singleton = new Util();
0023         return singleton;
0024     }
0025 
0026     Q_INVOKABLE uint getKeyFromString(QString key);
0027     Q_INVOKABLE void setBlur(QQuickItem *item, bool blur);
0028 
0029     void setInitialCommand(QString &&command);
0030     Q_SIGNAL void initialCommandChanged();
0031 
0032     void setInitialWorkDir(QString &&initialWorkDir);
0033     Q_SIGNAL void initialWorkDirChanged();
0034 
0035 private:
0036     QString m_initialCommand;
0037     QString m_initialWorkDir;
0038 };