Plan export start decisions in app core
This commit is contained in:
@@ -26,6 +26,26 @@ struct DocumentExportSuggestedName {
|
||||
std::string name;
|
||||
};
|
||||
|
||||
enum class DocumentExportStartDecision {
|
||||
start_now,
|
||||
show_license_disabled,
|
||||
unavailable_no_canvas,
|
||||
};
|
||||
|
||||
[[nodiscard]] constexpr DocumentExportStartDecision plan_document_export_start(
|
||||
bool requires_license,
|
||||
bool license_valid,
|
||||
bool has_canvas) noexcept
|
||||
{
|
||||
if (requires_license && !license_valid) {
|
||||
return DocumentExportStartDecision::show_license_disabled;
|
||||
}
|
||||
|
||||
return has_canvas
|
||||
? DocumentExportStartDecision::start_now
|
||||
: DocumentExportStartDecision::unavailable_no_canvas;
|
||||
}
|
||||
|
||||
[[nodiscard]] inline pp::foundation::Result<DocumentExportFileTarget> make_document_export_file_target(
|
||||
std::string_view work_directory,
|
||||
std::string_view document_name,
|
||||
|
||||
Reference in New Issue
Block a user