PartDesignGui::WorkflowManager Class Reference

This class controls the workflow of each file. More...

#include <WorkflowManager.h>

Public Member Functions

Workflow determineWorkflow (App::Document *doc)
 Asserts the workflow of the document to be determined and prompt user to migrate if it is not modern. More...
 
void forceWorkflow (const App::Document *doc, Workflow wf)
 Force the desired workflow in document. More...
 
Workflow getWorkflowForDocument (App::Document *doc)
 Lookup the workflow of the document in the map. More...
 
virtual ~WorkflowManager ()
 

Init, Destruct an Access methods

static void init ()
 Creates an instance of the manager, should be called before any instance() More...
 
static WorkflowManagerinstance ()
 Return an instance of the WorkflofManager. More...
 
static void destruct ()
 destroy the manager More...
 

Detailed Description

This class controls the workflow of each file.

It has been introduced to support legacy files migrating to the new workflow.

Constructor & Destructor Documentation

◆ ~WorkflowManager()

WorkflowManager::~WorkflowManager ( )
virtual

Member Function Documentation

◆ destruct()

void WorkflowManager::destruct ( void  )
static

destroy the manager

Referenced by PartDesignGui::Workbench::~Workbench().

◆ determineWorkflow()

Workflow WorkflowManager::determineWorkflow ( App::Document doc)

Asserts the workflow of the document to be determined and prompt user to migrate if it is not modern.

If workflow was already chosen return it. If the guesed workflow is Workflow::Legacy or Workflow::Mixed the user will be prompted to migrate. If the user agrees the file will be migrated and the workflow will be set as modern. If the user refuses to migrate use the old workflow.

References Gui::Application::commandManager(), Gui::getMainWindow(), getWorkflowForDocument(), Gui::Application::Instance, PartDesignGui::Legacy, PartDesignGui::Modern, Gui::CommandManager::runCommandByName(), and PartDesignGui::Undetermined.

Referenced by PartDesignGui::assureLegacyWorkflow(), and PartDesignGui::assureModernWorkflow().

◆ forceWorkflow()

void WorkflowManager::forceWorkflow ( const App::Document doc,
Workflow  wf 
)

Force the desired workflow in document.

◆ getWorkflowForDocument()

Workflow WorkflowManager::getWorkflowForDocument ( App::Document doc)

Lookup the workflow of the document in the map.

If the document not in the map yet return Workflow::Undetermined.

References PartDesignGui::Undetermined.

Referenced by determineWorkflow(), PartDesignGui::isLegacyWorkflow(), and PartDesignGui::isModernWorkflow().

◆ init()

void WorkflowManager::init ( void  )
static

Creates an instance of the manager, should be called before any instance()

Referenced by PartDesignGui::Workbench::activated(), instance(), and DocumentObject.DocumentObject::onChanged().

◆ instance()

WorkflowManager * WorkflowManager::instance ( void  )
static

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