Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/gui.git] / src / DDS / DDS_DicGroup.h
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef DDS_DICGROUP_H
24 #define DDS_DICGROUP_H
25
26 #include "DDS.h"
27
28 #include "DDS_DicItem.h"
29
30 #include <MMgt_TShared.hxx>
31 #include <TColStd_SequenceOfAsciiString.hxx>
32 #include <NCollection_List.hxx>
33
34 class LDOM_Element;
35
36 DEFINE_STANDARD_HANDLE(DDS_DicGroup, MMgt_TShared)
37
38 class DDS_DicGroup : public MMgt_TShared
39 {
40 public:
41   DDS_DicGroup( const TCollection_AsciiString& );
42
43   TCollection_AsciiString                    GetName() const;
44   Standard_EXPORT void                       GetKeys( TColStd_SequenceOfAsciiString& ) const;
45
46   Standard_EXPORT Handle(DDS_DicItem)        GetDicItem( const TCollection_AsciiString& ) const;
47
48   Standard_EXPORT void                       GetUnitSystems( TColStd_SequenceOfAsciiString& ) const;
49   Standard_EXPORT TCollection_ExtendedString GetUnitSystemLabel( const TCollection_AsciiString& ) const;
50
51   Standard_EXPORT TCollection_AsciiString    GetActiveUnitSystem() const;
52   Standard_EXPORT void                       SetActiveUnitSystem( const TCollection_AsciiString& );
53
54 private:
55   DDS_DicGroup( const DDS_DicGroup& );
56
57   void                                       operator=( const DDS_DicGroup& );
58
59   void                                       FillDataMap( const LDOM_Element&, const LDOM_Element& );
60
61 private:
62   typedef NCollection_DataMap<TCollection_AsciiString,
63                               TCollection_ExtendedString> UnitSystemMap;
64
65 private:
66   TCollection_AsciiString                    myName;
67   DDS_IndexedDataMapOfDicItems               myDataMap;
68   UnitSystemMap                              myUnitSystem;
69   TCollection_AsciiString                    myActiveSystem;
70   TColStd_SequenceOfAsciiString              myKeys;
71
72   friend class DDS_Dictionary;
73
74 public:
75   DEFINE_STANDARD_RTTI(DDS_DicGroup)
76 };
77
78 DEFINE_BASECOLLECTION(DDS_BaseCollectionOfDicGroups, Handle(DDS_DicGroup))
79 DEFINE_INDEXEDDATAMAP(DDS_IndexedDataMapOfDicGroups, DDS_BaseCollectionOfDicGroups,
80                       TCollection_AsciiString, Handle(DDS_DicGroup))
81
82 #endif