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
mitkFileReaderSelector.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 MITKFILEREADERSELECTOR_H
18 #define MITKFILEREADERSELECTOR_H
19 
20 #include <mitkIFileReader.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  IFileReader *GetReader() const;
45  std::string GetDescription() const;
46  IFileReader::ConfidenceLevel GetConfidenceLevel() const;
47  MimeType GetMimeType() const;
48  us::ServiceReference<IFileReader> GetReference() const;
49  long GetServiceId() const;
50 
51  bool operator<(const Item &other) const;
52 
53  private:
54  friend class FileReaderSelector;
55 
56  Item();
57 
58  struct Impl;
60  };
61 
63  FileReaderSelector(const std::string &path);
64 
66 
67  FileReaderSelector &operator=(const FileReaderSelector &other);
68 
69  bool IsEmpty() const;
70 
71  std::vector<MimeType> GetMimeTypes() const;
72 
87  std::vector<Item> Get() const;
88 
89  Item Get(long id) const;
90 
91  Item GetDefault() const;
92  long GetDefaultId() const;
93 
94  Item GetSelected() const;
95  long GetSelectedId() const;
96 
97  bool Select(const Item &item);
98  bool Select(long id);
99 
100  void Swap(FileReaderSelector &fws);
101 
102  private:
103  struct Impl;
105  };
106 
107  void swap(FileReaderSelector &fws1, FileReaderSelector &fws2);
108 }
109 
110 #endif // MITKFILEREADERSELECTOR_H
#define MITKCORE_EXPORT
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 for all MITK file readers.