Solid

frontend/opticaldrive.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_OPTICALDRIVE_H
8 #define SOLID_OPTICALDRIVE_H
9 
10 #include <QList>
11 #include <QVariant>
12 
13 #include <solid/solid_export.h>
14 #include <solid/solidnamespace.h>
15 
16 #include <solid/storagedrive.h>
17 
18 namespace Solid
19 {
20 class OpticalDrivePrivate;
21 class Device;
22 
28 class SOLID_EXPORT OpticalDrive : public StorageDrive
29 {
30  Q_OBJECT
31  Q_PROPERTY(MediumTypes supportedMedia READ supportedMedia)
32  Q_PROPERTY(int readSpeed READ readSpeed)
33  Q_PROPERTY(int writeSpeed READ writeSpeed)
34  Q_PROPERTY(QList<int> writeSpeeds READ writeSpeeds)
35  Q_DECLARE_PRIVATE(OpticalDrive)
36  friend class Device;
37 
38 public:
61  enum MediumType { UnknownMediumType = 0x00000, Cdr = 0x00001, Cdrw = 0x00002, Dvd = 0x00004,
62  Dvdr = 0x00008, Dvdrw = 0x00010, Dvdram = 0x00020, Dvdplusr = 0x00040,
63  Dvdplusrw = 0x00080, Dvdplusdl = 0x00100, Dvdplusdlrw = 0x00200,
64  Bd = 0x00400, Bdr = 0x00800, Bdre = 0x01000,
65  HdDvd = 0x02000, HdDvdr = 0x04000, HdDvdrw = 0x08000
66  };
67  Q_ENUM(MediumType)
68 
69 
72  Q_DECLARE_FLAGS(MediumTypes, MediumType)
73  Q_FLAG(MediumTypes)
74 
75 private:
84  explicit OpticalDrive(QObject *backendObject);
85 
86 public:
90  virtual ~OpticalDrive();
91 
98  static Type deviceInterfaceType()
99  {
100  return DeviceInterface::OpticalDrive;
101  }
102 
108  MediumTypes supportedMedia() const;
109 
115  int readSpeed() const;
116 
122  int writeSpeed() const;
123 
130  QList<int> writeSpeeds() const;
131 
138  bool eject();
139 
140 Q_SIGNALS:
148  void ejectPressed(const QString &udi);
149 
159  void ejectDone(Solid::ErrorType error, QVariant errorData, const QString &udi);
160 
168  void ejectRequested(const QString &udi);
169 
170 };
171 
172 Q_DECLARE_OPERATORS_FOR_FLAGS(OpticalDrive::MediumTypes)
173 
174 }
175 
176 #endif // SOLID_OPTICALDRIVE_H
This class allows applications to deal with devices available in the underlying system.
MediumType
This enum type defines the type of medium an optical drive supports.
Type
This enum type defines the type of device interface that a Device can have.
The single responsibility of this class is to create arguments valid for logind Inhibit call...
This device interface is available on storage devices.
This device interface is available on CD-R*,DVD*,Blu-Ray,HD-DVD drives.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Sep 23 2020 22:50:19 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.