2013-06-19 15:15:25 +01:00
|
|
|
/**
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-FileCopyrightText: 2013 Albert Vaca <albertvaka@gmail.com>
|
2013-06-19 15:15:25 +01:00
|
|
|
*
|
2020-08-17 10:48:10 +01:00
|
|
|
* SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
|
2013-06-19 15:15:25 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef KDECONNECTKCM_H
|
|
|
|
#define KDECONNECTKCM_H
|
|
|
|
|
2015-03-02 04:16:07 +00:00
|
|
|
#include <KCModule>
|
2013-06-25 17:08:34 +01:00
|
|
|
#include <QStandardItemModel>
|
|
|
|
|
2023-06-01 01:25:37 +01:00
|
|
|
#include <core/pairstate.h>
|
|
|
|
|
2013-06-19 15:15:25 +01:00
|
|
|
class QModelIndex;
|
2013-08-13 04:07:32 +01:00
|
|
|
class DeviceDbusInterface;
|
2015-03-02 05:23:05 +00:00
|
|
|
class DaemonDbusInterface;
|
2014-04-12 21:05:16 +01:00
|
|
|
class DevicesModel;
|
2013-08-15 23:25:13 +01:00
|
|
|
class DevicesSortProxyModel;
|
2013-06-25 17:08:34 +01:00
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
namespace Ui
|
|
|
|
{
|
|
|
|
class KdeConnectKcmUi;
|
2013-06-19 15:15:25 +01:00
|
|
|
}
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
class KdeConnectKcm : public KCModule
|
2013-06-19 15:15:25 +01:00
|
|
|
{
|
2013-06-27 01:13:16 +01:00
|
|
|
Q_OBJECT
|
2013-06-19 15:15:25 +01:00
|
|
|
public:
|
2022-09-10 22:23:52 +01:00
|
|
|
KdeConnectKcm(QWidget *parent, const QVariantList &);
|
2016-06-20 08:05:02 +01:00
|
|
|
~KdeConnectKcm() override;
|
2013-06-19 15:15:25 +01:00
|
|
|
|
2013-08-13 04:07:32 +01:00
|
|
|
private:
|
2016-06-20 08:05:02 +01:00
|
|
|
void save() override;
|
|
|
|
QSize sizeHint() const override;
|
|
|
|
QSize minimumSizeHint() const override;
|
2013-08-13 04:07:32 +01:00
|
|
|
|
2013-06-19 15:15:25 +01:00
|
|
|
private Q_SLOTS:
|
2022-09-10 22:23:52 +01:00
|
|
|
void deviceSelected(const QModelIndex ¤t);
|
2023-06-01 01:25:37 +01:00
|
|
|
void requestPairing();
|
2023-06-24 18:45:48 +01:00
|
|
|
void pluginsConfigChanged(bool changed);
|
2013-07-03 02:52:44 +01:00
|
|
|
void sendPing();
|
2013-08-15 23:25:13 +01:00
|
|
|
void resetSelection();
|
2022-09-10 22:23:52 +01:00
|
|
|
void pairingFailed(const QString &error);
|
2014-08-11 17:56:11 +01:00
|
|
|
void refresh();
|
2015-03-02 05:23:05 +00:00
|
|
|
void renameShow();
|
|
|
|
void renameDone();
|
|
|
|
void setRenameMode(bool b);
|
2015-09-08 19:03:44 +01:00
|
|
|
void resetCurrentDevice();
|
2023-06-01 01:25:37 +01:00
|
|
|
void setCurrentDevicePairState(int pairStateAsInt);
|
2017-02-20 20:00:26 +00:00
|
|
|
void acceptPairing();
|
2023-06-01 01:25:37 +01:00
|
|
|
void cancelPairing();
|
|
|
|
|
2013-08-13 04:07:32 +01:00
|
|
|
|
2013-06-19 15:15:25 +01:00
|
|
|
private:
|
2015-09-12 18:43:15 +01:00
|
|
|
void resetDeviceView();
|
|
|
|
|
2022-09-10 22:23:52 +01:00
|
|
|
Ui::KdeConnectKcmUi *kcmUi;
|
|
|
|
DaemonDbusInterface *daemon;
|
|
|
|
DevicesModel *devicesModel;
|
|
|
|
DevicesSortProxyModel *sortProxyModel;
|
|
|
|
DeviceDbusInterface *currentDevice;
|
2013-08-15 23:25:13 +01:00
|
|
|
QModelIndex currentIndex;
|
2016-07-06 16:37:22 +01:00
|
|
|
QStringList m_oldSupportedPluginNames;
|
2013-09-04 18:37:58 +01:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
2013-08-30 18:10:43 +01:00
|
|
|
void unpair();
|
2013-06-19 15:15:25 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|