-// 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 {
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