File indexing completed on 2024-04-28 05:45:54
0001 /* 0002 SPDX-FileCopyrightText: 2008-2010 Volker Lanz <vl@fidra.de> 0003 SPDX-FileCopyrightText: 2016 Andrius Štikonas <andrius@stikonas.eu> 0004 0005 SPDX-License-Identifier: GPL-3.0-or-later 0006 */ 0007 0008 #ifndef KPMCORE_SETPARTGEOMETRYJOB_H 0009 #define KPMCORE_SETPARTGEOMETRYJOB_H 0010 0011 #include "jobs/job.h" 0012 0013 #include <QtGlobal> 0014 0015 class Partition; 0016 class Device; 0017 class Report; 0018 0019 class QString; 0020 0021 /** Set a Partition's geometry. 0022 0023 Sets the geometry for a given Partition on a given Device to a new start sector and/or a new 0024 length. This does not move the FileSystem, it only updates the partition table entry for the 0025 Partition and is usually run together with MoveFileSystemJob or ResizeFileSystemJob for that reason. 0026 0027 @author Volker Lanz <vl@fidra.de> 0028 */ 0029 class SetPartGeometryJob : public Job 0030 { 0031 public: 0032 SetPartGeometryJob(Device& d, Partition& p, qint64 newstart, qint64 newlength); 0033 0034 public: 0035 bool run(Report& parent) override; 0036 QString description() const override; 0037 0038 protected: 0039 Partition& partition() { 0040 return m_Partition; 0041 } 0042 const Partition& partition() const { 0043 return m_Partition; 0044 } 0045 0046 Device& device() { 0047 return m_Device; 0048 } 0049 const Device& device() const { 0050 return m_Device; 0051 } 0052 0053 qint64 newStart() const { 0054 return m_NewStart; 0055 } 0056 qint64 newLength() const { 0057 return m_NewLength; 0058 } 0059 0060 private: 0061 Device& m_Device; 0062 Partition& m_Partition; 0063 qint64 m_NewStart; 0064 qint64 m_NewLength; 0065 }; 0066 0067 #endif