2020-09-20 20:33:16 +01:00
|
|
|
/*
|
|
|
|
SPDX-FileCopyrightText: 2008-2010 Volker Lanz <vl@fidra.de>
|
|
|
|
SPDX-FileCopyrightText: 2012-2018 Andrius Štikonas <andrius@stikonas.eu>
|
|
|
|
SPDX-FileCopyrightText: 2016 Chantara Tith <tith.chantara@gmail.com>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
*/
|
2016-05-31 19:28:31 +01:00
|
|
|
|
2018-04-02 13:46:53 +01:00
|
|
|
#ifndef KPMCORE_DISKDEVICE_H
|
2017-09-10 20:12:52 +01:00
|
|
|
#define KPMCORE_DISKDEVICE_H
|
2016-05-31 19:28:31 +01:00
|
|
|
|
|
|
|
#include "util/libpartitionmanagerexport.h"
|
|
|
|
#include "core/device.h"
|
|
|
|
|
2018-04-02 13:46:53 +01:00
|
|
|
#include <memory>
|
|
|
|
|
2016-05-31 19:28:31 +01:00
|
|
|
#include <QString>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QtGlobal>
|
|
|
|
|
|
|
|
class PartitionTable;
|
|
|
|
class CreatePartitionTableOperation;
|
|
|
|
class CoreBackend;
|
|
|
|
class SmartStatus;
|
2018-04-09 00:34:45 +01:00
|
|
|
class DiskDevicePrivate;
|
2016-05-31 19:28:31 +01:00
|
|
|
|
|
|
|
/** A disk device.
|
|
|
|
|
|
|
|
Represents a device like /dev/sda.
|
|
|
|
|
|
|
|
Devices are the outermost entity; they contain a PartitionTable that itself contains Partitions.
|
|
|
|
|
|
|
|
@see PartitionTable, Partition
|
|
|
|
@author Volker Lanz <vl@fidra.de>
|
|
|
|
*/
|
2018-04-02 13:46:53 +01:00
|
|
|
|
2016-05-31 19:28:31 +01:00
|
|
|
class LIBKPMCORE_EXPORT DiskDevice : public Device
|
|
|
|
{
|
|
|
|
Q_DISABLE_COPY(DiskDevice)
|
|
|
|
|
|
|
|
friend class CreatePartitionTableOperation;
|
|
|
|
friend class CoreBackend;
|
|
|
|
|
|
|
|
public:
|
2017-09-11 13:41:03 +01:00
|
|
|
DiskDevice(const QString& name, const QString& deviceNode, qint32 heads, qint32 numSectors, qint32 cylinders, qint64 sectorSize, const QString& iconName = QString());
|
2016-05-31 19:28:31 +01:00
|
|
|
|
|
|
|
public:
|
2018-04-02 13:46:53 +01:00
|
|
|
/**
|
|
|
|
* @return the number of heads on the Device in CHS notation
|
|
|
|
*/
|
2018-04-02 14:12:30 +01:00
|
|
|
[[deprecated]]
|
2018-04-02 13:46:53 +01:00
|
|
|
qint32 heads() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the number of cylinders on the Device in CHS notation
|
|
|
|
*/
|
2018-04-02 14:12:30 +01:00
|
|
|
[[deprecated]]
|
2018-04-02 13:46:53 +01:00
|
|
|
qint32 cylinders() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the number of sectors on the Device in CHS notation
|
|
|
|
*/
|
|
|
|
qint32 sectorsPerTrack() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the physical sector size the Device uses or -1 if unknown
|
|
|
|
*/
|
|
|
|
qint64 physicalSectorSize() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the logical sector size the Device uses
|
|
|
|
*/
|
|
|
|
qint64 logicalSectorSize() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the total number of sectors on the device
|
|
|
|
*/
|
|
|
|
qint64 totalSectors() const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return the size of a cylinder on this Device in sectors
|
|
|
|
*/
|
|
|
|
qint64 cylinderSize() const;
|
2016-05-31 19:28:31 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|