File indexing completed on 2024-04-28 05:45:54

0001 /*
0002     SPDX-FileCopyrightText: 2016 Chantara Tith <tith.chantara@gmail.com>
0003     SPDX-FileCopyrightText: 2016-2018 Andrius Štikonas <andrius@stikonas.eu>
0004 
0005     SPDX-License-Identifier: GPL-3.0-or-later
0006 */
0007 
0008 #ifndef KPMCORE_RESIZEVOLUMEGROUPJOB_H
0009 #define KPMCORE_RESIZEVOLUMEGROUPJOB_H
0010 
0011 #include "core/partition.h"
0012 #include "jobs/job.h"
0013 
0014 class LvmDevice;
0015 class Report;
0016 
0017 class QString;
0018 
0019 class ResizeVolumeGroupJob : public Job
0020 {
0021 
0022 public:
0023     enum class Type {
0024         Grow,
0025         Shrink
0026     };
0027 
0028 public:
0029     ResizeVolumeGroupJob(LvmDevice& dev, const QList <const Partition*>& partlist, const Type type);
0030 
0031 public:
0032     bool run(Report& parent) override;
0033     QString description() const override;
0034 
0035 protected:
0036     LvmDevice& device() {
0037         return m_Device;
0038     }
0039     const LvmDevice& device() const {
0040         return m_Device;
0041     }
0042 
0043     const QList <const Partition*>& partList() const {
0044         return m_PartList;
0045     }
0046 
0047     ResizeVolumeGroupJob::Type type() const {
0048         return m_Type;
0049     }
0050 
0051 private:
0052     LvmDevice& m_Device;
0053     const QList <const Partition*> m_PartList;
0054     ResizeVolumeGroupJob::Type m_Type;
0055 };
0056 
0057 #endif