2020-08-25 16:05:56 +02:00
|
|
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
2020-08-10 09:53:05 +02:00
|
|
|
*
|
2020-05-30 16:15:03 +02:00
|
|
|
* SPDX-FileCopyrightText: 2017 Adriaan de Groot <groot@kde.org>
|
2020-08-10 09:53:05 +02:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2017-11-30 18:42:59 +01:00
|
|
|
*
|
2020-08-25 16:05:56 +02:00
|
|
|
* Calamares is Free Software: see the License-Identifier above.
|
2017-11-30 18:42:59 +01:00
|
|
|
*
|
2020-05-30 16:15:03 +02:00
|
|
|
*
|
2017-11-30 18:42:59 +01:00
|
|
|
*/
|
|
|
|
#ifndef CALAMARES_REQUIREMENT_H
|
|
|
|
#define CALAMARES_REQUIREMENT_H
|
|
|
|
|
2020-03-31 22:13:30 +02:00
|
|
|
#include "DllMacro.h"
|
|
|
|
|
2017-11-30 18:42:59 +01:00
|
|
|
#include <QList>
|
2019-02-24 13:32:56 +01:00
|
|
|
#include <QMetaType>
|
2017-11-30 18:42:59 +01:00
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
namespace Calamares
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An indication of a requirement, which is checked in preparation
|
2019-02-15 20:53:55 +01:00
|
|
|
* for system installation. An entry has a name and some explanation functions
|
|
|
|
* (functions, because they need to respond to translations).
|
|
|
|
*
|
|
|
|
* A requirement can be *satisfied* or not.
|
|
|
|
* A requirement can be optional (i.e. a "good to have") or mandatory.
|
|
|
|
*
|
|
|
|
* Requirements which are not satisfied, and also mandatory, will prevent the
|
|
|
|
* installation from proceeding.
|
2017-11-30 18:42:59 +01:00
|
|
|
*/
|
|
|
|
struct RequirementEntry
|
|
|
|
{
|
2019-02-15 20:53:55 +01:00
|
|
|
using TextFunction = std::function< QString() >;
|
|
|
|
|
|
|
|
/// @brief name of this requirement; not shown to user and used as ID
|
2017-11-30 18:42:59 +01:00
|
|
|
QString name;
|
2019-02-15 20:53:55 +01:00
|
|
|
|
2019-02-26 12:20:20 +01:00
|
|
|
/// @brief Detailed description of this requirement, for use in user-visible lists
|
2019-02-15 20:53:55 +01:00
|
|
|
TextFunction enumerationText;
|
|
|
|
|
2019-02-26 12:20:20 +01:00
|
|
|
/// @brief User-visible string to show that the requirement is not met, short form
|
2019-02-23 23:41:24 +01:00
|
|
|
TextFunction negatedText;
|
2019-02-15 20:53:55 +01:00
|
|
|
|
|
|
|
bool satisfied;
|
|
|
|
bool mandatory;
|
2019-02-26 12:20:20 +01:00
|
|
|
|
|
|
|
/// @brief Convenience to check if this entry should be shown in details dialog
|
|
|
|
bool hasDetails() const { return !enumerationText().isEmpty(); }
|
2017-11-30 18:42:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
using RequirementsList = QList< RequirementEntry >;
|
|
|
|
|
|
|
|
} // namespace Calamares
|
2019-02-24 13:32:56 +01:00
|
|
|
|
2019-06-27 15:15:47 +02:00
|
|
|
Q_DECLARE_METATYPE( Calamares::RequirementEntry )
|
2019-02-24 13:32:56 +01:00
|
|
|
|
2017-11-30 18:42:59 +01:00
|
|
|
#endif
|