CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
ctkWorkflowButtonBoxWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Library: CTK
4 
5  Copyright (c) Kitware Inc.
6 
7  Licensed under the Apache License, Version 2.0 (the "License");
8  you may not use this file except in compliance with the License.
9  You may obtain a copy of the License at
10 
11  http://www.apache.org/licenses/LICENSE-2.0.txt
12 
13  Unless required by applicable law or agreed to in writing, software
14  distributed under the License is distributed on an "AS IS" BASIS,
15  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  See the License for the specific language governing permissions and
17  limitations under the License.
18 
19 =========================================================================*/
20 
21 #ifndef __ctkWorkflowButtonBoxWidget_h
22 #define __ctkWorkflowButtonBoxWidget_h
23 
24 // QT includes
25 #include <QBoxLayout>
26 #include <QWidget>
27 
28 // CTK includes
29 #include "ctkPimpl.h"
30 #include "ctkWidgetsExport.h"
31 class ctkPushButton;
32 class ctkWorkflow;
33 class ctkWorkflowStep;
34 
35 class ctkWorkflowButtonBoxWidgetPrivate;
36 
49 
50 class CTK_WIDGETS_EXPORT ctkWorkflowButtonBoxWidget : public QWidget
51 {
52  Q_OBJECT
53 
58  Q_PROPERTY(QString backButtonFormat
59  READ backButtonFormat WRITE setBackButtonFormat)
60 
61 
65  Q_PROPERTY(QString nextButtonFormat
66  READ nextButtonFormat WRITE setNextButtonFormat)
67 
68 
73  Q_PROPERTY(QString goToButtonsFormat
74  READ goToButtonsFormat WRITE setGoToButtonsFormat)
75 
76 
79  Q_PROPERTY(bool hideGoToButtons READ hideGoToButtons WRITE setHideGoToButtons)
80 
81 
84  Q_PROPERTY(bool hideInvalidButtons READ hideInvalidButtons WRITE setHideInvalidButtons)
85 
86 public:
87  typedef QWidget Superclass;
88  explicit ctkWorkflowButtonBoxWidget(ctkWorkflow* newWorkflow, QWidget* newParent = 0);
89  explicit ctkWorkflowButtonBoxWidget(QWidget* newParent = 0);
91 
94 
96  void setWorkflow(ctkWorkflow * newWorkflow);
97 
99  Q_INVOKABLE ctkPushButton* backButton()const;
100 
103  QString backButtonFormat()const;
104 
107  void setBackButtonFormat(const QString& format);
108 
110  Q_INVOKABLE ctkPushButton* nextButton()const;
111 
114  QString nextButtonFormat()const;
115 
118  void setNextButtonFormat(const QString& format);
119 
122  QString goToButtonsFormat()const;
123 
126  void setGoToButtonsFormat(const QString& format);
127 
130 
133  QBoxLayout::Direction direction()const;
134  void setDirection(const QBoxLayout::Direction& newDirection);
135 
138  bool hideGoToButtons()const;
141  void setHideGoToButtons(bool hide);
142 
145  bool hideInvalidButtons()const;
146  void setHideInvalidButtons(bool newHide);
147 
148 public Q_SLOTS:
151  virtual void updateButtons(ctkWorkflowStep* currentStep);
152 
153 protected Q_SLOTS:
156  virtual void prepareGoToStep();
157 
158 protected:
159  QScopedPointer<ctkWorkflowButtonBoxWidgetPrivate> d_ptr;
160 
161 private:
162  Q_DECLARE_PRIVATE(ctkWorkflowButtonBoxWidget);
163  Q_DISABLE_COPY(ctkWorkflowButtonBoxWidget);
164 
165 };
166 
167 #endif
168 
A widget that controls a workflow.
QBoxLayout::Direction direction() const
void setDirection(const QBoxLayout::Direction &newDirection)
QString nextButtonFormat() const
virtual ~ctkWorkflowButtonBoxWidget()
QString backButtonFormat() const
Q_INVOKABLE ctkPushButton * nextButton() const
Get the 'next' button.
QString goToButtonsFormat() const
void setWorkflow(ctkWorkflow *newWorkflow)
Set the workflow associated with the widget.
void setNextButtonFormat(const QString &format)
ctkWorkflowButtonBoxWidget(QWidget *newParent=0)
virtual void updateButtons(ctkWorkflowStep *currentStep)
void setHideInvalidButtons(bool newHide)
ctkWorkflowButtonBoxWidget(ctkWorkflow *newWorkflow, QWidget *newParent=0)
void setBackButtonFormat(const QString &format)
virtual void prepareGoToStep()
void setGoToButtonsFormat(const QString &format)
QScopedPointer< ctkWorkflowButtonBoxWidgetPrivate > d_ptr
bool hideInvalidButtons() const
QList< ctkPushButton * > goToButtons() const
Get a list of the 'goTo' buttons.
ctkWorkflow * workflow() const
Get the workflow associated with the widget.
void setHideGoToButtons(bool hide)
Q_INVOKABLE ctkPushButton * backButton() const
Get the 'back' button.
ctkWorkflowStep is the basis for a workflow step.
ctkWorkflow is the basis for a workflow engine, i.e. a state machine with enhancements to support ctk...
Definition: ctkWorkflow.h:40