fw4spl
ILocationDialog.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2016.
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 #ifndef __FWGUI_DIALOG_ILOCATIONDIALOG_HPP__
8 #define __FWGUI_DIALOG_ILOCATIONDIALOG_HPP__
9 
10 #include <boost/filesystem.hpp>
11 
12 #include <string>
13 
14 #include <fwData/location/ILocation.hpp>
15 #include <fwData/Composite.hpp>
16 
17 #include "fwGui/GuiBaseObject.hpp"
18 #include "fwGui/config.hpp"
19 
20 namespace fwGui
21 {
22 namespace dialog
23 {
31 class FWGUI_CLASS_API ILocationDialog : public ::fwGui::GuiBaseObject
32 {
33 
34 public:
35 
37 
38  typedef enum
39  {
40  NONE = 0,
41  READ = 1 << 1,
42  WRITE = 1 << 2,
43  FILE_MUST_EXIST = 1 << 3,
44  } Options;
45 
46  typedef enum
47  {
48  SINGLE_FILE,
49  FOLDER,
50  MULTI_FILES
51  } Types;
52 
53  typedef std::string FactoryRegistryKeyType;
54 
56  FWGUI_API static const FactoryRegistryKeyType REGISTRY_KEY;
57 
58  FWGUI_API static const std::string SOFTWARE_UI;
59  FWGUI_API static const std::string DLG_DEFAULT_LOCATION;
60 
61  FWGUI_API virtual ~ILocationDialog();
62 
63  FWGUI_API ILocationDialog();
64 
66  FWGUI_API virtual void setTitle(const std::string& title);
67 
69  FWGUI_API virtual const std::string& getTitle();
70 
72  FWGUI_API virtual void setDefaultLocation( ::fwData::location::ILocation::sptr loc);
73 
75  FWGUI_API virtual const ::boost::filesystem::path getDefaultLocation();
76 
78  FWGUI_API virtual void saveDefaultLocation(::fwData::location::ILocation::sptr loc);
79 
81  FWGUI_API virtual void setType( Types type ) = 0;
82 
84  FWGUI_API virtual ILocationDialog& setOption( Options option) = 0;
85 
92  FWGUI_API virtual void addFilter(const std::string &filterName, const std::string &wildcardList ) = 0;
93 
98  FWGUI_API virtual ::fwData::location::ILocation::sptr show() = 0;
99 
101  FWGUI_API virtual std::string getCurrentSelection() const = 0;
102 
103 protected:
104 
105  FWGUI_API void readConfig();
106 
107  FWGUI_API void writeConfig();
108 
109  FWGUI_API ::fwData::Composite::sptr getPreferenceUI();
110 
111 private:
112 
113  std::string m_title;
114  ::fwData::location::ILocation::sptr m_defaultLocaction;
115 };
116 
117 } //namespace dialog
118 } // namespace fwGui
119 
120 #endif /*__FWGUI_DIALOG_ILOCATIONDIALOG_HPP__*/
121 
122 
#define fwCoreNonInstanciableClassDefinitionsMacro(_classinfo_)
Generate common code for Non Instanciable classes (Interfaces, Abstract classes, ...)
The namespace fwGui contains the base interface for IHM services.
Definition: SJobBar.hpp:23
static FWGUI_API const FactoryRegistryKeyType REGISTRY_KEY
this unique key should be used for all factory for specific LocationDialog(qt,wx,...)
Base class for all fwGui&#39;s classes.