+ //! Returns Model which provides access to data objects
+#ifdef ModuleDataModel
+ ModuleBase_IDocumentDataModel* dataModel() const
+ {
+ return myDocModel;
+ }
+#else
+ XGUI_DataModel* dataModel() const
+ {
+ return myDocModel;
+ }
+#endif
+
+ //! Returns list of currently selected objects
+ //! \param theIndexes - output list of corresponded indexes (can be NULL)
+ QObjectPtrList selectedObjects(QModelIndexList* theIndexes = 0) const;
+
+ /// Set selected list of objects
+ /// \param theObjects list of objects to select
+ void setObjectsSelected(const QObjectPtrList& theObjects);
+
+ //! Returns currently selected indexes
+ QModelIndexList selectedIndexes() const
+ {
+ return myTreeView->selectionModel()->selectedIndexes();
+ }
+
+ //! Returns TreeView widget
+ XGUI_DataTree* treeView() const
+ {
+ return myTreeView;
+ }
+
+ /// Returns active doc label object
+ QLineEdit* activeDocLabel() const { return myActiveDocLbl; }
+
+ /// Rebuild data tree
+ void rebuildDataTree();
+
+ /// Resets the object browser into initial state
+ void clearContent();
+
+ /// Set Data Model for the Object Browser
+#ifdef ModuleDataModel
+ void setDataModel(ModuleBase_IDocumentDataModel* theModel);
+#endif
+
+public slots:
+ //! Called on Edit command request
+ void onEditItem();
+
+signals:
+ //! Emited when selection is changed
+ void selectionChanged();
+
+ //! Emited on context menu request
+ void contextMenuRequested(QContextMenuEvent* theEvent);
+
+ //! Segnal is emitted when user cliks by mouse in header label of object browser
+ void headerMouseDblClicked(const QModelIndex&);
+
+ protected:
+ /// Redefinition of virtual method
+ virtual bool eventFilter(QObject* obj, QEvent* theEvent);
+
+ private slots:
+ /// Show context menu
+ /// \param theEvent a context menu event
+ void onContextMenuRequested(QContextMenuEvent* theEvent);
+
+ /// Show context menu on upper label
+ /// \param thePnt a position of context menu
+ void onLabelContextMenuRequested(const QPoint& thePnt);
+
+ //! Called when selection in Data Tree is changed
+ void onSelectionChanged(const QItemSelection& theSelected, const QItemSelection& theDeselected);