Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
berryIEditorRegistry.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 MITKIEDITORREGISTRY_H_
14 #define MITKIEDITORREGISTRY_H_
15 
16 
17 #include "berryIEditorDescriptor.h"
19 
20 namespace berry {
21 
49 
53  static const int PROP_CONTENTS; // = 0x01;
54 
65  static const QString SYSTEM_EXTERNAL_EDITOR_ID; // = "org.blueberry.ui.systemExternalEditor";
66 
77  static const QString SYSTEM_INPLACE_EDITOR_ID; // = "org.blueberry.ui.systemInPlaceEditor";
78 
79  /*
80  * Adds a listener for changes to properties of this registry.
81  * Has no effect if an identical listener is already registered.
82  * <p>
83  * The properties ids are as follows:
84  * <ul>
85  * <li><code>PROP_CONTENTS</code>: Triggered when the file editor mappings in
86  * the editor registry change.</li>
87  * </ul>
88  * </p>
89  *
90  * @param listener a property listener
91  */
92  // virtual void AddPropertyListener(IPropertyListener listener) = 0;
93 
94  virtual ~IEditorRegistry();
95 
103  virtual IEditorDescriptor::Pointer FindEditor(const QString& editorId) = 0;
104 
113  virtual IEditorDescriptor::Pointer GetDefaultEditor() = 0;
114 
128  virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName) = 0;
129 
130  /*
131  * Returns the default editor for a given file name and with the given content type.
132  * <p>
133  * The default editor is determined by taking the file extension for the
134  * file and obtaining the default editor for that extension.
135  * </p>
136  *
137  * @param fileName the file name in the system
138  * @param contentType the content type or <code>null</code> for the unknown content type
139  * @return the descriptor of the default editor, or <code>null</code> if not
140  * found
141  * @since 3.1
142  */
143  //virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName, IContentType contentType) = 0;
144 
158  virtual QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName) = 0;
159 
160  /*
161  * Returns the list of file editors registered to work against the file with
162  * the given file name and with the given content type.
163  * <p>
164  * Note: Use <code>getDefaultEditor(String)</code> if you only the need
165  * the default editor rather than all candidate editors.
166  * </p>
167  *
168  * @param fileName
169  * the file name in the system
170  * @param contentType
171  * the content type or <code>null</code> for the unknown
172  * content type
173  * @return a list of editor descriptors
174  * @since 3.1
175  */
176  //virtual QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName, IContentType contentType) = 0;
177 
190  virtual QList<IFileEditorMapping::Pointer> GetFileEditorMappings() = 0;
191 
192  /*
193  * Returns the image descriptor associated with a given file. This image is
194  * usually displayed next to the given file. This method assumes an unknown
195  * content type for the given file.
196  * <p>
197  * The image is determined by taking the file extension of the file and
198  * obtaining the image for the default editor associated with that
199  * extension. A default image is returned if no default editor is available.
200  * </p>
201  *
202  * @param filename
203  * the file name in the system
204  * @return the descriptor of the image to display next to the file
205  */
206  // virtual ImageDescriptor* GetImageDescriptor(const QString& filename) = 0;
207 
208  /*
209  * Returns the image descriptor associated with a given file. This image is
210  * usually displayed next to the given file.
211  * <p>
212  * The image is determined by taking the file extension of the file and
213  * obtaining the image for the default editor associated with that
214  * extension. A default image is returned if no default editor is available.
215  * </p>
216  *
217  * @param filename
218  * the file name in the system
219  * @param contentType
220  * the content type of the file or <code>null</code> for the
221  * unknown content type
222  * @return the descriptor of the image to display next to the file
223  * @since 3.1
224  */
225  // virtual ImageDescriptor* GetImageDescriptor(const std::tring& filename, IContentType contentType) = 0;
226 
227  /*
228  * Removes the given property listener from this registry.
229  * Has no affect if an identical listener is not registered.
230  *
231  * @param listener a property listener
232  */
233  // virtual void RemovePropertyListener(IPropertyListener listener) = 0;
234 
243  virtual void SetDefaultEditor(const QString& fileNameOrExtension, const QString& editorId) = 0;
244 
254  virtual bool IsSystemInPlaceEditorAvailable(const QString& filename) = 0;
255 
265  virtual bool IsSystemExternalEditorAvailable(const QString& filename) = 0;
266 
267  /*
268  * Returns the image descriptor associated with the system editor that
269  * would be used to edit this file externally.
270  *
271  * @param filename the file name
272  * @return the descriptor of the external editor image, or <code>null</code>
273  * if none
274  * @since 3.0
275  */
276  // virtual ImageDescriptor GetSystemExternalEditorImageDescriptor(const QString& filename) = 0;
277 };
278 
279 }
280 
281 #endif /*MITKIEDITORREGISTRY_H_*/
static const QString SYSTEM_INPLACE_EDITOR_ID
static const int PROP_CONTENTS
static const QString SYSTEM_EXTERNAL_EDITOR_ID
#define BERRY_UI_QT