1 /* === This file is part of Calamares - <https://github.com/calamares> ===
3 * Copyright 2018-2019, Collabora Ltd <arnaud.ferraris@collabora.com>
4 * Copyright 2019, Adriaan de Groot <groot@kde.org>
6 * Calamares is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * Calamares is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Calamares. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef PARTITIONLAYOUT_H
21 #define PARTITIONLAYOUT_H
23 #include "partition/PartitionSize.h"
25 #include "core/PartUtils.h"
28 #include <kpmcore/core/partitiontable.h>
29 #include <kpmcore/fs/filesystem.h>
34 #include <QVariantMap>
46 QString partMountPoint;
47 FileSystem::Type partFileSystem = FileSystem::Unknown;
48 QVariantMap partFeatures;
49 CalamaresUtils::Partition::PartitionSize partSize;
50 CalamaresUtils::Partition::PartitionSize partMinSize;
51 CalamaresUtils::Partition::PartitionSize partMaxSize;
53 /// @brief All-zeroes PartitionEntry
55 /// @brief Parse @p size, @p min and @p max to their respective member variables
56 PartitionEntry( const QString& size, const QString& min, const QString& max );
60 if ( !partSize.isValid()
61 || ( partMinSize.isValid() && partMaxSize.isValid() && partMinSize > partMaxSize ) )
70 PartitionLayout( PartitionEntry entry );
71 PartitionLayout( const PartitionLayout& layout );
74 bool addEntry( PartitionEntry entry );
75 bool addEntry( const QString& mountPoint,
77 const QString& min = QString(),
78 const QString& max = QString() );
79 bool addEntry( const QString& label,
82 const QString& mountPoint,
84 const QVariantMap& features,
86 const QString& min = QString(),
87 const QString& max = QString() );
90 * @brief Apply the current partition layout to the selected drive space.
91 * @return A list of Partition objects.
93 QList< Partition* > execute( Device* dev,
96 QString luksPassphrase,
97 PartitionNode* parent,
98 const PartitionRole& role );
101 FileSystem::Type m_defaultFsType;
102 QList< PartitionEntry > m_partLayout;
105 #endif /* PARTITIONLAYOUT_H */