Solid

ifaces/storagevolume.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_STORAGEVOLUME_H
8#define SOLID_IFACES_STORAGEVOLUME_H
9
10#include <solid/devices/ifaces/block.h>
11#include <solid/storagevolume.h>
12
13namespace Solid
14{
15namespace Ifaces
16{
17/**
18 * This device interface is available on volume devices.
19 *
20 * A volume is anything that can contain data (partition, optical disc,
21 * memory card). It's a particular kind of block device.
22 */
23class StorageVolume : virtual public Block
24{
25public:
26 /**
27 * Destroys a StorageVolume object.
28 */
29 ~StorageVolume() override;
30
31 /**
32 * Indicates if this volume should be ignored by applications.
33 *
34 * If it should be ignored, it generally means that it should be
35 * invisible to the user. It's useful for firmware partitions or
36 * OS reinstall partitions on some systems.
37 *
38 * @return true if the volume should be ignored
39 */
40 virtual bool isIgnored() const = 0;
41
42 /**
43 * Retrieves the type of use for this volume (for example filesystem).
44 *
45 * @return the usage type
46 * @see Solid::StorageVolume::UsageType
47 */
49
50 /**
51 * Retrieves the filesystem type of this volume.
52 *
53 * @return the filesystem type if applicable, QString() otherwise
54 */
55 virtual QString fsType() const = 0;
56
57 /**
58 * Retrieves this volume label.
59 *
60 * @return the volume level if available, QString() otherwise
61 */
62 virtual QString label() const = 0;
63
64 /**
65 * Retrieves this volume Universal Unique IDentifier (UUID).
66 *
67 * You can generally assume that this identifier is unique with reasonable
68 * confidence. Except if the volume UUID has been forged to intentionally
69 * provoke a collision, the probability to have two volumes having the same
70 * UUID is low.
71 *
72 * @return the Universal Unique IDentifier if available, QString() otherwise
73 */
74 virtual QString uuid() const = 0;
75
76 /**
77 * Retrieves this volume size in bytes.
78 *
79 * @return the size of this volume
80 */
81 virtual qulonglong size() const = 0;
82
83 /**
84 * Retrieves the crypto container UDI of this volume.
85 *
86 * @return the encrypted volume UDI containing the current volume if applicable,
87 * an empty string otherwise
88 */
89 virtual QString encryptedContainerUdi() const = 0;
90};
91}
92}
93
94Q_DECLARE_INTERFACE(Solid::Ifaces::StorageVolume, "org.kde.Solid.Ifaces.StorageVolume/0.1")
95
96#endif // SOLID_IFACES_STORAGEVOLUME_H
This device interface is available on block devices.
This device interface is available on volume devices.
virtual QString label() const =0
Retrieves this volume label.
virtual QString fsType() const =0
Retrieves the filesystem type of this volume.
virtual QString uuid() const =0
Retrieves this volume Universal Unique IDentifier (UUID).
virtual QString encryptedContainerUdi() const =0
Retrieves the crypto container UDI of this volume.
~StorageVolume() override
Destroys a StorageVolume object.
virtual Solid::StorageVolume::UsageType usage() const =0
Retrieves the type of use for this volume (for example filesystem).
virtual bool isIgnored() const =0
Indicates if this volume should be ignored by applications.
virtual qulonglong size() const =0
Retrieves this volume size in bytes.
UsageType
This enum type defines the how a volume is used.
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.