2021-03-01 20:03:25 +00:00
|
|
|
/*
|
|
|
|
|
* SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org>
|
2017-09-14 19:03:56 +00:00
|
|
|
*
|
2021-03-01 20:03:25 +00:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
2017-09-14 19:03:56 +00:00
|
|
|
|
|
|
|
|
#ifndef PHONEPANEL_H
|
|
|
|
|
#define PHONEPANEL_H
|
|
|
|
|
|
|
|
|
|
#include <Plasma/Containment>
|
|
|
|
|
|
2021-03-09 19:04:29 +00:00
|
|
|
#include <KConfigWatcher>
|
2021-03-19 07:52:22 +00:00
|
|
|
#include <KSharedConfig>
|
2021-03-09 19:04:29 +00:00
|
|
|
|
2020-04-12 14:14:51 +00:00
|
|
|
#include "kscreeninterface.h"
|
2020-04-29 16:17:43 +00:00
|
|
|
#include "screenshotinterface.h"
|
2017-09-14 19:03:56 +00:00
|
|
|
|
|
|
|
|
class PhonePanel : public Plasma::Containment
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
2020-04-12 14:14:51 +00:00
|
|
|
Q_PROPERTY(bool autoRotateEnabled READ autoRotate WRITE setAutoRotate NOTIFY autoRotateChanged);
|
2020-11-16 06:20:40 +00:00
|
|
|
Q_PROPERTY(bool torchEnabled READ torchEnabled NOTIFY torchChanged);
|
2021-03-09 19:04:29 +00:00
|
|
|
Q_PROPERTY(bool isSystem24HourFormat READ isSystem24HourFormat NOTIFY isSystem24HourFormatChanged);
|
2021-03-19 07:52:22 +00:00
|
|
|
|
2017-09-14 19:03:56 +00:00
|
|
|
public:
|
2021-03-19 07:52:22 +00:00
|
|
|
PhonePanel(QObject *parent, const QVariantList &args);
|
2018-12-31 03:13:55 +00:00
|
|
|
~PhonePanel() override;
|
2017-09-14 19:03:56 +00:00
|
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
|
void executeCommand(const QString &command);
|
2018-11-12 04:02:46 +00:00
|
|
|
void toggleTorch();
|
2020-02-06 17:17:47 +00:00
|
|
|
void takeScreenshot();
|
2017-09-14 19:03:56 +00:00
|
|
|
|
2020-04-12 14:14:51 +00:00
|
|
|
bool autoRotate();
|
|
|
|
|
void setAutoRotate(bool value);
|
2021-03-19 07:52:22 +00:00
|
|
|
|
2020-11-16 06:20:40 +00:00
|
|
|
bool torchEnabled() const;
|
2021-03-19 07:52:22 +00:00
|
|
|
|
2021-03-09 19:04:29 +00:00
|
|
|
bool isSystem24HourFormat();
|
2020-04-12 14:14:51 +00:00
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
void autoRotateChanged(bool value);
|
2020-11-16 06:20:40 +00:00
|
|
|
void torchChanged(bool value);
|
2021-03-09 19:04:29 +00:00
|
|
|
void isSystem24HourFormatChanged();
|
2020-04-12 14:14:51 +00:00
|
|
|
|
2017-09-14 19:03:56 +00:00
|
|
|
private:
|
2018-11-12 04:02:46 +00:00
|
|
|
bool m_running = false;
|
2021-03-19 07:52:22 +00:00
|
|
|
|
2021-03-09 19:04:29 +00:00
|
|
|
KConfigWatcher::Ptr m_localeConfigWatcher;
|
|
|
|
|
KSharedConfig::Ptr m_localeConfig;
|
2020-04-29 16:17:43 +00:00
|
|
|
|
2020-04-12 14:14:51 +00:00
|
|
|
org::kde::KScreen *m_kscreenInterface;
|
2020-04-29 16:17:43 +00:00
|
|
|
org::kde::kwin::Screenshot *m_screenshotInterface;
|
2017-09-14 19:03:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|