Solid

ifaces/block.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_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 */
23class Block : virtual public DeviceInterface
24{
25public:
26 /**
27 * Destroys a Block object.
28 */
29 ~Block() override;
30
31 /**
32 * Retrieves the major number of the node file to interact with
33 * the device.
34 *
35 * @return the device major number
36 */
37 virtual int deviceMajor() const = 0;
38
39 /**
40 * Retrieves the minor number of the node file to interact with
41 * the device.
42 *
43 * @return the device minor number
44 */
45 virtual int deviceMinor() const = 0;
46
47 /**
48 * Retrieves the absolute path of the special file to interact
49 * with the device.
50 *
51 * @return the absolute path of the special file to interact with
52 * the device
53 */
54 virtual QString device() const = 0;
55};
56}
57}
58
59Q_DECLARE_INTERFACE(Solid::Ifaces::Block, "org.kde.Solid.Ifaces.Block/0.1")
60
61#endif
This device interface is available on block devices.
~Block() override
Destroys a Block object.
virtual QString device() const =0
Retrieves the absolute path of the special file to interact with the device.
virtual int deviceMinor() const =0
Retrieves the minor number of the node file to interact with the device.
virtual int deviceMajor() const =0
Retrieves the major number of the node file to interact with the device.
Base interface of all the device interfaces.
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.