| 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 | |
| 12 | namespace Solid |
| 13 | { |
| 14 | namespace 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 | class Block : virtual public DeviceInterface |
| 24 | { |
| 25 | public: |
| 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 | * Whether this block is considered a system block, |
| 58 | * that it requires additional permissions to access (mount/umount) |
| 59 | * |
| 60 | * \since 6.15 |
| 61 | */ |
| 62 | virtual bool isSystem() const; |
| 63 | }; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | Q_DECLARE_INTERFACE(Solid::Ifaces::Block, "org.kde.Solid.Ifaces.Block/0.1" ) |
| 68 | |
| 69 | #endif |
| 70 | |