2014-06-30 13:37:46 +02:00
|
|
|
/* === This file is part of Calamares - <http://github.com/calamares> ===
|
|
|
|
*
|
|
|
|
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
|
|
|
|
*
|
|
|
|
* Calamares is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* Calamares is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef PARTITIONCOREMODULE_H
|
|
|
|
#define PARTITIONCOREMODULE_H
|
|
|
|
|
2014-07-04 17:33:26 +02:00
|
|
|
#include <PartitionInfo.h>
|
2014-07-02 15:49:35 +02:00
|
|
|
#include <Typedefs.h>
|
2014-06-30 13:37:46 +02:00
|
|
|
|
2014-06-30 16:17:28 +02:00
|
|
|
// CalaPM
|
|
|
|
#include <core/partitiontable.h>
|
|
|
|
|
2014-07-02 15:49:35 +02:00
|
|
|
// Qt
|
|
|
|
#include <QList>
|
|
|
|
#include <QObject>
|
|
|
|
|
2014-06-30 18:08:13 +02:00
|
|
|
class CreatePartitionJob;
|
2014-06-30 13:37:46 +02:00
|
|
|
class Device;
|
2014-06-30 13:48:40 +02:00
|
|
|
class DeviceModel;
|
2014-06-30 16:17:28 +02:00
|
|
|
class FileSystem;
|
|
|
|
class Partition;
|
2014-06-30 14:12:23 +02:00
|
|
|
class PartitionModel;
|
2014-06-30 13:37:46 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Owns the Qt models and the PM devices
|
|
|
|
*/
|
|
|
|
class PartitionCoreModule : public QObject
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
PartitionCoreModule( QObject* parent = nullptr );
|
2014-06-30 14:12:23 +02:00
|
|
|
~PartitionCoreModule();
|
2014-06-30 13:37:46 +02:00
|
|
|
|
2014-06-30 13:48:40 +02:00
|
|
|
DeviceModel* deviceModel() const;
|
|
|
|
|
2014-06-30 14:12:23 +02:00
|
|
|
PartitionModel* partitionModelForDevice( Device* device ) const;
|
|
|
|
|
2014-07-04 17:58:32 +02:00
|
|
|
void createPartition( Device* device, PartitionInfo* partitionInfo );
|
2014-06-30 16:17:28 +02:00
|
|
|
|
2014-07-02 15:49:35 +02:00
|
|
|
void deletePartition( Device* device, Partition* partition );
|
|
|
|
|
2014-07-02 16:06:54 +02:00
|
|
|
QList< Calamares::job_ptr > jobs() const
|
|
|
|
{
|
|
|
|
return m_jobs;
|
|
|
|
}
|
|
|
|
|
2014-06-30 13:37:46 +02:00
|
|
|
private:
|
2014-07-04 17:40:55 +02:00
|
|
|
QList< Device* > m_devices;
|
|
|
|
QHash< Device*, PartitionModel* > m_partitionModelForDeviceHash;
|
2014-06-30 13:48:40 +02:00
|
|
|
DeviceModel* m_deviceModel;
|
2014-06-30 13:37:46 +02:00
|
|
|
|
2014-07-04 17:40:55 +02:00
|
|
|
InfoForPartitionHash m_infoForPartitionHash;
|
|
|
|
|
2014-07-02 15:49:35 +02:00
|
|
|
QList< Calamares::job_ptr > m_jobs;
|
|
|
|
|
2014-06-30 13:37:46 +02:00
|
|
|
void listDevices();
|
2014-06-30 16:17:28 +02:00
|
|
|
|
2014-07-02 15:49:35 +02:00
|
|
|
void dumpQueue() const;
|
2014-06-30 13:37:46 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* PARTITIONCOREMODULE_H */
|