File indexing completed on 2024-05-12 04:01:52

0001 /*
0002     SPDX-FileCopyrightText: 2006 Kevin Ottens <ervin@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef SOLID_IFACES_BLOCK_H
0008 #define SOLID_IFACES_BLOCK_H
0009 
0010 #include <solid/devices/ifaces/deviceinterface.h>
0011 
0012 namespace Solid
0013 {
0014 namespace Ifaces
0015 {
0016 /**
0017  * This device interface is available on block devices.
0018  *
0019  * A block device is an addressable device such as drive or partition.
0020  * It is possible to interact with such a device using a special file
0021  * in the system.
0022  */
0023 class Block : virtual public DeviceInterface
0024 {
0025 public:
0026     /**
0027      * Destroys a Block object.
0028      */
0029     ~Block() override;
0030 
0031     /**
0032      * Retrieves the major number of the node file to interact with
0033      * the device.
0034      *
0035      * @return the device major number
0036      */
0037     virtual int deviceMajor() const = 0;
0038 
0039     /**
0040      * Retrieves the minor number of the node file to interact with
0041      * the device.
0042      *
0043      * @return the device minor number
0044      */
0045     virtual int deviceMinor() const = 0;
0046 
0047     /**
0048      * Retrieves the absolute path of the special file to interact
0049      * with the device.
0050      *
0051      * @return the absolute path of the special file to interact with
0052      * the device
0053      */
0054     virtual QString device() const = 0;
0055 };
0056 }
0057 }
0058 
0059 Q_DECLARE_INTERFACE(Solid::Ifaces::Block, "org.kde.Solid.Ifaces.Block/0.1")
0060 
0061 #endif