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 DFBrowser_Communicator_H
17 #define DFBrowser_Communicator_H
19 #include <Standard.hxx>
20 #include <Standard_Macro.hxx>
22 #include <inspector/TInspectorAPI_PluginParameters.hxx>
23 #include <inspector/TInspector_Preferences.hxx>
24 #include <inspector/TInspector_Window.hxx>
26 class TInspector_ReportCallBack;
28 //! \class TInspector_PluginParameters.
29 //! \brief This is plugin parameters extended by a possibility to activate module during setting new parameters
30 class TInspector_PluginParameters : public TInspectorAPI_PluginParameters
35 Standard_EXPORT TInspector_PluginParameters (TInspector_Window* theWindow);
38 virtual ~TInspector_PluginParameters() Standard_OVERRIDE {}
40 //! Stores the parameters for plugin
41 //! \param thePluginName a plugin name
42 //! \param theParameters a list of parameters
43 //! \param theToActivatePlugin a state whether the plugin should be immediately activated
44 Standard_EXPORT virtual void SetParameters (const TCollection_AsciiString& thePluginName,
45 const NCollection_List<Handle(Standard_Transient)>& theParameters,
46 const Standard_Boolean& theToActivatePlugin = Standard_False) Standard_OVERRIDE;
48 //! Sets path to a directory for temporary plugin files. Sets the directory into preferences loader
49 //! \param thePath a path
50 virtual void SetTemporaryDirectory (const TCollection_AsciiString& thePath) Standard_OVERRIDE;
52 //! Returns plugin preferences
53 //! \param thePluginName a plugin name
54 virtual void GetPreferences (const TCollection_AsciiString& thePluginName,
55 TInspectorAPI_PreferencesDataMap& theItem) Standard_OVERRIDE
56 { myPreferences->GetPreferences (thePluginName, theItem); }
58 //! Stores plugin preferences
59 //! \param thePluginName a plugin name
60 //! \theItem container of plugin preferences values in form: <name, value>
61 virtual void SetPreferences (const TCollection_AsciiString& thePluginName,
62 const TInspectorAPI_PreferencesDataMap& theItem) Standard_OVERRIDE
63 { myPreferences->SetPreferences (thePluginName, theItem); }
65 //! Store plugin preferences into a preferences file
66 void StorePreferences() { myPreferences->StorePreferences(); }
68 //! Remove plugin preferences file
69 void RemovePreferences() { myPreferences->RemovePreferences(); }
73 TInspector_Window* myWindow; //!< the current window
74 Handle(TInspector_ReportCallBack) myReportCallBack; //!< inspector report callback for automatic view update
75 TInspector_Preferences* myPreferences; //!< the preferences loader