17 #ifndef BERRYIADAPTERMANAGER_H_
18 #define BERRYIADAPTERMANAGER_H_
94 static const
int NONE;
101 static const
int NOT_LOADED;
107 static const
int LOADED;
127 A* GetAdapter(const
Object* adaptable)
129 const char* typeName = qobject_interface_iid<A*>();
130 if (typeName ==
nullptr)
133 <<
"Cannot get the interface id for type '" << Reflection::GetClassName<A>()
134 <<
"'. It is probably missing a Q_DECLARE_INTERFACE macro in its header.";
137 return dynamic_cast<A*
>(this->GetAdapter(adaptable, typeName,
false));
157 virtual Object* GetAdapter(
const Object* adaptable,
const QString& adapterTypeName) = 0;
177 virtual bool HasAdapter(
const Object* adaptableType,
const QString& adapterType) = 0;
180 int QueryAdapter(
const Object* adaptable)
182 const char* typeName = qobject_interface_iid<A*>();
183 if (typeName ==
nullptr)
186 <<
"Cannot get the interface id for type '" << Reflection::GetClassName<A>()
187 <<
"'. It is probably missing a Q_DECLARE_INTERFACE macro in its header.";
190 return this->QueryAdapter(adaptable, typeName);
208 virtual int QueryAdapter(
const Object* adaptableType,
const QString& adapterType) = 0;
229 A* LoadAdapter(
const Object* adaptable)
231 const char* typeName = qobject_interface_iid<A*>();
232 if (typeName ==
nullptr)
235 <<
"Cannot get the interface id for type '" << Reflection::GetClassName<A>()
236 <<
"'. It is probably missing a Q_DECLARE_INTERFACE macro in its header.";
239 return dynamic_cast<A*
>(this->GetAdapter(adaptable, typeName,
true));
251 virtual void RegisterAdapters(IAdapterFactory* factory,
252 const QString& adaptableTypeName) = 0;
263 virtual void UnregisterAdapters(IAdapterFactory* factory) = 0;
275 virtual void UnregisterAdapters(IAdapterFactory* factory,
276 const QString& adaptableTypeName) = 0;
280 virtual Object* GetAdapter(
const Object* adaptable,
const QString& adapterType,
bool force) = 0;
QString GetClassName(const Object *obj)
Light weight base class for most BlueBerry classes.
#define org_blueberry_core_runtime_EXPORT
#define berryObjectMacro(...)