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_BLOCK_H
8#define SOLID_IFACES_BLOCK_H
9
10#include <solid/devices/ifaces/deviceinterface.h>
11
12namespace Solid
13{
14namespace Ifaces
15{
16/*!
17 * This device interface is available on block devices.
18 *
19 * A block device is an addressable device such as drive or partition.
20 * It is possible to interact with such a device using a special file
21 * in the system.
22 *
23 * \internal
24 */
25class Block : virtual public DeviceInterface
26{
27public:
28 /*!
29 * Destroys a Block object.
30 */
31 ~Block() override;
32
33 /*!
34 * Retrieves the major number of the node file to interact with
35 * the device.
36 *
37 * Returns the device major number
38 */
39 virtual int deviceMajor() const = 0;
40
41 /*!
42 * Retrieves the minor number of the node file to interact with
43 * the device.
44 *
45 * Returns the device minor number
46 */
47 virtual int deviceMinor() const = 0;
48
49 /*!
50 * Retrieves the absolute path of the special file to interact
51 * with the device.
52 *
53 * Returns the absolute path of the special file to interact with
54 * the device
55 */
56 virtual QString device() const = 0;
57
58 /*!
59 * Whether this block is considered a system block,
60 * that it requires additional permissions to access (mount/umount)
61 *
62 * \since 6.15
63 */
64 virtual bool isSystem() const;
65};
66}
67}
68
69Q_DECLARE_INTERFACE(Solid::Ifaces::Block, "org.kde.Solid.Ifaces.Block/0.1")
70
71#endif
72

source code of solid/src/solid/devices/ifaces/block.h