fw4spl
SIOSelector.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-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 "uiIO/config.hpp"
10 
11 #include <fwCom/Signal.hpp>
12 #include <fwCom/Slot.hpp>
13 
14 #include <fwGui/editor/IDialogEditor.hpp>
15 
16 #include <fwJobs/IJob.hpp>
17 
18 namespace uiIO
19 {
20 namespace editor
21 {
22 
73 class UIIO_CLASS_API SIOSelector : public ::fwGui::editor::IDialogEditor
74 {
75 
76 public:
77 
79  typedef enum
80  {
82  WRITER_MODE
83  } IOMode;
84 
86 
87  typedef ::fwCom::Signal< void ( ::fwJobs::IJob::sptr ) > JobCreatedSignalType;
88  typedef ::fwCom::Slot< void ( ::fwJobs::IJob::sptr ) > ForwardJobSlotType;
89 
95  UIIO_API SIOSelector();
96 
98  UIIO_API virtual ~SIOSelector() noexcept;
99 
105  UIIO_API void setIOMode( IOMode _mode );
106 
107 protected:
108 
110  UIIO_API void starting() override;
111 
113  UIIO_API void stopping() override;
114 
121  UIIO_API void configuring() override;
122 
124  // objects. Then, the selected reader (writer) is executed.
125  UIIO_API void updating() override;
126 
128  UIIO_API void info( std::ostream& _sstream ) override;
129 
130 private:
131 
132  void forwardJob(::fwJobs::IJob::sptr iJob);
133 
135  IOMode m_mode;
136 
138  bool m_servicesAreExcluded;
139 
145  std::vector< std::string > m_selectedServices;
146 
148  std::map< std::string, std::string > m_serviceToConfig;
149 
151  std::string m_dataClassname;
152 
153  SPTR(JobCreatedSignalType) m_sigJobCreated;
154  SPTR(ForwardJobSlotType) m_slotForwardJob;
155 
156 };
157 
158 } // namespace editor
159 
160 } // namespace uiIO
#define SPTR(_cls_)
STL namespace.
IOMode
IOMode enum definition.
Definition: SIOSelector.hpp:79
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Defines the service interface managing the editor service which create their own container.
This service displays a list of available readers or writers and lets you select one to load or save ...
Definition: SIOSelector.hpp:73
This namespace fwJobs provides jobs management.
The namespace uiIO contains a simple service to manipulate IO with IHM..