fw4spl
SActivityLauncher.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 "activities/config.hpp"
10 
11 #include <fwActivities/registry/Activities.hpp>
12 #include <fwActivities/registry/ActivityMsg.hpp>
13 
14 #include <fwData/Vector.hpp>
15 
16 #include <fwGui/IActionSrv.hpp>
17 
18 #include <fwRuntime/ConfigurationElement.hpp>
19 #include <fwRuntime/EConfigurationElement.hpp>
20 
21 namespace activities
22 {
23 namespace action
24 {
25 
114 class ACTIVITIES_CLASS_API SActivityLauncher : public ::fwGui::IActionSrv
115 {
116 
117 public:
118 
120 
122  ACTIVITIES_API SActivityLauncher() noexcept;
123 
125  ACTIVITIES_API virtual ~SActivityLauncher() noexcept;
126 
131  ACTIVITIES_API static const ::fwCom::Slots::SlotKeyType s_LAUNCH_SERIES_SLOT;
132  ACTIVITIES_API static const ::fwCom::Slots::SlotKeyType s_LAUNCH_ACTIVITY_SERIES_SLOT;
133  ACTIVITIES_API static const ::fwCom::Slots::SlotKeyType s_UPDATE_STATE_SLOT;
135 
140  typedef ::fwCom::Signal< void ( ::fwActivities::registry::ActivityMsg ) > ActivityLaunchedSignalType;
141 
143  ACTIVITIES_API static const ::fwCom::Signals::SignalKeyType s_ACTIVITY_LAUNCHED_SIG;
145 
153  ACTIVITIES_API virtual KeyConnectionsType getObjSrvConnections() const override;
154 
155 protected:
156 
164  ACTIVITIES_API virtual KeyConnectionsMap getAutoConnections() const override;
165 
167  virtual void starting() override;
168 
170  virtual void stopping() override;
171 
175  virtual void updating() override;
176 
181  virtual void configuring() override;
182 
183  typedef ::fwActivities::registry::ActivityAppConfig::ActivityAppConfigParamsType ParametersType;
184 
185  typedef std::vector< std::string > KeysType;
186 
187  typedef std::map< std::string, std::string > QuickLaunchType;
188 
190  virtual void updateState();
191 
195  ParametersType translateParameters( const ParametersType& parameters);
196 
197 private:
198 
203  bool launchAS(const ::fwData::Vector::csptr& selection);
204 
212  void launchSeries(::fwMedData::Series::sptr series);
213 
218  void launchActivitySeries(::fwMedData::ActivitySeries::sptr series);
219 
227  void sendConfig( const ::fwActivities::registry::ActivityInfo& info );
228 
235  void buildActivity(const ::fwActivities::registry::ActivityInfo& info, const ::fwData::Vector::csptr& selection);
236 
237  typedef ::fwActivities::registry::Activities::ActivitiesType ActivityInfoContainer;
238 
240  ::fwActivities::registry::ActivityInfo show( const ActivityInfoContainer& infos );
241 
243  ActivityInfoContainer getEnabledActivities(const ActivityInfoContainer& infos);
244 
245  ParametersType m_parameters;
246 
251  std::string m_filterMode;
252 
254  KeysType m_keys;
255 
257  ActivityLaunchedSignalType::sptr m_sigActivityLaunched;
258 
260  std::string m_mode;
261 
263  QuickLaunchType m_quickLaunch;
264 };
265 
266 } //action
267 } // gui
Contains fwAtomsFilter::registry details.
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
Namespace containing medical data.
Namespace containing fw4spl communication tools.
Definition: DumpEditor.hpp:30
STL namespace.
Defines the service interface managing the menu items.
Definition: IActionSrv.hpp:24
This action launchs an activity according to the selected data.
The namespace activities contains helpers and services allowing to launch activities.
::fwCom::helper::SigSlotConnection::KeyConnectionsType KeyConnectionsType
Returns proposals to connect service slots to associated object signals, this method is used for obj/...
Definition: IService.hpp:449
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
Namespace containing activities data and builder.
Contains the representation of the data objects used in the framework.