ctkWidgetsPythonQtDecorators.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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 __ctkWidgetsPythonQtDecorators_h
  15. #define __ctkWidgetsPythonQtDecorators_h
  16. // Qt includes
  17. #include <QObject>
  18. // PythonQt includes
  19. #include <PythonQt.h>
  20. // CTK includes
  21. #include <ctkWorkflowWidgetStep.h>
  22. #include "ctkWidgetsExport.h"
  23. // NOTE:
  24. //
  25. // For decorators it is assumed that the methods will never be called
  26. // with the self argument as NULL. The self argument is the first argument
  27. // for non-static methods.
  28. //
  29. class CTK_WIDGETS_EXPORT ctkWidgetsPythonQtDecorators : public QObject
  30. {
  31. Q_OBJECT
  32. public:
  33. ctkWidgetsPythonQtDecorators()
  34. {
  35. PythonQt::self()->addParentClass("ctkWorkflowWidgetStep", "ctkWorkflowStep",
  36. PythonQtUpcastingOffset<ctkWorkflowWidgetStep,ctkWorkflowStep>());
  37. }
  38. public slots:
  39. bool hasCreateUserInterfaceCommand(ctkWorkflowWidgetStep* step)const
  40. {
  41. return step->hasCreateUserInterfaceCommand();
  42. }
  43. void setHasCreateUserInterfaceCommand(
  44. ctkWorkflowWidgetStep* step, bool newHasCreateUserInterfaceCommand)
  45. {
  46. step->setHasCreateUserInterfaceCommand(newHasCreateUserInterfaceCommand);
  47. }
  48. bool hasShowUserInterfaceCommand(ctkWorkflowWidgetStep* step)const
  49. {
  50. return step->hasShowUserInterfaceCommand();
  51. }
  52. void setHasShowUserInterfaceCommand(
  53. ctkWorkflowWidgetStep* step, bool newHasShowUserInterfaceCommand)
  54. {
  55. step->setHasShowUserInterfaceCommand(newHasShowUserInterfaceCommand);
  56. }
  57. };
  58. #endif