c59c9cf9378baca0d0dd120b452802f9265b72fc
[occt.git] / tools / TInspectorAPI / TInspectorAPI_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 TInspectorAPI_PluginParameters_H
17 #define TInspectorAPI_PluginParameters_H
18
19 #include <NCollection_DataMap.hxx>
20 #include <NCollection_List.hxx>
21 #include <Standard_Version.hxx>
22 #include <Standard_Transient.hxx>
23 #include <TCollection_AsciiString.hxx>
24 #include <TCollection_AsciiString.hxx>
25
26 class TInspectorAPI_PluginParameters;
27 DEFINE_STANDARD_HANDLE (TInspectorAPI_PluginParameters, Standard_Transient)
28
29 //! The container of parameters for all possible plugins. It stores list of parameters for each plugin, even
30 //! it was not be loaded yet. There is a map of plugin name into plugin parameters.
31 //! The parameters may be:
32 //! - child of Standard_Transient
33 //! - file name to be opened by the plugin
34 class TInspectorAPI_PluginParameters : public Standard_Transient
35 {
36 public:
37
38   //! Constructs the container.
39   Standard_EXPORT TInspectorAPI_PluginParameters();
40
41   //! Destructor
42   Standard_EXPORT virtual ~TInspectorAPI_PluginParameters() Standard_OVERRIDE {}
43
44   //! Stores the parameters for plugin
45   //! \param thePluginName a plugin name
46   //! \param theParameters a list of parameters
47   Standard_EXPORT void SetParameters (const TCollection_AsciiString& thePluginName,
48                                       const NCollection_List<Handle(Standard_Transient)>& theParameters);
49
50   //! Add a file name for the plugin
51   //! \param thePluginName a plugin name
52   //! \param theFileName a name
53   Standard_EXPORT void AddFileName (const TCollection_AsciiString& thePluginName,
54                                     const TCollection_AsciiString& theFileName);
55
56   //! Set file names for the plugin
57   //! \param thePluginName a plugin name
58   //! \param theFileNames container of names
59   Standard_EXPORT void SetFileNames (const TCollection_AsciiString& thePluginName,
60                                      const NCollection_List<TCollection_AsciiString>& theFileNames);
61
62   //! Returns true if there are parameters set for the given plugin
63   //! \param thePluginName a plugin name
64   //! \return boolean result
65   Standard_EXPORT bool FindParameters (const TCollection_AsciiString& thePluginName);
66
67   //! Returns parameters set for the given plugin
68   //! \param thePluginName a plugin name
69   //! \return container of objects
70   Standard_EXPORT const NCollection_List<Handle(Standard_Transient)>& Parameters (
71                                                       const TCollection_AsciiString& thePluginName);
72
73   //! Returns true if there are file names set for the given plugin
74   //! \param thePluginName a plugin name
75   //! \return boolean result
76   Standard_EXPORT bool FindFileNames (const TCollection_AsciiString& thePluginName);
77
78   //! Returns file names set for the given plugin
79   //! \param thePluginName a plugin name
80   //! \return container of names
81   Standard_EXPORT const NCollection_List<TCollection_AsciiString>& FileNames(
82                                                       const TCollection_AsciiString& thePluginName);
83
84 #if OCC_VERSION_HEX <= 0x060901
85   DEFINE_STANDARD_RTTI (TInspectorAPI_PluginParameters)
86 #else
87   DEFINE_STANDARD_RTTIEXT (TInspectorAPI_PluginParameters, Standard_Transient)
88 #endif
89 private:
90   //! container of parameters
91   NCollection_DataMap<TCollection_AsciiString, NCollection_List<Handle(Standard_Transient)> > myParameters;
92   //! container of names
93   NCollection_DataMap<TCollection_AsciiString, NCollection_List<TCollection_AsciiString> > myFileNames;
94 };
95
96 #endif