Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIConfigurationElement.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 BERRYIEXTENSIONELEMENT_H_
18 #define BERRYIEXTENSIONELEMENT_H_
19 
20 #include <berryObject.h>
21 
22 #include <berryLog.h>
23 
24 namespace berry {
25 
26 struct IContributor;
27 struct IExtension;
28 
29 class Handle;
30 
65 {
66 
68 
69  virtual ~IConfigurationElement();
70 
103  virtual QObject* CreateExecutableExtension(const QString& propertyName) const = 0;
104 
105  template<class C>
106  C* CreateExecutableExtension(const QString &propertyName) const
107  {
108  C* interface = qobject_cast<C*>(this->CreateExecutableExtension(propertyName));
109  if (interface == nullptr)
110  {
111  BERRY_WARN << "The QObject subclass " << this->GetAttribute(propertyName).toStdString()
112  << " does not seem to implement the required interface \""
113  << qobject_interface_iid<C*>() << "\", or you forgot the Q_INTERFACES macro.";
114  }
115  return interface;
116  }
117 
140  virtual QString GetAttribute(const QString& name) const = 0;
141 
160  virtual QList<QString> GetAttributeNames() const = 0;
161 
184  virtual QList<IConfigurationElement::Pointer> GetChildren() const = 0;
185 
196  virtual QList<IConfigurationElement::Pointer> GetChildren(const QString& name) const = 0;
197 
204  virtual SmartPointer<IExtension> GetDeclaringExtension() const = 0;
205 
219  virtual QString GetName() const = 0;
220 
232  virtual SmartPointer<Object> GetParent() const = 0;
233 
251  virtual QString GetValue() const = 0;
252 
271  virtual QString GetValue(const QLocale& locale) const = 0;
272 
279  virtual QString GetNamespaceIdentifier() const = 0;
280 
287  virtual SmartPointer<IContributor> GetContributor() const = 0;
288 
295  virtual bool IsValid() const = 0;
296 
297 };
298 
299 } // namespace berry
300 
301 Q_DECLARE_INTERFACE(berry::IConfigurationElement, "org.blueberry.core.IConfigurationElement")
302 
303 
304 #endif /*BERRYIEXTENSIONELEMENT_H_*/
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
Implements transparent reference counting.
#define org_blueberry_core_runtime_EXPORT
C * CreateExecutableExtension(const QString &propertyName) const
#define berryObjectMacro(...)
Definition: berryMacros.h:37
#define BERRY_WARN
Definition: berryLog.h:25
#define GetAttribute(name, type)
static std::string GetName(std::string fileName, std::string suffix)