Salome HOME
Switch to SSL mode for tests : naive approach
[modules/geom.git] / src / Material / Material_ResourceMgr.h
index a98a531d7c728fba68523600f277895a3d5dccba..3825ed6c2f9ec9c85f7c1a1a363f38c1dd69e7d9 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 #include "Material.h"
 
+#include <QObject>
+#include <QMutex>
 #include <QtxResourceMgr.h>
 
-class MATERIAL_SALOME_EXPORT Material_ResourceMgr : public QtxResourceMgr
+class QFileSystemWatcher;
+
+class MATERIAL_SALOME_EXPORT Material_ResourceMgr : public QObject, public QtxResourceMgr
 {
+  Q_OBJECT
+
+  class Updater;
+
 public:
   //! Material type
   typedef enum {
@@ -40,8 +48,25 @@ public:
   Material_ResourceMgr();
   ~Material_ResourceMgr();
 
+  static Material_ResourceMgr* resourceMgr();
+
   QStringList materials( MaterialType = All, bool = true );
-  
+
+signals:
+  void changed();
+
+private:
+  void watchUserFile( bool );
+  void saved();
+
+private slots:
+  void update();
+
+private:
+  QFileSystemWatcher* myWatcher;
+  QMutex              myMutex;
+
+  friend class Material_Model;
 };
 
 #endif // MATERIAL_RESOURCEMGR_H