FOSSredder 0.5.0
Loading...
Searching...
No Matches
ui::ExportWorkflow Class Reference

Coordinates asynchronous exports from a read-only state snapshot. More...

#include <ExportWorkflow.h>

Inheritance diagram for ui::ExportWorkflow:
Collaboration diagram for ui::ExportWorkflow:

Classes

struct  ExportControlState

Public Types

enum  Mode { CreateMode = 0 , ProgressMode = 1 }
using StateSnapshotProvider
using ExportLogSink

Signals

void stateChanged ()
 Emitted when export workflow state changed.
void exportFinished (bool success)
 Emitted when an export finished or stopped.
void exportFailed (const QString &error)
 Emitted when an export failed.

Public Member Functions

 ExportWorkflow (StateSnapshotProvider stateSnapshotProvider, std::shared_ptr< ui::adapters::ExportAdapter > exportAdapter, std::shared_ptr< core::ports::diagnostics::IErrorReporter > errorReporter, QObject *parent=nullptr)
 Creates an export workflow backed by a snapshot provider and runner.
void setExportLogSink (ExportLogSink sink)
 Sets the sink used to save export logs through workspace commands.
bool isRunning () const noexcept
 Reports whether an export is running.
bool isPaused () const noexcept
 Reports whether the export is paused.
double progress () const noexcept
 Returns export progress.
QString phase () const
 Returns current export phase text.
QString error () const
 Returns current export error text.
int currentMode () const noexcept
 Returns the current export workflow mode.
void exportDataWithPayload (int format, const QString &path, bool includeFormulas, const QString &locale, const QVariantMap &payload, int totalSteps=1)
 Starts an export using a QML selection payload.
void clearActiveExportLog ()
 Clears the active export log selection.
void cancelExport ()
 Requests cancellation of the running export.
void pauseExport ()
 Pauses the running export.
void resumeExport ()
 Resumes the paused export.

Detailed Description

Coordinates asynchronous exports from a read-only state snapshot.

Definition at line 29 of file ExportWorkflow.h.

Member Typedef Documentation

◆ ExportLogSink

◆ StateSnapshotProvider

Member Enumeration Documentation

◆ Mode

Enumerator
CreateMode 
ProgressMode 

Definition at line 32 of file ExportWorkflow.h.

Constructor & Destructor Documentation

◆ ExportWorkflow()

ui::ExportWorkflow::ExportWorkflow ( StateSnapshotProvider stateSnapshotProvider,
std::shared_ptr< ui::adapters::ExportAdapter > exportAdapter,
std::shared_ptr< core::ports::diagnostics::IErrorReporter > errorReporter,
QObject * parent = nullptr )
explicit

Creates an export workflow backed by a snapshot provider and runner.

Parameters
stateSnapshotProviderProvider for the current workspace snapshot.
exportAdapterAdapter used to invoke the core export runner.
errorReporterError reporter used for workflow diagnostics.
parentOptional Qt parent.

Definition at line 85 of file ExportWorkflow.cpp.

Member Function Documentation

◆ cancelExport()

void ui::ExportWorkflow::cancelExport ( )

Requests cancellation of the running export.

Definition at line 374 of file ExportWorkflow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ clearActiveExportLog()

void ui::ExportWorkflow::clearActiveExportLog ( )

Clears the active export log selection.

Definition at line 170 of file ExportWorkflow.cpp.

Here is the call graph for this function:

◆ currentMode()

int ui::ExportWorkflow::currentMode ( ) const
noexcept

Returns the current export workflow mode.

Returns
CreateMode or ProgressMode.

Definition at line 108 of file ExportWorkflow.cpp.

◆ error()

QString ui::ExportWorkflow::error ( ) const
inline

Returns current export error text.

Returns
Error text or empty.

Definition at line 79 of file ExportWorkflow.h.

Here is the caller graph for this function:

◆ exportDataWithPayload()

void ui::ExportWorkflow::exportDataWithPayload ( int format,
const QString & path,
bool includeFormulas,
const QString & locale,
const QVariantMap & payload,
int totalSteps = 1 )

Starts an export using a QML selection payload.

Parameters
formatQML export format index.
pathOutput path.
includeFormulasWhether formulas should be included.
localeExport locale.
payloadSelected export objects.
totalStepsTotal UI progress steps.

Definition at line 219 of file ExportWorkflow.cpp.

Here is the call graph for this function:

◆ exportFailed

void ui::ExportWorkflow::exportFailed ( const QString & error)
signal

Emitted when an export failed.

Parameters
errorError message.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ exportFinished

void ui::ExportWorkflow::exportFinished ( bool success)
signal

Emitted when an export finished or stopped.

Parameters
successTrue when the export completed successfully.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isPaused()

bool ui::ExportWorkflow::isPaused ( ) const
inlinenoexcept

Reports whether the export is paused.

Returns
True while paused.

Definition at line 67 of file ExportWorkflow.h.

◆ isRunning()

bool ui::ExportWorkflow::isRunning ( ) const
inlinenoexcept

Reports whether an export is running.

Returns
True while running.

Definition at line 63 of file ExportWorkflow.h.

◆ pauseExport()

void ui::ExportWorkflow::pauseExport ( )

Pauses the running export.

Definition at line 385 of file ExportWorkflow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ phase()

QString ui::ExportWorkflow::phase ( ) const
inline

Returns current export phase text.

Returns
Phase text.

Definition at line 75 of file ExportWorkflow.h.

◆ progress()

double ui::ExportWorkflow::progress ( ) const
inlinenoexcept

Returns export progress.

Returns
Progress in the range 0..1.

Definition at line 71 of file ExportWorkflow.h.

◆ resumeExport()

void ui::ExportWorkflow::resumeExport ( )

Resumes the paused export.

Definition at line 396 of file ExportWorkflow.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setExportLogSink()

void ui::ExportWorkflow::setExportLogSink ( ExportLogSink sink)

Sets the sink used to save export logs through workspace commands.

Parameters
sinkExport log sink callback.

Definition at line 104 of file ExportWorkflow.cpp.

◆ stateChanged

void ui::ExportWorkflow::stateChanged ( )
signal

Emitted when export workflow state changed.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: