1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModuleBase_IconFactory.h
4 // Created: 28 Jul 2015
5 // Author: Vitaly SMETANNIKOV
7 #ifndef ModuleBase_IconFactory_H
8 #define ModuleBase_IconFactory_H
10 #include "ModuleBase.h"
11 #include <ModelAPI_Object.h>
14 /**\class ModuleBase_IconFactory
16 * \brief This is a class which provides icons of objects for object browser
18 class MODULEBASE_EXPORT ModuleBase_IconFactory
21 /// Returns icons factory instance
22 static ModuleBase_IconFactory* get();
24 /// Returns Icon for the given object
25 /// \param theObj an object
26 virtual QIcon getIcon(ObjectPtr theObj);
28 /// Finds an icon for the given object. The icon is loaded: firstly from qrc file,
29 /// then by the icon path. If the path contains ":" , it will be treated as absolute path to
30 /// the icon, or relative path from the plugin library
31 /// \param theValue an icon information
32 /// \return a loaded or empty icon
33 static QIcon loadIcon(const QString& theValue);
36 ModuleBase_IconFactory();
38 /// Set the current icons factory instance
39 /// \param theFactory a new factory
40 static void setFactory(ModuleBase_IconFactory* theFactory);