1 /*
2     SPDX-FileCopyrightText: 2006-2007 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 #include "opticaldrive.h"
8 #include "opticaldrive_p.h"
9 
10 #include "soliddefs_p.h"
11 #include <solid/devices/ifaces/opticaldrive.h>
12 
OpticalDrive(QObject * backendObject)13 Solid::OpticalDrive::OpticalDrive(QObject *backendObject)
14     : StorageDrive(*new OpticalDrivePrivate(), backendObject)
15 {
16     connect(backendObject, SIGNAL(ejectPressed(QString)), this, SIGNAL(ejectPressed(QString)));
17     connect(backendObject, SIGNAL(ejectDone(Solid::ErrorType, QVariant, QString)), this, SIGNAL(ejectDone(Solid::ErrorType, QVariant, QString)));
18     connect(backendObject, SIGNAL(ejectRequested(QString)), this, SIGNAL(ejectRequested(QString)));
19 }
20 
~OpticalDrive()21 Solid::OpticalDrive::~OpticalDrive()
22 {
23 }
24 
supportedMedia() const25 Solid::OpticalDrive::MediumTypes Solid::OpticalDrive::supportedMedia() const
26 {
27     Q_D(const OpticalDrive);
28     return_SOLID_CALL(Ifaces::OpticalDrive *, d->backendObject(), MediumTypes(), supportedMedia());
29 }
30 
readSpeed() const31 int Solid::OpticalDrive::readSpeed() const
32 {
33     Q_D(const OpticalDrive);
34     return_SOLID_CALL(Ifaces::OpticalDrive *, d->backendObject(), 0, readSpeed());
35 }
36 
writeSpeed() const37 int Solid::OpticalDrive::writeSpeed() const
38 {
39     Q_D(const OpticalDrive);
40     return_SOLID_CALL(Ifaces::OpticalDrive *, d->backendObject(), 0, writeSpeed());
41 }
42 
writeSpeeds() const43 QList<int> Solid::OpticalDrive::writeSpeeds() const
44 {
45     Q_D(const OpticalDrive);
46     return_SOLID_CALL(Ifaces::OpticalDrive *, d->backendObject(), QList<int>(), writeSpeeds());
47 }
48 
eject()49 bool Solid::OpticalDrive::eject()
50 {
51     Q_D(OpticalDrive);
52     return_SOLID_CALL(Ifaces::OpticalDrive *, d->backendObject(), false, eject());
53 }
54