File indexing completed on 2024-06-09 04:00:39

0001 /*
0002     SPDX-FileCopyrightText: 2017 René J.V. Bertin <rjvbertin@gmail.com>
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_IOKIT_STORAGEACCESS_H
0008 #define SOLID_BACKENDS_IOKIT_STORAGEACCESS_H
0009 
0010 #include "dadictionary_p.h"
0011 #include "iokitdeviceinterface.h"
0012 #include <solid/devices/ifaces/storageaccess.h>
0013 
0014 namespace Solid
0015 {
0016 namespace Backends
0017 {
0018 namespace IOKit
0019 {
0020 class IOKitStorageAccess : public DeviceInterface, virtual public Solid::Ifaces::StorageAccess
0021 {
0022     Q_OBJECT
0023     Q_INTERFACES(Solid::Ifaces::StorageAccess)
0024 
0025 public:
0026     IOKitStorageAccess(IOKitDevice *device);
0027     IOKitStorageAccess(const IOKitDevice *device);
0028     virtual ~IOKitStorageAccess();
0029 
0030     bool isAccessible() const override;
0031     QString filePath() const override;
0032     bool isIgnored() const override;
0033     bool isEncrypted() const override;
0034 public Q_SLOTS:
0035     bool setup() override;
0036     bool teardown() override;
0037 
0038 Q_SIGNALS:
0039     void accessibilityChanged(bool accessible, const QString &udi) override;
0040     void setupDone(Solid::ErrorType error, QVariant errorData, const QString &udi) override;
0041     void teardownDone(Solid::ErrorType error, QVariant errorData, const QString &udi) override;
0042     void setupRequested(const QString &udi) override;
0043     void teardownRequested(const QString &udi) override;
0044 
0045 private Q_SLOTS:
0046     void onPropertyChanged(const QMap<QString, int> &changes);
0047 
0048 private:
0049     DADictionary *daDict;
0050 };
0051 }
0052 }
0053 }
0054 
0055 #endif // SOLID_BACKENDS_IOKIT_STORAGEACCESS_H