Salome HOME
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git] / src / XGUI / XGUI_Workshop.h
index de7dc670bb3f5207df99edcb0bb041f589520fd8..cd77d3b13a29f56584cbca2bba009767b65366de 100644 (file)
@@ -2,6 +2,7 @@
 #define XGUI_WORKSHOP_H
 
 #include "XGUI.h"
+#include "XGUI_Constants.h"
 #include <Events_Listener.h>
 
 #include <QObject>
@@ -22,6 +23,8 @@ class XGUI_ActionsMgr;
 class XGUI_ErrorDialog;
 class XGUI_SalomeViewer;
 class XGUI_ViewerProxy;
+class XGUI_PropertyPanel;
+class XGUI_ContextMenuMgr;
 
 class ModuleBase_Operation;
 
@@ -65,7 +68,10 @@ public:
   XGUI_ActionsMgr* actionsMgr() const { return myActionsMgr; };
 
   //! Returns property panel widget
-  QDockWidget* propertyPanel() const { return myPropertyPanelDock; }
+  XGUI_PropertyPanel* propertyPanel() const { return myPropertyPanel; }
+
+  //! Returns context menu manager object
+  XGUI_ContextMenuMgr* contextMenuMgr() const { return myContextMenuMgr; }
 
   //! Creates and adds a new workbench (menu group) with the given name and returns it
   XGUI_Workbench* addWorkbench(const QString& theName);
@@ -89,6 +95,10 @@ public:
 
   XGUI_ViewerProxy* viewer() const { return myViewerProxy; }
 
+  //! Returns icon name according to feature Id
+  static QString featureIcon(const std::string& theId);
+
+
 signals:
   void salomeViewerSelection();
 
@@ -109,7 +119,7 @@ public slots:
   void hideObjectBrowser();
 
   void onFeatureTriggered();
-  void changeCurrentDocument();
+  void changeCurrentDocument(FeaturePtr thePart);
 
 signals:
   void errorOccurred(const QString&);
@@ -129,6 +139,8 @@ protected slots:
   /// \param theOpertion a stopped operation
   void onOperationStopped(ModuleBase_Operation* theOperation);
 
+  void onContextMenuCommand(const QString& theId, bool isChecked);
+
 private:
   void initMenu();
 
@@ -140,13 +152,15 @@ private:
 
   // Creates Dock widgets: Object browser and Property panel
   void createDockWidgets();
-  void setPropertyPannelTitle(const QString& theTitle);
+
+  //! Activates or deactivates currently selected part
+  void activatePart(bool toActivate);
 
   QString myCurrentFile;
   XGUI_MainWindow* myMainWindow;
   XGUI_Module* myPartSetModule;
   XGUI_ObjectsBrowser* myObjectBrowser;
-  QDockWidget* myPropertyPanelDock;
+  XGUI_PropertyPanel* myPropertyPanel;
   XGUI_SelectionMgr* mySelector;
   XGUI_Displayer* myDisplayer;
   XGUI_OperationMgr* myOperationMgr; ///< manager to manipulate through the operations
@@ -154,6 +168,10 @@ private:
   XGUI_SalomeConnector* mySalomeConnector;
   XGUI_ErrorDialog* myErrorDlg;
   XGUI_ViewerProxy* myViewerProxy;
+  XGUI_ContextMenuMgr* myContextMenuMgr;
+
+  static QMap<QString, QString> myIcons;
+
 };
 
 #endif