fcc29dc5ee3951b46b0763fc0bfdb7113516d62a
[occt.git] / tools / TInspector / TInspector_PluginParameters.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 DFBrowser_Communicator_H
17 #define DFBrowser_Communicator_H
18
19 #include <Standard.hxx>
20 #include <Standard_Macro.hxx>
21
22 #include <inspector/TInspectorAPI_PluginParameters.hxx>
23 #include <inspector/TInspector_Preferences.hxx>
24 #include <inspector/TInspector_Window.hxx>
25
26 class TInspector_ReportCallBack;
27
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
31 {
32 public:
33
34   //! Constructor
35   Standard_EXPORT TInspector_PluginParameters (TInspector_Window* theWindow);
36
37   //! Destructor
38   virtual ~TInspector_PluginParameters() Standard_OVERRIDE {}
39
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;
47
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;
51
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); }
57
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); }
64
65   //! Store plugin preferences into a preferences file
66   void StorePreferences() { myPreferences->StorePreferences(); }
67
68   //! Remove plugin preferences file
69   void RemovePreferences() { myPreferences->RemovePreferences(); }
70
71 private:
72
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
76 };
77
78 #endif