Medical Imaging Interaction Toolkit  2026.06.00
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 
48 
52  static const int PROP_CONTENTS; // = 0x01;
53 
61  static const QString SYSTEM_EXTERNAL_EDITOR_ID; // = "org.blueberry.ui.systemExternalEditor";
62 
71  static const QString SYSTEM_INPLACE_EDITOR_ID; // = "org.blueberry.ui.systemInPlaceEditor";
72 
73  /*
74  * Adds a listener for changes to properties of this registry.
75  * Has no effect if an identical listener is already registered.
76  * <p>
77  * The properties ids are as follows:
78  * <ul>
79  * <li><code>PROP_CONTENTS</code>: Triggered when the file editor mappings in
80  * the editor registry change.</li>
81  * </ul>
82  * </p>
83  *
84  * @param listener a property listener
85  */
86  // virtual void AddPropertyListener(IPropertyListener listener) = 0;
87 
88  virtual ~IEditorRegistry();
89 
97  virtual IEditorDescriptor::Pointer FindEditor(const QString& editorId) = 0;
98 
112  virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName) = 0;
113 
114  /*
115  * Returns the default editor for a given file name and with the given content type.
116  * <p>
117  * The default editor is determined by taking the file extension for the
118  * file and obtaining the default editor for that extension.
119  * </p>
120  *
121  * @param fileName the file name in the system
122  * @param contentType the content type or <code>null</code> for the unknown content type
123  * @return the descriptor of the default editor, or <code>null</code> if not
124  * found
125  * @since 3.1
126  */
127  //virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName, IContentType contentType) = 0;
128 
142  virtual QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName) = 0;
143 
144  /*
145  * Returns the list of file editors registered to work against the file with
146  * the given file name and with the given content type.
147  * <p>
148  * Note: Use <code>getDefaultEditor(String)</code> if you only the need
149  * the default editor rather than all candidate editors.
150  * </p>
151  *
152  * @param fileName
153  * the file name in the system
154  * @param contentType
155  * the content type or <code>null</code> for the unknown
156  * content type
157  * @return a list of editor descriptors
158  * @since 3.1
159  */
160  //virtual QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName, IContentType contentType) = 0;
161 
174  virtual QList<IFileEditorMapping::Pointer> GetFileEditorMappings() = 0;
175 
176  /*
177  * Returns the image descriptor associated with a given file. This image is
178  * usually displayed next to the given file. This method assumes an unknown
179  * content type for the given file.
180  * <p>
181  * The image is determined by taking the file extension of the file and
182  * obtaining the image for the default editor associated with that
183  * extension. A default image is returned if no default editor is available.
184  * </p>
185  *
186  * @param filename
187  * the file name in the system
188  * @return the descriptor of the image to display next to the file
189  */
190  // virtual ImageDescriptor* GetImageDescriptor(const QString& filename) = 0;
191 
192  /*
193  * Returns the image descriptor associated with a given file. This image is
194  * usually displayed next to the given file.
195  * <p>
196  * The image is determined by taking the file extension of the file and
197  * obtaining the image for the default editor associated with that
198  * extension. A default image is returned if no default editor is available.
199  * </p>
200  *
201  * @param filename
202  * the file name in the system
203  * @param contentType
204  * the content type of the file or <code>null</code> for the
205  * unknown content type
206  * @return the descriptor of the image to display next to the file
207  * @since 3.1
208  */
209  // virtual ImageDescriptor* GetImageDescriptor(const std::string& filename, IContentType contentType) = 0;
210 
211  /*
212  * Removes the given property listener from this registry.
213  * Has no affect if an identical listener is not registered.
214  *
215  * @param listener a property listener
216  */
217  // virtual void RemovePropertyListener(IPropertyListener listener) = 0;
218 
227  virtual void SetDefaultEditor(const QString& fileNameOrExtension, const QString& editorId) = 0;
228 
238  virtual bool IsSystemInPlaceEditorAvailable(const QString& filename) = 0;
239 
249  virtual bool IsSystemExternalEditorAvailable(const QString& filename) = 0;
250 
251  /*
252  * Returns the image descriptor associated with the system editor that
253  * would be used to edit this file externally.
254  *
255  * @param filename the file name
256  * @return the descriptor of the external editor image, or <code>null</code>
257  * if none
258  * @since 3.0
259  */
260  // virtual ImageDescriptor GetSystemExternalEditorImageDescriptor(const QString& filename) = 0;
261 };
262 
263 }
264 
265 #endif /*MITKIEDITORREGISTRY_H_*/
Implements transparent reference counting.
#define BERRY_UI_QT
virtual bool IsSystemInPlaceEditorAvailable(const QString &filename)=0
virtual bool IsSystemExternalEditorAvailable(const QString &filename)=0
virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString &fileName)=0
virtual QList< IEditorDescriptor::Pointer > GetEditors(const QString &fileName)=0
static const QString SYSTEM_INPLACE_EDITOR_ID
virtual QList< IFileEditorMapping::Pointer > GetFileEditorMappings()=0
static const QString SYSTEM_EXTERNAL_EDITOR_ID
static const int PROP_CONTENTS
virtual IEditorDescriptor::Pointer FindEditor(const QString &editorId)=0
virtual void SetDefaultEditor(const QString &fileNameOrExtension, const QString &editorId)=0