ctkWorkflowStep_p.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. /*=========================================================================
  2. Library: CTK
  3. Copyright (c) Kitware Inc.
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0.txt
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. =========================================================================*/
  14. #ifndef __ctkWorkflowStep_p_h
  15. #define __ctkWorkflowStep_p_h
  16. // Qt includes
  17. #include <QObject>
  18. class QString;
  19. class QState;
  20. // CTK includes
  21. #include <ctkPimpl.h>
  22. #include "ctkWorkflow.h"
  23. #include "ctkWorkflowStep.h"
  24. #include "ctkWorkflowTransitions.h"
  25. #include "ctkCoreExport.h"
  26. class ctkWorkflow;
  27. //-----------------------------------------------------------------------------
  28. /**
  29. * \ingroup Core
  30. */
  31. class CTK_CORE_EXPORT ctkWorkflowStepPrivate: public QObject
  32. {
  33. Q_OBJECT
  34. Q_DECLARE_PUBLIC(ctkWorkflowStep);
  35. public:
  36. ctkWorkflowStep* q_ptr;
  37. ctkWorkflowStepPrivate(ctkWorkflowStep& object);
  38. ~ctkWorkflowStepPrivate();
  39. protected:
  40. ctkWorkflow* Workflow;
  41. QString Id;
  42. QString Name;
  43. QString Description;
  44. QString StatusText;
  45. QState* ProcessingState;
  46. QState* ValidationState;
  47. ctkWorkflowIntrastepTransition* ValidationTransition;
  48. ctkWorkflowIntrastepTransition* ValidationFailedTransition;
  49. bool HasValidateCommand;
  50. bool HasOnEntryCommand;
  51. bool HasOnExitCommand;
  52. void invokeValidateCommandInternal(const QString& desiredBranchId)const;
  53. void validationCompleteInternal(bool validationSuceeded, const QString& branchId)const;
  54. void invokeOnEntryCommandInternal(const ctkWorkflowStep* comingFrom, const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType)const;
  55. void onEntryCompleteInternal()const;
  56. void invokeOnExitCommandInternal(const ctkWorkflowStep* goingTo, const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType)const;
  57. void onExitCompleteInternal()const;
  58. signals:
  59. void invokeValidateCommand(const QString& desiredBranchId)const;
  60. void validationComplete(bool validationSuceeded, const QString& branchId)const;
  61. void invokeOnEntryCommand(const ctkWorkflowStep* comingFrom, const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType)const;
  62. void onEntryComplete()const;
  63. void invokeOnExitCommand(const ctkWorkflowStep* goingTo, const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType)const;
  64. void onExitComplete()const;
  65. private:
  66. friend class ctkWorkflowPrivate; // for access to invoke...Internal() methods
  67. };
  68. #endif