calamares/src/modules/partition/core/PartitionInfo.h

57 lines
1.6 KiB
C
Raw Normal View History

/* === This file is part of Calamares - <https://calamares.io> ===
*
2020-08-22 01:19:58 +02:00
* SPDX-FileCopyrightText: 2014 Aurélien Gâteau <agateau@kde.org>
* SPDX-FileCopyrightText: 2018 Adriaan de Groot <groot@kde.org>
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Calamares is Free Software: see the License-Identifier above.
*
*/
#ifndef PARTITIONINFO_H
#define PARTITIONINFO_H
#include <QHash>
#include <QString>
#include <kpmcore/core/partitiontable.h>
class Partition;
/**
2014-08-08 11:46:43 +02:00
* Functions to store Calamares-specific information in the Qt properties of a
* Partition object.
2014-08-08 11:46:43 +02:00
*
* See README.md for the rational behind this design.
*
* Properties:
* - mountPoint: which directory will a partition be mounted on the installed
* system. This is different from Partition::mountPoint, which is the
* directory on which a partition is *currently* mounted while the installer
* is running.
* - format: whether this partition should be formatted at install time.
*/
namespace PartitionInfo
{
QString mountPoint( Partition* partition );
void setMountPoint( Partition* partition, const QString& value );
bool format( Partition* partition );
void setFormat( Partition* partition, bool value );
PartitionTable::Flags flags( const Partition* partition );
void setFlags( Partition* partition, PartitionTable::Flags f );
void reset( Partition* partition );
2014-08-08 11:46:43 +02:00
/**
* Returns true if one of the property has been set. This information is used
* by the UI to decide whether the "Revert" button should be enabled or
* disabled.
*/
2014-07-24 19:28:53 +02:00
bool isDirty( Partition* partition );
}; // namespace PartitionInfo
#endif /* PARTITIONINFO_H */