Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIEditorRegistry.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
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 MITKIEDITORREGISTRY_H_
18 #define MITKIEDITORREGISTRY_H_
19 
20 
21 #include "berryIEditorDescriptor.h"
23 
24 namespace berry {
25 
53 
57  static const int PROP_CONTENTS; // = 0x01;
58 
69  static const QString SYSTEM_EXTERNAL_EDITOR_ID; // = "org.blueberry.ui.systemExternalEditor";
70 
81  static const QString SYSTEM_INPLACE_EDITOR_ID; // = "org.blueberry.ui.systemInPlaceEditor";
82 
83  /*
84  * Adds a listener for changes to properties of this registry.
85  * Has no effect if an identical listener is already registered.
86  * <p>
87  * The properties ids are as follows:
88  * <ul>
89  * <li><code>PROP_CONTENTS</code>: Triggered when the file editor mappings in
90  * the editor registry change.</li>
91  * </ul>
92  * </p>
93  *
94  * @param listener a property listener
95  */
96  // virtual void AddPropertyListener(IPropertyListener listener) = 0;
97 
98  virtual ~IEditorRegistry();
99 
107  virtual IEditorDescriptor::Pointer FindEditor(const QString& editorId) = 0;
108 
117  virtual IEditorDescriptor::Pointer GetDefaultEditor() = 0;
118 
132  virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName) = 0;
133 
134  /*
135  * Returns the default editor for a given file name and with the given content type.
136  * <p>
137  * The default editor is determined by taking the file extension for the
138  * file and obtaining the default editor for that extension.
139  * </p>
140  *
141  * @param fileName the file name in the system
142  * @param contentType the content type or <code>null</code> for the unknown content type
143  * @return the descriptor of the default editor, or <code>null</code> if not
144  * found
145  * @since 3.1
146  */
147  //virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName, IContentType contentType) = 0;
148 
162  virtual QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName) = 0;
163 
164  /*
165  * Returns the list of file editors registered to work against the file with
166  * the given file name and with the given content type.
167  * <p>
168  * Note: Use <code>getDefaultEditor(String)</code> if you only the need
169  * the default editor rather than all candidate editors.
170  * </p>
171  *
172  * @param fileName
173  * the file name in the system
174  * @param contentType
175  * the content type or <code>null</code> for the unknown
176  * content type
177  * @return a list of editor descriptors
178  * @since 3.1
179  */
180  //virtual QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName, IContentType contentType) = 0;
181 
194  virtual QList<IFileEditorMapping::Pointer> GetFileEditorMappings() = 0;
195 
196  /*
197  * Returns the image descriptor associated with a given file. This image is
198  * usually displayed next to the given file. This method assumes an unknown
199  * content type for the given file.
200  * <p>
201  * The image is determined by taking the file extension of the file and
202  * obtaining the image for the default editor associated with that
203  * extension. A default image is returned if no default editor is available.
204  * </p>
205  *
206  * @param filename
207  * the file name in the system
208  * @return the descriptor of the image to display next to the file
209  */
210  // virtual ImageDescriptor* GetImageDescriptor(const QString& filename) = 0;
211 
212  /*
213  * Returns the image descriptor associated with a given file. This image is
214  * usually displayed next to the given file.
215  * <p>
216  * The image is determined by taking the file extension of the file and
217  * obtaining the image for the default editor associated with that
218  * extension. A default image is returned if no default editor is available.
219  * </p>
220  *
221  * @param filename
222  * the file name in the system
223  * @param contentType
224  * the content type of the file or <code>null</code> for the
225  * unknown content type
226  * @return the descriptor of the image to display next to the file
227  * @since 3.1
228  */
229  // virtual ImageDescriptor* GetImageDescriptor(const std::tring& filename, IContentType contentType) = 0;
230 
231  /*
232  * Removes the given property listener from this registry.
233  * Has no affect if an identical listener is not registered.
234  *
235  * @param listener a property listener
236  */
237  // virtual void RemovePropertyListener(IPropertyListener listener) = 0;
238 
247  virtual void SetDefaultEditor(const QString& fileNameOrExtension, const QString& editorId) = 0;
248 
258  virtual bool IsSystemInPlaceEditorAvailable(const QString& filename) = 0;
259 
269  virtual bool IsSystemExternalEditorAvailable(const QString& filename) = 0;
270 
271  /*
272  * Returns the image descriptor associated with the system editor that
273  * would be used to edit this file externally.
274  *
275  * @param filename the file name
276  * @return the descriptor of the external editor image, or <code>null</code>
277  * if none
278  * @since 3.0
279  */
280  // virtual ImageDescriptor GetSystemExternalEditorImageDescriptor(const QString& filename) = 0;
281 };
282 
283 }
284 
285 #endif /*MITKIEDITORREGISTRY_H_*/
static const QString SYSTEM_INPLACE_EDITOR_ID
static const std::string filename
static const int PROP_CONTENTS
static const QString SYSTEM_EXTERNAL_EDITOR_ID
#define BERRY_UI_QT