Changeset View
Changeset View
Standalone View
Standalone View
core/device.h
Context not available. | |||||
23 | 23 | | |||
---|---|---|---|---|---|
24 | #include <QObject> | 24 | #include <QObject> | ||
25 | #include <QString> | 25 | #include <QString> | ||
26 | #include <QVector> | | |||
27 | #include <QSet> | | |||
28 | #include <QHostAddress> | 26 | #include <QHostAddress> | ||
29 | 27 | | |||
30 | #include "networkpacket.h" | 28 | #include "networkpacket.h" | ||
Context not available. | |||||
74 | 72 | | |||
75 | ~Device() override; | 73 | ~Device() override; | ||
76 | 74 | | |||
77 | QString id() const { return m_deviceId; } | 75 | QString id() const; | ||
78 | QString name() const { return m_deviceName; } | 76 | QString name() const; | ||
79 | QString dbusPath() const { return "/modules/kdeconnect/devices/"+id(); } | 77 | QString dbusPath() const { return "/modules/kdeconnect/devices/"+id(); } | ||
80 | QString type() const { return type2str(m_deviceType); } | 78 | QString type() const; | ||
81 | QString iconName() const; | 79 | QString iconName() const; | ||
82 | QString statusIconName() const; | 80 | QString statusIconName() const; | ||
83 | Q_SCRIPTABLE QString encryptionInfo() const; | 81 | Q_SCRIPTABLE QString encryptionInfo() const; | ||
Context not available. | |||||
89 | Q_SCRIPTABLE bool isTrusted() const; | 87 | Q_SCRIPTABLE bool isTrusted() const; | ||
90 | 88 | | |||
91 | Q_SCRIPTABLE QStringList availableLinks() const; | 89 | Q_SCRIPTABLE QStringList availableLinks() const; | ||
92 | bool isReachable() const { return !m_deviceLinks.isEmpty(); } | 90 | bool isReachable() const; | ||
93 | 91 | | |||
94 | Q_SCRIPTABLE QStringList loadedPlugins() const; | 92 | Q_SCRIPTABLE QStringList loadedPlugins() const; | ||
95 | Q_SCRIPTABLE bool hasPlugin(const QString& name) const; | 93 | Q_SCRIPTABLE bool hasPlugin(const QString& name) const; | ||
Context not available. | |||||
102 | 100 | | |||
103 | void cleanUnneededLinks(); | 101 | void cleanUnneededLinks(); | ||
104 | 102 | | |||
105 | int protocolVersion() { return m_protocolVersion; } | 103 | int protocolVersion(); | ||
106 | QStringList supportedPlugins() const { return m_supportedPlugins.toList(); } | 104 | QStringList supportedPlugins() const; | ||
107 | 105 | | |||
108 | QHostAddress getLocalIpAddress() const; | 106 | QHostAddress getLocalIpAddress() const; | ||
109 | 107 | | |||
Context not available. | |||||
145 | void setName(const QString& name); | 143 | void setName(const QString& name); | ||
146 | QString iconForStatus(bool reachable, bool paired) const; | 144 | QString iconForStatus(bool reachable, bool paired) const; | ||
147 | 145 | | |||
148 | private: //Fields (TODO: dPointer!) | 146 | private: | ||
149 | const QString m_deviceId; | 147 | class DevicePrivate; | ||
150 | QString m_deviceName; | 148 | DevicePrivate *d; | ||
151 | DeviceType m_deviceType; | | |||
152 | int m_protocolVersion; | | |||
153 | | ||||
154 | QVector<DeviceLink*> m_deviceLinks; | | |||
155 | QHash<QString, KdeConnectPlugin*> m_plugins; | | |||
156 | | ||||
157 | //Capabilities stuff | | |||
158 | QMultiMap<QString, KdeConnectPlugin*> m_pluginsByIncomingCapability; | | |||
159 | QSet<QString> m_supportedPlugins; | | |||
160 | QSet<PairingHandler*> m_pairRequests; | | |||
161 | }; | 149 | }; | ||
162 | 150 | | |||
163 | Q_DECLARE_METATYPE(Device*) | 151 | Q_DECLARE_METATYPE(Device*) | ||
Context not available. |