Solid

ifaces/device.h
1 /*
2  SPDX-FileCopyrightText: 2005 Kevin Ottens <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5 */
6 
7 #ifndef SOLID_IFACES_DEVICE_H
8 #define SOLID_IFACES_DEVICE_H
9 
10 #include <QObject>
11 #include <QVariant>
12 
13 #include <QMap>
14 
15 #include <solid/deviceinterface.h>
16 #include <solid/device.h>
17 #include <solid/solidnamespace.h>
18 
19 namespace Solid
20 {
21 namespace Ifaces
22 {
32 class Device : public QObject
33 {
34  Q_OBJECT
35 
36 public:
40  Device(QObject *parent = nullptr);
44  virtual ~Device();
45 
52  virtual QString udi() const = 0;
53 
60  virtual QString parentUdi() const;
61 
67  virtual QString vendor() const = 0;
68 
74  virtual QString product() const = 0;
75 
82  virtual QString icon() const = 0;
83 
90  virtual QStringList emblems() const = 0;
91 
99  virtual QString displayName() const;
100 
106  virtual QString description() const = 0;
107 
114  virtual bool queryDeviceInterface(const Solid::DeviceInterface::Type &type) const = 0;
115 
124 
135  void registerAction(const QString &actionName, QObject *dest, const char *requestSlot, const char *doneSlot) const;
136 
143  void broadcastActionRequested(const QString &actionName) const;
144 
153  void broadcastActionDone(const QString &actionName,
154  int error = Solid::NoError,
155  const QString &errorString = QString()) const;
156 
157 private:
158  QString deviceDBusPath() const;
159 };
160 }
161 }
162 
163 #endif
virtual bool queryDeviceInterface(const Solid::DeviceInterface::Type &type) const =0
Tests if a property exist.
virtual QString parentUdi() const
Retrieves the Universal Device Identifier (UDI) of the Device&#39;s parent.
virtual QString displayName() const
Retrieves the display name to use for this device.
virtual QString udi() const =0
Retrieves the Universal Device Identifier (UDI) of the Device.
void registerAction(const QString &actionName, QObject *dest, const char *requestSlot, const char *doneSlot) const
Register an action for the given device.
Device(QObject *parent=nullptr)
Constructs a Device.
virtual QStringList emblems() const =0
Retrieves the name of the emblems representing the state of this device.
Type
This enum type defines the type of device interface that a Device can have.
virtual QString vendor() const =0
Retrieves the name of the device vendor.
virtual QObject * createDeviceInterface(const Solid::DeviceInterface::Type &type)=0
Create a specialized interface to interact with the device corresponding to a particular device inter...
Q_OBJECTQ_OBJECT
void broadcastActionRequested(const QString &actionName) const
Allows to broadcast that an action just got requested on a device to all the corresponding devices in...
void broadcastActionDone(const QString &actionName, int error=Solid::NoError, const QString &errorString=QString()) const
Allows to broadcast that an action just completed in a device to all the corresponding devices in oth...
virtual QString description() const =0
Retrieves the description of device.
virtual QString icon() const =0
Retrieves the name of the icon representing this device.
virtual ~Device()
Destruct the Device object.
The single responsibility of this class is to create arguments valid for logind Inhibit call...
This class specifies the interface a device will have to comply to in order to be used in the system...
Definition: ifaces/device.h:32
QObject * parent() const const
virtual QString product() const =0
Retrieves the name of the product corresponding to this device.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Sep 22 2020 22:50:17 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.