| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2010 Mario Bensi <mbensi@ipsquad.net> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
| 5 | */ |
| 6 | |
| 7 | #ifndef SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H |
| 8 | #define SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H |
| 9 | |
| 10 | #include "fstabstorageaccess.h" |
| 11 | #include <QPointer> |
| 12 | #include <QString> |
| 13 | #include <solid/devices/ifaces/device.h> |
| 14 | |
| 15 | namespace Solid |
| 16 | { |
| 17 | namespace Backends |
| 18 | { |
| 19 | namespace Fstab |
| 20 | { |
| 21 | class FstabDevice : public Solid::Ifaces::Device |
| 22 | { |
| 23 | Q_OBJECT |
| 24 | |
| 25 | public: |
| 26 | FstabDevice(QString uid); |
| 27 | |
| 28 | ~FstabDevice() override; |
| 29 | |
| 30 | QString udi() const override; |
| 31 | |
| 32 | QString parentUdi() const override; |
| 33 | |
| 34 | QString vendor() const override; |
| 35 | |
| 36 | QString product() const override; |
| 37 | |
| 38 | QString icon() const override; |
| 39 | |
| 40 | QStringList emblems() const override; |
| 41 | |
| 42 | QString displayName() const override; |
| 43 | |
| 44 | QString description() const override; |
| 45 | |
| 46 | bool isEncrypted() const; |
| 47 | |
| 48 | bool queryDeviceInterface(const Solid::DeviceInterface::Type &type) const override; |
| 49 | |
| 50 | QObject *createDeviceInterface(const Solid::DeviceInterface::Type &type) override; |
| 51 | |
| 52 | QString device() const; |
| 53 | |
| 54 | Q_SIGNALS: |
| 55 | void mtabChanged(const QString &device); |
| 56 | |
| 57 | public Q_SLOTS: |
| 58 | void onMtabChanged(const QString &device); |
| 59 | |
| 60 | private: |
| 61 | QString m_uid; |
| 62 | QString m_device; |
| 63 | QString m_product; |
| 64 | QString m_vendor; |
| 65 | QString m_displayName; |
| 66 | QString m_description; |
| 67 | QString m_iconName; |
| 68 | QPointer<FstabStorageAccess> m_storageAccess; |
| 69 | enum class StorageType : uint8_t { |
| 70 | Other = 0, |
| 71 | NetworkShare, |
| 72 | Encrypted, |
| 73 | }; |
| 74 | StorageType m_storageType = StorageType::Other; |
| 75 | }; |
| 76 | |
| 77 | } |
| 78 | } |
| 79 | } |
| 80 | #endif // SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H |
| 81 | |