Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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 
107  virtual IEditorDescriptor::Pointer GetDefaultEditor() = 0;
108 
122  virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName) = 0;
123 
124  /*
125  * Returns the default editor for a given file name and with the given content type.
126  * <p>
127  * The default editor is determined by taking the file extension for the
128  * file and obtaining the default editor for that extension.
129  * </p>
130  *
131  * @param fileName the file name in the system
132  * @param contentType the content type or <code>null</code> for the unknown content type
133  * @return the descriptor of the default editor, or <code>null</code> if not
134  * found
135  * @since 3.1
136  */
137  //virtual IEditorDescriptor::Pointer GetDefaultEditor(const QString& fileName, IContentType contentType) = 0;
138 
152  virtual QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName) = 0;
153 
154  /*
155  * Returns the list of file editors registered to work against the file with
156  * the given file name and with the given content type.
157  * <p>
158  * Note: Use <code>getDefaultEditor(String)</code> if you only the need
159  * the default editor rather than all candidate editors.
160  * </p>
161  *
162  * @param fileName
163  * the file name in the system
164  * @param contentType
165  * the content type or <code>null</code> for the unknown
166  * content type
167  * @return a list of editor descriptors
168  * @since 3.1
169  */
170  //virtual QList<IEditorDescriptor::Pointer> GetEditors(const QString& fileName, IContentType contentType) = 0;
171 
184  virtual QList<IFileEditorMapping::Pointer> GetFileEditorMappings() = 0;
185 
186  /*
187  * Returns the image descriptor associated with a given file. This image is
188  * usually displayed next to the given file. This method assumes an unknown
189  * content type for the given file.
190  * <p>
191  * The image is determined by taking the file extension of the file and
192  * obtaining the image for the default editor associated with that
193  * extension. A default image is returned if no default editor is available.
194  * </p>
195  *
196  * @param filename
197  * the file name in the system
198  * @return the descriptor of the image to display next to the file
199  */
200  // virtual ImageDescriptor* GetImageDescriptor(const QString& filename) = 0;
201 
202  /*
203  * Returns the image descriptor associated with a given file. This image is
204  * usually displayed next to the given file.
205  * <p>
206  * The image is determined by taking the file extension of the file and
207  * obtaining the image for the default editor associated with that
208  * extension. A default image is returned if no default editor is available.
209  * </p>
210  *
211  * @param filename
212  * the file name in the system
213  * @param contentType
214  * the content type of the file or <code>null</code> for the
215  * unknown content type
216  * @return the descriptor of the image to display next to the file
217  * @since 3.1
218  */
219  // virtual ImageDescriptor* GetImageDescriptor(const std::string& filename, IContentType contentType) = 0;
220 
221  /*
222  * Removes the given property listener from this registry.
223  * Has no affect if an identical listener is not registered.
224  *
225  * @param listener a property listener
226  */
227  // virtual void RemovePropertyListener(IPropertyListener listener) = 0;
228 
237  virtual void SetDefaultEditor(const QString& fileNameOrExtension, const QString& editorId) = 0;
238 
248  virtual bool IsSystemInPlaceEditorAvailable(const QString& filename) = 0;
249 
259  virtual bool IsSystemExternalEditorAvailable(const QString& filename) = 0;
260 
261  /*
262  * Returns the image descriptor associated with the system editor that
263  * would be used to edit this file externally.
264  *
265  * @param filename the file name
266  * @return the descriptor of the external editor image, or <code>null</code>
267  * if none
268  * @since 3.0
269  */
270  // virtual ImageDescriptor GetSystemExternalEditorImageDescriptor(const QString& filename) = 0;
271 };
272 
273 }
274 
275 #endif /*MITKIEDITORREGISTRY_H_*/
berry::IEditorRegistry::SYSTEM_INPLACE_EDITOR_ID
static const QString SYSTEM_INPLACE_EDITOR_ID
Definition: berryIEditorRegistry.h:71
berry::IEditorRegistry::SYSTEM_EXTERNAL_EDITOR_ID
static const QString SYSTEM_EXTERNAL_EDITOR_ID
Definition: berryIEditorRegistry.h:61
berryIFileEditorMapping.h
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
berry::IEditorRegistry::PROP_CONTENTS
static const int PROP_CONTENTS
Definition: berryIEditorRegistry.h:52
BERRY_UI_QT
#define BERRY_UI_QT
Definition: org_blueberry_ui_qt_Export.h:26
berryIEditorDescriptor.h
berry::IEditorRegistry
Definition: berryIEditorRegistry.h:47
berry
Definition: QmitkPropertyItemModel.h:24