0029674: Improvements in Inspector tool
[occt.git] / tools / VInspector / VInspector_Communicator.hxx
1 // Created on: 2017-06-16
2 // Created by: Natalia ERMOLAEVA
3 // Copyright (c) 2017 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement. 
15
16 #ifndef VInspector_Communicator_H
17 #define VInspector_Communicator_H
18
19 #include <Standard.hxx>
20 #include <Standard_Macro.hxx>
21 #include <inspector/VInspector_Window.hxx>
22
23 #include <inspector/TInspectorAPI_Communicator.hxx>
24
25 //! \class VInspector_Communicator.
26 //! \brief This is a connector from TInspector application to VInspector view
27 class VInspector_Communicator : public TInspectorAPI_Communicator
28 {
29 public:
30
31   //! Constructor
32   Standard_EXPORT VInspector_Communicator();
33
34   //! Destructor
35   virtual ~VInspector_Communicator() Standard_OVERRIDE {}
36
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); }
41
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); }
46
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); }
50
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); }
55
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); }
60
61   //! Calls update of the plugin's content
62   virtual void UpdateContent() Standard_OVERRIDE { myWindow->UpdateContent(); }
63
64 private:
65   VInspector_Window* myWindow; //!< current window
66 };
67
68 #endif