00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2017 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : Tristan Mehamli (Sep 2011) 00022 ** Modified by : Jean Paul Digeon (Sep 2011) 00023 **=======================================================================*/ 00024 #ifndef IVT_PLUGINS_MANAGER_H 00025 #define IVT_PLUGINS_MANAGER_H 00026 00028 // 00029 // Class: IvtPluginsManager 00030 // 00032 00033 #include <IvTune/IvTuneExtender/IvtLibName.h> 00034 00035 #include <Inventor/SbString.h> 00036 00037 #include <Inventor/STL/list> 00038 #include <Inventor/STL/map> 00039 #include <Inventor/STL/pair> 00040 #include <Inventor/STL/string> 00041 00042 #include <QObject> 00043 #include <QtXml/QDomElement> 00044 00045 #ifdef _WIN32 00046 # if !defined(IvTuneExtenderAPI_EXPORTS) 00047 # ifndef OIV_DISABLE_AUTOLINK 00048 # pragma comment(lib,__IVTUNEEXTENDERAPILIB) 00049 # endif 00050 # endif 00051 #endif //win 00052 00053 class IvtPlugin; 00054 class IvtProfile; 00055 class IvtProfileSetting; 00056 00072 class IvtPluginsManager : public QObject 00073 { 00074 Q_OBJECT 00075 public: 00076 00083 void addProfile( IvtProfile* profile ); 00084 00088 IvtProfile* getActiveProfile() const; 00089 00095 IvtPlugin* getPluginByName( const SbString& name ); 00096 00100 const std::list< IvtPlugin* >& getPlugins() const; 00101 00105 static IvtPluginsManager* getInstance(); 00106 00112 IvtProfile* getProfileByName( const SbString& name ); 00113 00117 const std::list<IvtProfile*>& getProfilesList() const; 00118 00125 IvtPlugin* loadPlugin( const SbString& path, const SbString& fileName ); 00126 00133 void read( const SbString& configFilePath, bool isPath = true ); 00134 00139 static void releaseInstance(); 00140 00146 void removeProfile( IvtProfile* profile ); 00147 00154 void setActiveProfile( IvtProfile* profile ); 00155 00161 void unloadPlugin( IvtPlugin* plugin ); 00162 00166 void unloadAllPlugins(); 00167 00173 void write( const SbString& configFilePath ); 00174 00178 ~IvtPluginsManager(); 00179 00180 private: 00182 IvtPluginsManager(); 00183 00185 void readControlledExtension ( QDomElement& controlledExtension, IvtProfileSetting* s); 00186 00188 void writeControlledExtension( QDomDocument& doc, QDomElement& extension, IvtProfileSetting* setting ); 00189 00191 std::list< IvtPlugin*> m_pluginsInstances; 00192 00194 IvtProfile* m_defaultProfile; 00195 00197 IvtProfile* m_activeProfile; 00198 00200 std::list<IvtProfile*> m_profiles; 00201 00203 static IvtPluginsManager* m_instance; 00204 }; 00205 00206 #endif // IVT_PLUGINS_MANAGER_H 00207