Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkFileReaderWriterBase.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef MITKFILEREADERWRITERBASE_H
18 #define MITKFILEREADERWRITERBASE_H
19 
20 #include <mitkCustomMimeType.h>
21 #include <mitkMessage.h>
22 
23 #include <usAny.h>
24 #include <usModuleContext.h>
25 #include <usServiceRegistration.h>
26 
27 #include <memory>
28 
29 namespace mitk
30 {
32  {
33  public:
34  typedef std::map<std::string, us::Any> Options;
36 
38  virtual ~FileReaderWriterBase();
39 
40  Options GetOptions() const;
41  us::Any GetOption(const std::string &name) const;
42 
43  void SetOptions(const Options &options);
44  void SetOption(const std::string &name, const us::Any &value);
45 
46  void SetDefaultOptions(const Options &defaultOptions);
47  Options GetDefaultOptions() const;
48 
59  void SetRanking(int ranking);
60  int GetRanking() const;
61 
62  void SetMimeType(const CustomMimeType &mimeType);
63  const CustomMimeType *GetMimeType() const;
65 
67 
68  void SetMimeTypePrefix(const std::string &prefix);
69  std::string GetMimeTypePrefix() const;
70 
71  void SetDescription(const std::string &description);
72  std::string GetDescription() const;
73 
74  void AddProgressCallback(const ProgressCallback &callback);
75  void RemoveProgressCallback(const ProgressCallback &callback);
76 
78  void UnregisterMimeType();
79 
80  protected:
82 
83  std::string m_Description;
84  int m_Ranking;
85 
86  std::string m_MimeTypePrefix;
87 
93  Options m_Options;
94 
96 
97  // us::PrototypeServiceFactory* m_PrototypeFactory;
98 
100 
101  std::unique_ptr<CustomMimeType> m_CustomMimeType;
103 
104  private:
105  // purposely not implemented
106  FileReaderWriterBase &operator=(const FileReaderWriterBase &other);
107  };
108 }
109 
110 #endif // MITKFILEREADERWRITERBASE_H
us::ServiceRegistration< CustomMimeType > RegisterMimeType(us::ModuleContext *context)
void SetDefaultOptions(const Options &defaultOptions)
void RemoveProgressCallback(const ProgressCallback &callback)
void SetRanking(int ranking)
Set the service ranking for this file reader.
DataCollection - Class to facilitate loading/accessing structured data.
us::ServiceRegistration< CustomMimeType > m_MimeTypeReg
void SetMimeTypePrefix(const std::string &prefix)
void SetDescription(const std::string &description)
The CustomMimeType class represents a custom mime-type which may be registered as a service object...
void SetOptions(const Options &options)
Definition: usAny.h:163
void SetOption(const std::string &name, const us::Any &value)
mitk::MessageAbstractDelegate1< float > ProgressCallback
The MimeType class represens a registered mime-type. It is an immutable wrapper for mitk::CustomMimeT...
Definition: mitkMimeType.h:45
std::map< std::string, us::Any > Options
us::Any GetOption(const std::string &name) const
const CustomMimeType * GetMimeType() const
Options m_Options
Options supported by this reader. Set sensible default values!
void SetMimeType(const CustomMimeType &mimeType)
std::unique_ptr< CustomMimeType > m_CustomMimeType
void AddProgressCallback(const ProgressCallback &callback)