Solid

frontend/storagedrive.h
1 /*
2  SPDX-FileCopyrightText: 2006-2007 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_STORAGEDRIVE_H
8 #define SOLID_STORAGEDRIVE_H
9 
10 #include <solid/solid_export.h>
11 
12 #include <solid/deviceinterface.h>
13 
14 namespace Solid
15 {
16 class StorageDrivePrivate;
17 class Device;
18 
25 class SOLID_EXPORT StorageDrive : public DeviceInterface
26 {
27  Q_OBJECT
28  Q_PROPERTY(Bus bus READ bus)
29  Q_PROPERTY(DriveType driveType READ driveType)
30  Q_PROPERTY(bool removable READ isRemovable)
31  Q_PROPERTY(bool hotpluggable READ isHotpluggable)
32  Q_PROPERTY(bool inUse READ isInUse)
33  Q_PROPERTY(qulonglong size READ size)
34  Q_DECLARE_PRIVATE(StorageDrive)
35  friend class Device;
36 
37 public:
48  enum Bus { Ide, Usb, Ieee1394, Scsi, Sata, Platform };
49  Q_ENUM(Bus)
50 
51 
64  enum DriveType { HardDisk, CdromDrive, Floppy, Tape, CompactFlash, MemoryStick, SmartMedia, SdMmc, Xd };
65  Q_ENUM(DriveType)
66 
67 private:
76  explicit StorageDrive(QObject *backendObject);
77 
78 public:
82  virtual ~StorageDrive();
83 
91  {
92  return DeviceInterface::StorageDrive;
93  }
94 
102  Bus bus() const;
103 
110  DriveType driveType() const;
111 
120  bool isRemovable() const;
121 
128  bool isHotpluggable() const;
129 
135  qulonglong size() const;
136 
144  bool isInUse() const;
145 
146 protected:
150  StorageDrive(StorageDrivePrivate &dd, QObject *backendObject);
151 };
152 }
153 
154 #endif // SOLID_STORAGEDRIVE_H
This class allows applications to deal with devices available in the underlying system.
Base class of all the device interfaces.
Type
This enum type defines the type of device interface that a Device can have.
static Type deviceInterfaceType()
Get the Solid::DeviceInterface::Type of the StorageDrive device interface.
DriveType
This enum type defines the type of drive a storage device can be.
The single responsibility of this class is to create arguments valid for logind Inhibit call...
Bus
This enum type defines the type of bus a storage device is attached to.
This device interface is available on storage devices.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Tue Sep 22 2020 22:50:18 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.