]> SALOME platform Git repositories - modules/gui.git/blob - src/DDS/DDS_Dictionary.h
Salome HOME
69e653c2838d2b38dc911ea13d2aa79aae83a283
[modules/gui.git] / src / DDS / DDS_Dictionary.h
1 // Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
7 //
8 // This library is distributed in the hope that it will be useful
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/
18 //
19 #ifndef DDS_DICTIONARY_H
20 #define DDS_DICTIONARY_H
21
22 #include "DDS_DicGroup.h"
23
24 #include <LDOMString.hxx>
25
26 #include <MMgt_TShared.hxx>
27
28 class LDOM_Element;
29 class TCollection_AsciiString;
30
31 DEFINE_STANDARD_HANDLE(DDS_Dictionary, MMgt_TShared)
32
33 //  Class to provide information about used parameters,
34 //  reading them from 'xml' file
35 class DDS_Dictionary : public MMgt_TShared
36 {
37 public:
38   Standard_EXPORT static Handle(DDS_Dictionary)  Get();
39
40   // Return instance of data dictionary. Create instance if it is NULL.
41
42   Standard_EXPORT Handle(DDS_DicItem)            GetDicItem( const TCollection_AsciiString& ) const;
43   Standard_EXPORT Handle(DDS_DicItem)            GetDicItem( const TCollection_AsciiString&,
44                                                              const TCollection_AsciiString& ) const;
45
46   Standard_EXPORT void                           GetUnitSystems( TColStd_SequenceOfAsciiString& ) const;
47   Standard_EXPORT void                           GetUnitSystems( TColStd_SequenceOfAsciiString&,
48                                                                  const TCollection_AsciiString& ) const;
49   Standard_EXPORT TCollection_ExtendedString     GetUnitSystemLabel( const TCollection_AsciiString& ) const;
50   Standard_EXPORT TCollection_ExtendedString     GetUnitSystemLabel( const TCollection_AsciiString&,
51                                                                      const TCollection_AsciiString& ) const;
52   Standard_EXPORT TCollection_AsciiString        GetActiveUnitSystem() const;
53   Standard_EXPORT TCollection_AsciiString        GetActiveUnitSystem( const TCollection_AsciiString& ) const;
54   Standard_EXPORT void                           SetActiveUnitSystem( const TCollection_AsciiString& );
55   Standard_EXPORT void                           SetActiveUnitSystem( const TCollection_AsciiString&,
56                                                                       const TCollection_AsciiString& );
57
58
59   static Standard_EXPORT Standard_Boolean        Load( const TCollection_AsciiString );
60
61   static Standard_EXPORT Standard_Real           ToSI( const Standard_Real, const Standard_CString );
62   static Standard_EXPORT Standard_Real           FromSI( const Standard_Real, const Standard_CString );
63
64   static Standard_EXPORT LDOMString              KeyWord( const TCollection_AsciiString& );
65
66 private:
67   DDS_Dictionary();
68   DDS_Dictionary( const DDS_Dictionary& );
69
70   void                                           operator=( const DDS_Dictionary& );
71
72   // prepares formants for each unit systems
73   void                                           FillDataMap( const LDOM_Element&, const LDOM_Element& );
74
75 private:
76   DDS_IndexedDataMapOfDicGroups                  myGroupMap;
77
78 public:
79   DEFINE_STANDARD_RTTI(DDS_Dictionary)
80 };
81
82 #endif