Solid

ifaces/storagedrive.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_IFACES_STORAGEDRIVE_H
8#define SOLID_IFACES_STORAGEDRIVE_H
9
10#include <QDateTime>
11
12#include <solid/devices/ifaces/block.h>
13#include <solid/storagedrive.h>
14
15namespace Solid
16{
17namespace Ifaces
18{
19/**
20 * This device interface is available on storage devices.
21 *
22 * A storage is anything that can contain a set of volumes (card reader,
23 * hard disk, cdrom drive...). It's a particular kind of block device.
24 */
25class StorageDrive : virtual public Block
26{
27public:
28 /**
29 * Destroys a StorageDrive object.
30 */
31 ~StorageDrive() override;
32
33 /**
34 * Retrieves the type of physical interface this storage device is
35 * connected to.
36 *
37 * @return the bus type
38 * @see Solid::StorageDrive::Bus
39 */
40 virtual Solid::StorageDrive::Bus bus() const = 0;
41
42 /**
43 * Retrieves the type of this storage drive.
44 *
45 * @return the drive type
46 * @see Solid::StorageDrive::DriveType
47 */
49
50 /**
51 * Indicates if the media contained by this drive can be removed.
52 *
53 * For example memory card can be removed from the drive by the user,
54 * while partitions can't be removed from hard disks.
55 *
56 * @return true if media can be removed, false otherwise.
57 */
58 virtual bool isRemovable() const = 0;
59
60 /**
61 * Indicates if this storage device can be plugged or unplugged while
62 * the computer is running.
63 *
64 * @return true if this storage supports hotplug, false otherwise
65 */
66 virtual bool isHotpluggable() const = 0;
67
68 /**
69 * Retrieves this drives size in bytes.
70 *
71 * @return the size of this drive
72 */
73 virtual qulonglong size() const = 0;
74
75 /**
76 * Retrieves the time the drive was detected
77 */
78 virtual QDateTime timeDetected() const;
79
80 /**
81 * Retrieves the time media in the drive was detected
82 */
83 virtual QDateTime timeMediaDetected() const;
84};
85}
86}
87
88Q_DECLARE_INTERFACE(Solid::Ifaces::StorageDrive, "org.kde.Solid.Ifaces.StorageDrive/0.1")
89
90#endif // SOLID_IFACES_STORAGEDRIVE_H
This device interface is available on block devices.
This device interface is available on storage devices.
virtual QDateTime timeDetected() const
Retrieves the time the drive was detected.
virtual bool isRemovable() const =0
Indicates if the media contained by this drive can be removed.
virtual Solid::StorageDrive::DriveType driveType() const =0
Retrieves the type of this storage drive.
virtual Solid::StorageDrive::Bus bus() const =0
Retrieves the type of physical interface this storage device is connected to.
~StorageDrive() override
Destroys a StorageDrive object.
virtual bool isHotpluggable() const =0
Indicates if this storage device can be plugged or unplugged while the computer is running.
virtual qulonglong size() const =0
Retrieves this drives size in bytes.
virtual QDateTime timeMediaDetected() const
Retrieves the time media in the drive was detected.
DriveType
This enum type defines the type of drive a storage device can be.
Bus
This enum type defines the type of bus a storage device is attached to.
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 Tue Mar 26 2024 11:17:12 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.