Solid

udisksdevice.h
1/*
2 SPDX-FileCopyrightText: 2010 Michael Zanetti <mzanetti@kde.org>
3 SPDX-FileCopyrightText: 2010-2012 Lukáš Tinkl <ltinkl@redhat.com>
4
5 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
6*/
7
8#ifndef UDISKSDEVICE_H
9#define UDISKSDEVICE_H
10
11#include "udisks2.h"
12
13#include <ifaces/device.h>
14#include <solid/deviceinterface.h>
15#include <solid/solidnamespace.h>
16
17#include <QDBusObjectPath>
18#include <QStringList>
19
20namespace Solid
21{
22namespace Backends
23{
24namespace UDisks2
25{
26class DeviceBackend;
27
28class Device : public Solid::Ifaces::Device
29{
31public:
32 Device(const QString &udi);
33 ~Device() override;
34
35 QObject *createDeviceInterface(const Solid::DeviceInterface::Type &type) override;
36 bool queryDeviceInterface(const Solid::DeviceInterface::Type &type) const override;
37 QString description() const override;
38 QStringList emblems() const override;
39 QString icon() const override;
40 QString product() const override;
41 QString vendor() const override;
42 QString udi() const override;
43 QString parentUdi() const override;
44
45 QVariant prop(const QString &key) const;
46 bool propertyExists(const QString &key) const;
47 QVariantMap allProperties() const;
48 void invalidateCache();
49
50 bool hasInterface(const QString &name) const;
51 QStringList interfaces() const;
52
53 QString errorToString(const QString &error) const;
54 Solid::ErrorType errorToSolidError(const QString &error) const;
55
56 bool isBlock() const;
57 bool isPartition() const;
58 bool isPartitionTable() const;
59 bool isStorageVolume() const;
60 bool isStorageAccess() const;
61 bool isDrive() const;
62 bool isOpticalDrive() const;
63 bool isOpticalDisc() const;
64 bool mightBeOpticalDisc() const;
65 bool isMounted() const;
66 bool isEncryptedContainer() const;
67 bool isEncryptedCleartext() const;
68 bool isRoot() const;
69 bool isSwap() const;
70 bool isLoop() const;
71
72 QString drivePath() const;
73
75 void changed();
76 void propertyChanged(const QMap<QString, int> &changes);
77
78protected:
80
81private:
82 QString loopDescription() const;
83 QString storageDescription() const;
84 QString volumeDescription() const;
85};
86
87}
88}
89}
90
91#endif // UDISKSDEVICE_H
Type
This enum type defines the type of device interface that a Device can have.
This class specifies the interface a device will have to comply to in order to be used in the system.
The single responsibility of this class is to create arguments valid for logind Inhibit call.
Definition fakebattery.h:16
Q_OBJECTQ_OBJECT
Q_SIGNALSQ_SIGNALS
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:17:12 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.