Solid

frontend/opticaldisc.h
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#ifndef SOLID_OPTICALDISC_H
8#define SOLID_OPTICALDISC_H
9
10#include <solid/solid_export.h>
11
12#include <solid/storagevolume.h>
13
14namespace Solid
15{
16class OpticalDiscPrivate;
17class Device;
18
19/**
20 * @class Solid::OpticalDisc opticaldisc.h <Solid/OpticalDisc>
21 *
22 * This device interface is available on optical discs.
23 *
24 * An optical disc is a volume that can be inserted in CD-R*,DVD*,Blu-Ray,HD-DVD drives.
25 */
26class SOLID_EXPORT OpticalDisc : public StorageVolume
27{
28 Q_OBJECT
29 Q_PROPERTY(ContentTypes availableContent READ availableContent)
30 Q_PROPERTY(DiscType discType READ discType)
31 Q_PROPERTY(bool appendable READ isAppendable)
32 Q_PROPERTY(bool blank READ isBlank)
33 Q_PROPERTY(bool rewritable READ isRewritable)
34 Q_PROPERTY(qulonglong capacity READ capacity)
35 Q_DECLARE_PRIVATE(OpticalDisc)
36 friend class Device;
37
38public:
39 /**
40 * This enum type defines the type of content available in an optical disc.
41 *
42 * - Audio : A disc containing audio
43 * - Data : A disc containing data
44 * - VideoCd : A Video Compact Disc (VCD)
45 * - SuperVideoCd : A Super Video Compact Disc (SVCD)
46 * - VideoDvd : A Video Digital Versatile Disc (DVD-Video)
47 *
48 * @see ContentTypes
49 */
51 NoContent = 0x00,
52 Audio = 0x01,
53 Data = 0x02,
54 VideoCd = 0x04,
55 SuperVideoCd = 0x08,
56 VideoDvd = 0x10,
57 VideoBluRay = 0x20,
58 };
59 Q_ENUM(ContentType)
60
61 /**
62 * Stores a combination of #ContentType values.
63 */
64 Q_DECLARE_FLAGS(ContentTypes, ContentType)
65 Q_FLAG(ContentTypes)
66
67 /**
68 * This enum type defines the type of optical disc it can be.
69 *
70 * - UnknownDiscType : An undetermined disc type
71 * - CdRom : A Compact Disc Read-Only Memory (CD-ROM)
72 * - CdRecordable : A Compact Disc Recordable (CD-R)
73 * - CdRewritable : A Compact Disc ReWritable (CD-RW)
74 * - DvdRom : A Digital Versatile Disc Read-Only Memory (DVD-ROM)
75 * - DvdRam : A Digital Versatile Disc Random Access Memory (DVD-RAM)
76 * - DvdRecordable : A Digital Versatile Disc Recordable (DVD-R)
77 * - DvdRewritable : A Digital Versatile Disc ReWritable (DVD-RW)
78 * - DvdPlusRecordable : A Digital Versatile Disc Recordable (DVD+R)
79 * - DvdPlusRewritable : A Digital Versatile Disc ReWritable (DVD+RW)
80 * - DvdPlusRecordableDuallayer : A Digital Versatile Disc Recordable Dual-Layer (DVD+R DL)
81 * - DvdPlusRewritableDuallayer : A Digital Versatile Disc ReWritable Dual-Layer (DVD+RW DL)
82 * - BluRayRom : A Blu-ray Disc (BD)
83 * - BluRayRecordable : A Blu-ray Disc Recordable (BD-R)
84 * - BluRayRewritable : A Blu-ray Disc (BD-RE)
85 * - HdDvdRom: A High Density Digital Versatile Disc (HD DVD)
86 * - HdDvdRecordable : A High Density Digital Versatile Disc Recordable (HD DVD-R)
87 * - HdDvdRewritable : A High Density Digital Versatile Disc ReWritable (HD DVD-RW)
88 */
89 enum DiscType {
90 UnknownDiscType = -1,
91 CdRom,
92 CdRecordable,
93 CdRewritable,
94 DvdRom,
95 DvdRam,
96 DvdRecordable,
97 DvdRewritable,
98 DvdPlusRecordable,
99 DvdPlusRewritable,
100 DvdPlusRecordableDuallayer,
101 DvdPlusRewritableDuallayer,
102 BluRayRom,
103 BluRayRecordable,
104 BluRayRewritable,
105 HdDvdRom,
106 HdDvdRecordable,
107 HdDvdRewritable,
108 };
109 Q_ENUM(DiscType)
110
111private:
112 /**
113 * Creates a new OpticalDisc object.
114 * You generally won't need this. It's created when necessary using
115 * Device::as().
116 *
117 * @param backendObject the device interface object provided by the backend
118 * @see Solid::Device::as()
119 */
120 SOLID_NO_EXPORT explicit OpticalDisc(QObject *backendObject);
121
122public:
123 /**
124 * Destroys an OpticalDisc object.
125 */
126 ~OpticalDisc() override;
127
128 /**
129 * Get the Solid::DeviceInterface::Type of the OpticalDisc device interface.
130 *
131 * @return the OpticalDisc device interface type
132 * @see Solid::Ifaces::Enums::DeviceInterface::Type
133 */
135 {
136 return DeviceInterface::OpticalDisc;
137 }
138
139 /**
140 * Retrieves the content types this disc contains (audio, video,
141 * data...).
142 *
143 * @return the flag set indicating the available contents
144 * @see Solid::OpticalDisc::ContentType
145 */
146 ContentTypes availableContent() const;
147
148 /**
149 * Retrieves the disc type (cdr, cdrw...).
150 *
151 * @return the disc type
152 */
153 DiscType discType() const;
154
155 /**
156 * Indicates if it's possible to write additional data to the disc.
157 *
158 * @return true if the disc is appendable, false otherwise
159 */
160 bool isAppendable() const;
161
162 /**
163 * Indicates if the disc is blank.
164 *
165 * @return true if the disc is blank, false otherwise
166 */
167 bool isBlank() const;
168
169 /**
170 * Indicates if the disc is rewritable.
171 *
172 * A disc is rewritable if you can write on it several times.
173 *
174 * @return true if the disc is rewritable, false otherwise
175 */
176 bool isRewritable() const;
177
178 /**
179 * Retrieves the disc capacity (that is the maximum size of a
180 * volume could have on this disc).
181 *
182 * @return the capacity of the disc in bytes
183 */
184 qulonglong capacity() const;
185};
186
187Q_DECLARE_OPERATORS_FOR_FLAGS(OpticalDisc::ContentTypes)
188
189}
190
191#endif
Type
This enum type defines the type of device interface that a Device can have.
This class allows applications to deal with devices available in the underlying system.
This device interface is available on optical discs.
QFlags< ContentType > ContentTypes
Stores a combination of ContentType values.
DiscType
This enum type defines the type of optical disc it can be.
static Type deviceInterfaceType()
Get the Solid::DeviceInterface::Type of the OpticalDisc device interface.
ContentType
This enum type defines the type of content available in an optical disc.
This device interface is available on volume devices.
The single responsibility of this class is to create arguments valid for logind Inhibit call.
Definition fakebattery.h:16
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 24 2024 11:56:28 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.