Medical Imaging Interaction Toolkit  2023.12.99-b884b24c
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
mitk::swap
void swap(CustomMimeType &l, CustomMimeType &r)
mitk::modelFit::operator<
bool operator<(const StaticParameterMap::ValueType &a, const StaticParameterMap::ValueType &b)
Compares two var lists and returns true if the first list's first item is lower than the second one's...
Definition: mitkModelFitStaticParameterMap.h:139
us::ExplicitlySharedDataPointer< Impl >
mitk::FileWriterSelector::Item
Definition: mitkFileWriterSelector.h:32
mitkMimeType.h
mitk::FileWriterSelector
Definition: mitkFileWriterSelector.h:29
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
us::ServiceReference
Definition: usModule.h:40
mitk::IFileWriter
The common interface of all MITK file writers.
Definition: mitkIFileWriter.h:56
mitkIFileWriter.h
usServiceReference.h
mitk::BaseData
Base of all data objects.
Definition: mitkBaseData.h:42
mitk::MitkMultilabelIOMimeTypes::Get
MITKMULTILABELIO_EXPORT std::vector< CustomMimeType * > Get()
mitk::IFileIO::ConfidenceLevel
ConfidenceLevel
A confidence level describing the confidence of the reader or writer in handling the given data.
Definition: mitkIFileIO.h:45
MITKCORE_EXPORT
#define MITKCORE_EXPORT
Definition: MitkCoreExports.h:15
us::SharedDataPointer< Impl >
mitk::MimeType
The MimeType class represens a registered mime-type. It is an immutable wrapper for mitk::CustomMimeT...
Definition: mitkMimeType.h:36