1 /*
2     SPDX-FileCopyrightText: 2020 Gaël PORTAY <gael.portay@collabora.com>
3 
4     SPDX-License-Identifier: GPL-3.0-or-later
5 */
6 
7 #ifndef KPMCORE_SETPARTITIONNAMEJOB_H
8 #define KPMCORE_SETPARTITIONNAMEJOB_H
9 
10 #include "jobs/job.h"
11 
12 class Partition;
13 class Device;
14 class Report;
15 
16 class QString;
17 
18 /** Set a Partition label (GPT only).
19     @author Gaël PORTAY <gael.portay@collabora.com>
20 */
21 class SetPartitionLabelJob : public Job
22 {
23 public:
24     SetPartitionLabelJob(Device& d, Partition& p, const QString& newLabel);
25 
26 public:
27     bool run(Report& parent) override;
28     QString description() const override;
29 
30 protected:
partition()31     Partition& partition() {
32         return m_Partition;
33     }
partition()34     const Partition& partition() const {
35         return m_Partition;
36     }
37 
device()38     Device& device() {
39         return m_Device;
40     }
device()41     const Device& device() const {
42         return m_Device;
43     }
44 
label()45     const QString& label() const {
46         return m_Label;
47     }
setLabel(const QString & l)48     void setLabel(const QString& l) {
49         m_Label = l;
50     }
51 
52 private:
53     Device& m_Device;
54     Partition& m_Partition;
55     QString m_Label;
56 };
57 
58 #endif
59