-// Copyright (C) 2014-2017 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
#ifndef XGUI_DataModel_H
#include <QAbstractItemModel>
-class Config_DataModelReader;
class XGUI_Workshop;
class ModuleBase_ITreeNode;
/// \param theIndex an index to check
bool hasIndex(const QModelIndex& theIndex) const;
+ /// Returns true if the given node is a parto of the data tree
+ /// \param theNode a node to check
+ bool hasNode(ModuleBase_ITreeNode* theNode) const;
+
+ /// Returns document of the given index
+ /// \param theIndex an index to check
+ DocumentPtr document(const QModelIndex& theIndex) const;
+
+ /// Returns index for the node and column
+ /// \param theNode a node
+ /// \param thCol a column
+ QModelIndex getIndex(ModuleBase_ITreeNode* theNode, int thCol) const;
+
signals:
+ /// Signal send before tree rebuild
+ void beforeTreeRebuild();
+
/// Signal about tree had been rebuilt
void treeRebuilt();
QModelIndex getParentIndex(ModuleBase_ITreeNode* theNode, int thCol) const;
- QModelIndex getIndex(ModuleBase_ITreeNode* theNode, int thCol) const;
-
void updateSubTree(ModuleBase_ITreeNode* theParent);
/// Find a root index which contains objects of the given document