Solid

ifaces/opticaldrive.h
1/*
2 SPDX-FileCopyrightText: 2006 Kevin Ottens <ervin@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
5*/
6
7#ifndef SOLID_IFACE_OPTICALDRIVE_H
8#define SOLID_IFACE_OPTICALDRIVE_H
9
10#include <QList>
11
12#include <solid/devices/ifaces/storagedrive.h>
13#include <solid/opticaldrive.h>
14
15namespace Solid
16{
17namespace Ifaces
18{
19/**
20 * This device interface is available on CD-ROM drives.
21 *
22 * A Cdrom is a storage that can handle optical discs.
23 */
24class OpticalDrive : virtual public StorageDrive
25{
26public:
27 /**
28 * Destroys a Cdrom object.
29 */
30 ~OpticalDrive() override;
31
32 /**
33 * Retrieves the medium types this drive supports.
34 *
35 * @return the flag set indicating the supported medium types
36 */
38
39 /**
40 * Retrieves the maximum read speed of this drive in kilobytes.
41 *
42 * @return the maximum read speed
43 */
44 virtual int readSpeed() const = 0;
45
46 /**
47 * Retrieves the maximum write speed of this drive in kilobytes.
48 *
49 * @return the maximum write speed
50 */
51 virtual int writeSpeed() const = 0;
52
53 /**
54 * Retrieves the list of supported write speeds of this drive in
55 * kilobytes.
56 *
57 * @return the list of supported write speeds
58 */
59 virtual QList<int> writeSpeeds() const = 0;
60
61 /**
62 * Ejects any disc that could be contained in this drive.
63 * If this drive is empty, but has a tray it'll be opened
64 *
65 * @return
66 */
67 virtual bool eject() = 0;
68
69protected:
70 // Q_SIGNALS:
71 /**
72 * This signal is emitted when the eject button is pressed
73 * on the drive.
74 *
75 * Please note that some (broken) drives doesn't report this event.
76 * @param udi the UDI of the drive
77 */
78 virtual void ejectPressed(const QString &udi) = 0;
79
80 virtual void ejectDone(Solid::ErrorType error, QVariant errorData, const QString &udi) = 0;
81};
82}
83}
84
85Q_DECLARE_INTERFACE(Solid::Ifaces::OpticalDrive, "org.kde.Solid.Ifaces.OpticalDrive/0.1")
86
87#endif // SOLID_IFACE_OPTICALDRIVE_H
This device interface is available on CD-ROM drives.
virtual Solid::OpticalDrive::MediumTypes supportedMedia() const =0
Retrieves the medium types this drive supports.
~OpticalDrive() override
Destroys a Cdrom object.
virtual int writeSpeed() const =0
Retrieves the maximum write speed of this drive in kilobytes.
virtual int readSpeed() const =0
Retrieves the maximum read speed of this drive in kilobytes.
virtual void ejectPressed(const QString &udi)=0
This signal is emitted when the eject button is pressed on the drive.
virtual QList< int > writeSpeeds() const =0
Retrieves the list of supported write speeds of this drive in kilobytes.
virtual bool eject()=0
Ejects any disc that could be contained in this drive.
This device interface is available on storage devices.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:47:35 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.