Salome HOME
Selection validators improvements
[modules/shaper.git] / src / XGUI / XGUI_ObjectsBrowser.h
index 18c03d2ccb7d3cd241c57738b876d84655d55f52..a1e5c5ef1dd4b5bfbc04684db0424fb5cb07cbef 100644 (file)
@@ -3,13 +3,13 @@
 #define XGUI_ObjectsBrowser_H
 
 #include "XGUI.h"
-#include "XGUI_Constants.h"
+#include <ModuleBase_Definitions.h>
 
 #include <QWidget>
 #include <QTreeView>
 
 class XGUI_DocumentDataModel;
-class QLabel;
+class QLineEdit;
 
 
 class XGUI_DataTree: public QTreeView
@@ -32,6 +32,9 @@ signals:
   //! Emited on context menu request
   void contextMenuRequested(QContextMenuEvent* theEvent);
 
+protected slots:
+  virtual void commitData(QWidget* theEditor);
+
 protected:
   virtual void mouseDoubleClickEvent(QMouseEvent* theEvent);
   virtual void contextMenuEvent(QContextMenuEvent* theEvent);
@@ -61,7 +64,9 @@ public:
   XGUI_DocumentDataModel* dataModel() const { return myDocModel; }
 
   //! Returns list of currently selected features
-  QFeatureList selectedFeatures() const { return myTreeView->selectedFeatures(); }
+  QFeatureList selectedFeatures() const { return myFeaturesList; }
+
+  void setFeaturesSelected(const QFeatureList& theFeatures);
 
   //! Returns currently selected indexes
   QModelIndexList selectedIndexes() const { return myTreeView->selectionModel()->selectedIndexes(); }
@@ -70,7 +75,9 @@ public:
   XGUI_DataTree* treeView() const { return myTreeView; }
 
   //! Activates currently selected part. Signal activePartChanged will not be sent
-  void activateCurrentPart(bool toActivate);
+  void activatePart(const FeaturePtr& thePart);
+
+  void rebuildDataTree();
 
 signals:
   //! Emited when selection is changed
@@ -87,13 +94,24 @@ protected:
 
 private slots:
   void onActivePartChanged(FeaturePtr thePart);
+  void onContextMenuRequested(QContextMenuEvent* theEvent);
+  void onLabelContextMenuRequested(const QPoint& thePnt);
+
+  //! Called on Edit command request
+  void onEditItem();
+
+  void onSelectionChanged();
 
 private:
+  void closeDocNameEditing(bool toSave);
+
   //! Internal model
   XGUI_DocumentDataModel* myDocModel;
 
-  QLabel* myActiveDocLbl;
+  QLineEdit* myActiveDocLbl;
   XGUI_DataTree* myTreeView;
+
+  QFeatureList myFeaturesList;
 };
 
 #endif
\ No newline at end of file