File indexing completed on 2024-06-16 03:54:29

0001 /*
0002     SPDX-FileCopyrightText: 2010 Mario Bensi <mbensi@ipsquad.net>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H
0008 #define SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H
0009 
0010 #include "fstabstorageaccess.h"
0011 #include <QPointer>
0012 #include <QStringList>
0013 #include <solid/devices/ifaces/device.h>
0014 
0015 namespace Solid
0016 {
0017 namespace Backends
0018 {
0019 namespace Fstab
0020 {
0021 class FstabDevice : public Solid::Ifaces::Device
0022 {
0023     Q_OBJECT
0024 
0025 public:
0026     FstabDevice(QString uid);
0027 
0028     ~FstabDevice() override;
0029 
0030     QString udi() const override;
0031 
0032     QString parentUdi() const override;
0033 
0034     QString vendor() const override;
0035 
0036     QString product() const override;
0037 
0038     QString icon() const override;
0039 
0040     QStringList emblems() const override;
0041 
0042     QString displayName() const override;
0043 
0044     QString description() const override;
0045 
0046     bool isEncrypted() const;
0047 
0048     bool queryDeviceInterface(const Solid::DeviceInterface::Type &type) const override;
0049 
0050     QObject *createDeviceInterface(const Solid::DeviceInterface::Type &type) override;
0051 
0052     QString device() const;
0053 
0054 Q_SIGNALS:
0055     void mtabChanged(const QString &device);
0056 
0057 public Q_SLOTS:
0058     void onMtabChanged(const QString &device);
0059 
0060 private:
0061     QString m_uid;
0062     QString m_device;
0063     QString m_product;
0064     QString m_vendor;
0065     QString m_displayName;
0066     QString m_description;
0067     QString m_iconName;
0068     QPointer<FstabStorageAccess> m_storageAccess;
0069     enum class StorageType : uint8_t {
0070         Other = 0,
0071         NetworkShare,
0072         Encrypted,
0073     };
0074     StorageType m_storageType = StorageType::Other;
0075 };
0076 
0077 }
0078 }
0079 }
0080 #endif // SOLID_BACKENDS_FSTAB_FSTAB_DEVICE_H