Solid
opticaldrive.h
Go to the documentation of this file.
00001 /* 00002 Copyright 2006-2007 Kevin Ottens <ervin@kde.org> 00003 00004 This library is free software; you can redistribute it and/or 00005 modify it under the terms of the GNU Lesser General Public 00006 License as published by the Free Software Foundation; either 00007 version 2.1 of the License, or (at your option) version 3, or any 00008 later version accepted by the membership of KDE e.V. (or its 00009 successor approved by the membership of KDE e.V.), which shall 00010 act as a proxy defined in Section 6 of version 3 of the license. 00011 00012 This library is distributed in the hope that it will be useful, 00013 but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 Lesser General Public License for more details. 00016 00017 You should have received a copy of the GNU Lesser General Public 00018 License along with this library. If not, see <http://www.gnu.org/licenses/>. 00019 */ 00020 00021 #ifndef SOLID_OPTICALDRIVE_H 00022 #define SOLID_OPTICALDRIVE_H 00023 00024 #include <QtCore/QList> 00025 #include <QtCore/QVariant> 00026 00027 #include <solid/solid_export.h> 00028 #include <solid/solidnamespace.h> 00029 00030 #include <solid/storagedrive.h> 00031 00032 namespace Solid 00033 { 00034 class OpticalDrivePrivate; 00035 class Device; 00036 00042 class SOLID_EXPORT OpticalDrive : public StorageDrive 00043 { 00044 Q_OBJECT 00045 Q_ENUMS(MediumType) 00046 Q_FLAGS(MediumTypes) 00047 Q_PROPERTY(MediumTypes supportedMedia READ supportedMedia) 00048 Q_PROPERTY(int readSpeed READ readSpeed) 00049 Q_PROPERTY(int writeSpeed READ writeSpeed) 00050 Q_PROPERTY(QList<int> writeSpeeds READ writeSpeeds) 00051 Q_DECLARE_PRIVATE(OpticalDrive) 00052 friend class Device; 00053 00054 public: 00075 enum MediumType { Cdr=0x00001, Cdrw=0x00002, Dvd=0x00004, Dvdr=0x00008, 00076 Dvdrw=0x00010, Dvdram=0x00020, Dvdplusr=0x00040, 00077 Dvdplusrw=0x00080, Dvdplusdl=0x00100, Dvdplusdlrw=0x00200, 00078 Bd=0x00400, Bdr=0x00800, Bdre=0x01000, 00079 HdDvd=0x02000, HdDvdr=0x04000, HdDvdrw=0x08000 }; 00080 00084 Q_DECLARE_FLAGS(MediumTypes, MediumType) 00085 00086 00087 private: 00096 explicit OpticalDrive(QObject *backendObject); 00097 00098 public: 00102 virtual ~OpticalDrive(); 00103 00104 00111 static Type deviceInterfaceType() { return DeviceInterface::OpticalDrive; } 00112 00113 00119 MediumTypes supportedMedia() const; 00120 00126 int readSpeed() const; 00127 00133 int writeSpeed() const; 00134 00141 QList<int> writeSpeeds() const; 00142 00149 bool eject(); 00150 00151 Q_SIGNALS: 00159 void ejectPressed(const QString &udi); 00160 00170 void ejectDone(Solid::ErrorType error, QVariant errorData, const QString &udi); 00171 00179 void ejectRequested(const QString &udi); 00180 00181 }; 00182 } 00183 00184 Q_DECLARE_OPERATORS_FOR_FLAGS(Solid::OpticalDrive::MediumTypes) 00185 00186 #endif // SOLID_OPTICALDRIVE_H
KDE 4.6 API Reference