fw4spl
SActivityWizard.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2016-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "uiMedDataQt/config.hpp"
10 #include "uiMedDataQt/widget/ActivityDataView.hpp"
11 
12 #include <fwActivities/registry/Activities.hpp>
13 
14 #include <fwCom/Signal.hpp>
15 #include <fwCom/Signals.hpp>
16 #include <fwCom/Slot.hpp>
17 #include <fwCom/Slots.hpp>
18 
19 #include <fwData/Vector.hpp>
20 
21 #include <fwGui/editor/IEditor.hpp>
22 
23 #include <fwMedData/ActivitySeries.hpp>
24 #include <fwMedData/SeriesDB.hpp>
25 
26 #include <fwRuntime/ConfigurationElement.hpp>
27 #include <fwRuntime/EConfigurationElement.hpp>
28 
29 #include <QLabel>
30 #include <QPointer>
31 #include <QPushButton>
32 
33 namespace uiMedDataQt
34 {
35 namespace editor
36 {
37 
91 class UIMEDDATAQT_CLASS_API SActivityWizard : public QObject,
93 {
94 
95 public:
96 
98 
100  UIMEDDATAQT_API SActivityWizard() noexcept;
101 
103  UIMEDDATAQT_API virtual ~SActivityWizard() noexcept;
104 
109  UIMEDDATAQT_API static const ::fwCom::Slots::SlotKeyType s_CREATE_ACTIVITY_SLOT;
110  UIMEDDATAQT_API static const ::fwCom::Slots::SlotKeyType s_UPDATE_ACTIVITY_SLOT;
111  UIMEDDATAQT_API static const ::fwCom::Slots::SlotKeyType s_UPDATE_ACTIVITY_SERIES_SLOT;
113 
118  UIMEDDATAQT_API static const ::fwCom::Signals::SignalKeyType s_ACTIVITY_CREATED_SIG;
119  typedef ::fwCom::Signal< void ( ::fwMedData::ActivitySeries::sptr ) > ActivityCreatedSignalType;
120 
121  UIMEDDATAQT_API static const ::fwCom::Signals::SignalKeyType s_ACTIVITY_UPDATED_SIG;
122  typedef ::fwCom::Signal< void ( ::fwMedData::ActivitySeries::sptr ) > ActivityUpdatedSignalType;
123 
124  UIMEDDATAQT_API static const ::fwCom::Signals::SignalKeyType s_CANCELED_SIG;
125  typedef ::fwCom::Signal< void () > CanceledSignalType;
127 
128 protected:
129 
131  virtual void starting() override;
132 
134  virtual void stopping() override;
135 
137  virtual void updating() override;
138 
140  virtual void configuring() override;
141 
142 private:
143 
144  enum class Mode : std::uint8_t
145  {
146  CREATE,
147  UPDATE
148  };
149 
151  void createActivity(std::string activityID);
152 
154  void updateActivity(::fwMedData::ActivitySeries::sptr activitySeries);
155 
157 
162  void updateActivitySeries(::fwMedData::Series::sptr series);
163 
170  void onBuildActivity();
171 
173  void onTabChanged(int index);
174 
176  void onReset();
177 
179  void onCancel();
180 
181  ::fwMedData::ActivitySeries::sptr m_actSeries;
182 
183  QPointer<widget::ActivityDataView> m_activityDataView;
184  QPointer<QPushButton> m_okButton;
185  QPointer<QPushButton> m_resetButton;
186  QPointer<QPushButton> m_cancelButton;
187  QPointer<QLabel> m_title;
188  QPointer<QLabel> m_description;
189 
190  std::string m_ioSelectorConfig;
191  std::string m_sdbIoSelectorConfig;
192 
193  widget::ActivityDataView::ObjectIconMapType m_objectIcons;
194 
195  Mode m_mode;
196 
197  bool m_confirmUpdate;
198  bool m_isCancelable;
199 
200  ActivityCreatedSignalType::sptr m_sigActivityCreated;
201  ActivityCreatedSignalType::sptr m_sigActivityUpdated;
202  CanceledSignalType::sptr m_sigCanceled;
203 
204 };
205 
206 } //editor
207 } // uiMedDataQt
The namespace uiMedDataQt contains editors for medical data.
Namespace containing medical data.
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
This editor allows to select the data required by an activity in order to create the ActivitySeries...
STL namespace.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.