1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #ifndef VInspector_Communicator_H
17 #define VInspector_Communicator_H
19 #include <Standard.hxx>
20 #include <Standard_Macro.hxx>
21 #include <inspector/VInspector_Window.hxx>
23 #include <inspector/TInspectorAPI_Communicator.hxx>
25 //! \class VInspector_Communicator.
26 //! \brief This is a connector from TInspector application to VInspector view
27 class VInspector_Communicator : public TInspectorAPI_Communicator
32 Standard_EXPORT VInspector_Communicator();
35 virtual ~VInspector_Communicator() Standard_OVERRIDE {}
37 //! Provides the container with a parent where this container should be inserted.
38 //! If Qt implementation, it should be QWidget with QLayout set inside
39 //! \param theParent a parent class
40 virtual void SetParent (void* theParent) Standard_OVERRIDE { myWindow->SetParent (theParent); }
42 //! Sets parameters container, it should be used when the plugin is initialized or in update content
43 //! \param theParameters a parameters container
44 virtual void SetParameters (const Handle(TInspectorAPI_PluginParameters)& theParameters) Standard_OVERRIDE
45 { myWindow->SetParameters (theParameters); }
47 //! Provide container for actions available in inspector on general level
48 //! \param theMenu if Qt implementation, it is QMenu object
49 Standard_EXPORT virtual void FillActionsMenu(void* theMenu) Standard_OVERRIDE { myWindow->FillActionsMenu (theMenu); }
51 //! Returns plugin preferences, empty implementation by default
52 //! \param theItem container of preference elements
53 virtual void GetPreferences (TInspectorAPI_PreferencesDataMap& theItem) Standard_OVERRIDE
54 { myWindow->GetPreferences (theItem); }
56 //! Stores plugin preferences, empty implementation by default
57 //! \param theItem container of preference elements
58 virtual void SetPreferences (const TInspectorAPI_PreferencesDataMap& theItem) Standard_OVERRIDE
59 { myWindow->SetPreferences (theItem); }
61 //! Calls update of the plugin's content
62 virtual void UpdateContent() Standard_OVERRIDE { myWindow->UpdateContent(); }
65 VInspector_Window* myWindow; //!< current window