ctkExampleDerivedWorkflowStep.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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 __ctkExampleDerivedWorkflowStep_h
  15. #define __ctkExampleDerivedWorkflowStep_h
  16. // CTK includes
  17. #include "ctkPimpl.h"
  18. #include "ctkWorkflowStep.h"
  19. #include "ctkWorkflowTransitions.h"
  20. class ctkExampleDerivedWorkflowStepPrivate;
  21. ///
  22. /// ctkExampleDerivedWorkflowStep is an example custom step created by
  23. /// deriving ctkWorkflowStep and re-implementing validate(const QString&),
  24. /// onEntry() and onExit().
  25. class ctkExampleDerivedWorkflowStep : public ctkWorkflowStep
  26. {
  27. public:
  28. typedef ctkWorkflowStep Superclass;
  29. explicit ctkExampleDerivedWorkflowStep(const QString& newId);
  30. virtual ~ctkExampleDerivedWorkflowStep();
  31. /// Get the values for the counters of the number of times we have
  32. /// run the onEntry() and onExit() functions
  33. virtual int numberOfTimesRanOnEntry()const;
  34. virtual int numberOfTimesRanOnExit()const;
  35. virtual void validate(const QString& desiredBranchId = QString());
  36. /// Increments the counter numberOfTimesRanOnEntry
  37. virtual void onEntry(const ctkWorkflowStep* comingFrom,
  38. const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType);
  39. /// Increments the counter numberOfTimesRanOnExit
  40. virtual void onExit(const ctkWorkflowStep* goingTo,
  41. const ctkWorkflowInterstepTransition::InterstepTransitionType transitionType);
  42. protected:
  43. QScopedPointer<ctkExampleDerivedWorkflowStepPrivate> d_ptr;
  44. private:
  45. Q_DECLARE_PRIVATE(ctkExampleDerivedWorkflowStep);
  46. Q_DISABLE_COPY(ctkExampleDerivedWorkflowStep);
  47. };
  48. #endif