Medical Imaging Interaction Toolkit  2018.4.99-7e02155b
Medical Imaging Interaction Toolkit
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef MITKFILEWRITERSELECTOR_H
14 #define MITKFILEWRITERSELECTOR_H
15 
16 #include <mitkIFileWriter.h>
17 
18 #include <mitkMimeType.h>
19 
20 #include <usServiceReference.h>
21 
22 #include <string>
23 #include <vector>
24 
25 namespace mitk
26 {
27  class BaseData;
28 
30  {
31  public:
33  {
34  public:
35  Item(const Item &other);
36  ~Item();
37 
38  Item &operator=(const Item &other);
39 
40  IFileWriter *GetWriter() const;
41  std::string GetDescription() const;
42  IFileWriter::ConfidenceLevel GetConfidenceLevel() const;
43  MimeType GetMimeType() const;
44  std::string GetBaseDataType() const;
45  us::ServiceReference<IFileWriter> GetReference() const;
46  long GetServiceId() const;
47 
48  bool operator<(const Item &other) const;
49 
50  private:
51  friend class FileWriterSelector;
52 
53  Item();
54 
55  struct Impl;
57  };
58 
60  FileWriterSelector(const BaseData *baseData,
61  const std::string &destMimeType = std::string(),
62  const std::string &path = std::string());
63 
65 
66  FileWriterSelector &operator=(const FileWriterSelector &other);
67 
68  bool IsEmpty() const;
69 
84  std::vector<Item> Get(const std::string &mimeType) const;
85 
94  std::vector<Item> Get() const;
95 
96  Item Get(long id) const;
97 
98  Item GetDefault() const;
99  long GetDefaultId() const;
100 
101  Item GetSelected() const;
102  long GetSelectedId() const;
103 
104  bool Select(const std::string &mimeType);
105  bool Select(const Item &item);
106  bool Select(long id);
107 
108  std::vector<MimeType> GetMimeTypes() const;
109 
110  void Swap(FileWriterSelector &fws);
111 
112  private:
113  struct Impl;
115  };
116 
117  void swap(FileWriterSelector &fws1, FileWriterSelector &fws2);
118 }
119 
120 #endif // MITKFILEWRITERSELECTOR_H
#define MITKCORE_EXPORT
Base of all data objects.
Definition: mitkBaseData.h:42
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two var lists and returns true if the first list&#39;s first item is lower than the second one&#39;s...
DataCollection - Class to facilitate loading/accessing structured data.
ConfidenceLevel
A confidence level describing the confidence of the reader or writer in handling the given data...
Definition: mitkIFileIO.h:45
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:36
The common interface of all MITK file writers.