Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkFileWriterSelector.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 MITKFILEWRITERSELECTOR_H
18 #define MITKFILEWRITERSELECTOR_H
19 
20 #include <mitkIFileWriter.h>
21 
22 #include <mitkMimeType.h>
23 
24 #include <usServiceReference.h>
25 
26 #include <string>
27 #include <vector>
28 
29 namespace mitk
30 {
31  class BaseData;
32 
34  {
35  public:
37  {
38  public:
39  Item(const Item &other);
40  ~Item();
41 
42  Item &operator=(const Item &other);
43 
44  IFileWriter *GetWriter() const;
45  std::string GetDescription() const;
46  IFileWriter::ConfidenceLevel GetConfidenceLevel() const;
47  MimeType GetMimeType() const;
48  std::string GetBaseDataType() const;
49  us::ServiceReference<IFileWriter> GetReference() const;
50  long GetServiceId() const;
51 
52  bool operator<(const Item &other) const;
53 
54  private:
55  friend class FileWriterSelector;
56 
57  Item();
58 
59  struct Impl;
61  };
62 
64  FileWriterSelector(const BaseData *baseData,
65  const std::string &destMimeType = std::string(),
66  const std::string &path = std::string());
67 
69 
70  FileWriterSelector &operator=(const FileWriterSelector &other);
71 
72  bool IsEmpty() const;
73 
88  std::vector<Item> Get(const std::string &mimeType) const;
89 
98  std::vector<Item> Get() const;
99 
100  Item Get(long id) const;
101 
102  Item GetDefault() const;
103  long GetDefaultId() const;
104 
105  Item GetSelected() const;
106  long GetSelectedId() const;
107 
108  bool Select(const std::string &mimeType);
109  bool Select(const Item &item);
110  bool Select(long id);
111 
112  std::vector<MimeType> GetMimeTypes() const;
113 
114  void Swap(FileWriterSelector &fws);
115 
116  private:
117  struct Impl;
119  };
120 
121  void swap(FileWriterSelector &fws1, FileWriterSelector &fws2);
122 }
123 
124 #endif // MITKFILEWRITERSELECTOR_H
#define MITKCORE_EXPORT
Base of all data objects.
Definition: mitkBaseData.h:39
DataCollection - Class to facilitate loading/accessing structured data.
void swap(CustomMimeType &l, CustomMimeType &r)
The MimeType class represens a registered mime-type. It is an immutable wrapper for mitk::CustomMimeT...
Definition: mitkMimeType.h:45
ConfidenceLevel
A confidence level describing the confidence of the reader or writer in handling the given data...
Definition: mitkIFileIO.h:49
The common interface of all MITK file writers.