/*========================================================================= Library: CTK Copyright (c) 2010 Kitware Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.commontk.org/LICENSE Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. =========================================================================*/ #ifndef __ctkWorkflow_h #define __ctkWorkflow_h // Qt includes #include // CTK includes #include "ctkPimpl.h" #include "CTKCoreExport.h" class ctkWorkflowStep; class ctkWorkflowPrivate; class QAbstractState; /// \brief ctkWorkflow is the basis for a workflow engine, i.e. a state /// machine with enhancements to support ctkWorkflowStep. class CTK_CORE_EXPORT ctkWorkflow : public QObject { Q_OBJECT public: typedef QObject Superclass; explicit ctkWorkflow(QObject* parent = 0); virtual ~ctkWorkflow(); /// \brief Start the workflow. /// The workflow will always start in the initial step, even if it is stopped and restarted). /// \note Calls onEntry() for the initial step. virtual void start(); /// \brief Returns whether the workflow is currently running bool isRunning()const; /// \brief Stops the workflow. /// \note Calls onExit() for the current step. virtual void stop(); /// \brief Transition directionalities. /// /// The direction of transitions between an origin step and a destination step can be either: ///