gio-qt 0.0.16
Loading...
Searching...
No Matches
dgiodrive.h
1// SPDX-FileCopyrightText: 2019 - 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DGIODRIVE_H
6#define DGIODRIVE_H
7
8#include <QObject>
9#include <QSharedData>
10
11#define DGIODRIVE_IDENTIFIER_KIND_UNIX_DEVICE "unix-device"
12
13namespace Gio {
14class Drive;
15}
16
17class DGioDrivePrivate;
18class DGioDrive : public QObject, public QSharedData {
19 Q_OBJECT
20public:
21 explicit DGioDrive(Gio::Drive *gmmDrivePtr, QObject *parent = nullptr);
22 ~DGioDrive();
23
24 QString name() const;
25 QString identifier(const QString & kind = DGIODRIVE_IDENTIFIER_KIND_UNIX_DEVICE) const;
26 bool hasVolumes() const;
27 bool canStart() const;
28 bool canStop() const;
29 bool canEject() const;
30 bool isMediaRemovable() const;
31 bool isRemovable() const;
32
33private:
34 QScopedPointer<DGioDrivePrivate> d_ptr;
35 Q_DECLARE_PRIVATE(DGioDrive)
36};
37
38
39#endif // DGIODRIVE_H
QString name() const
Gets the name of drive.
Definition dgiodrive.cpp:63
QString identifier(const QString &kind=DGIODRIVE_IDENTIFIER_KIND_UNIX_DEVICE) const
Gets the identifier of the given kind for drive.
Definition dgiodrive.cpp:81
bool isRemovable() const
Checks if the drive and/or its media is considered removable by the user.
Definition dgiodrive.cpp:139
bool isMediaRemovable() const
Checks if the drive supports removable media.
Definition dgiodrive.cpp:123