]> SALOME platform Git repositories - modules/gui.git/blob - src/DDS/DDS_DicGroup.h
Salome HOME
99f82df833b168c611395291874b5717e3672096
[modules/gui.git] / src / DDS / DDS_DicGroup.h
1 // Copyright (C) 2007-2013  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   Standard_EXPORT DDS_DicGroup( const TCollection_AsciiString& );
42
43   Standard_EXPORT 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   virtual Standard_EXPORT Handle(DDS_DicItem) CreateItem() const;
55   
56 protected:
57
58   Standard_EXPORT DDS_DicGroup( const DDS_DicGroup& );
59
60   Standard_EXPORT void                        operator=( const DDS_DicGroup& );
61
62   Standard_EXPORT virtual void                FillDataMap( const LDOM_Element&, const LDOM_Element& );
63
64   Standard_EXPORT Standard_Boolean            AddDicItem( const TCollection_AsciiString&,
65                                                           const Handle(DDS_DicItem)& );
66
67   Standard_EXPORT Standard_Boolean            HasDicItem( const TCollection_AsciiString& ) const;
68
69   Standard_EXPORT void                        RemoveAllDicItems();
70
71   Standard_EXPORT const 
72     DDS_IndexedDataMapOfDicItems&             GetItemMap() const;
73
74   Standard_EXPORT Standard_Boolean            AddUnitSystem( const TCollection_AsciiString&,
75                                                              const TCollection_ExtendedString& );
76
77 protected:
78
79   typedef NCollection_DataMap<TCollection_AsciiString,
80                               TCollection_ExtendedString> UnitSystemMap;
81
82 private:
83   TCollection_AsciiString                    myName;
84   DDS_IndexedDataMapOfDicItems               myDataMap;
85   UnitSystemMap                              myUnitSystem;
86   TCollection_AsciiString                    myActiveSystem;
87   TColStd_SequenceOfAsciiString              myKeys;
88
89   friend class DDS_Dictionary;
90
91 public:
92   DEFINE_STANDARD_RTTI(DDS_DicGroup)
93 };
94
95 DEFINE_BASECOLLECTION(DDS_BaseCollectionOfDicGroups, Handle(DDS_DicGroup))
96 DEFINE_INDEXEDDATAMAP(DDS_IndexedDataMapOfDicGroups, DDS_BaseCollectionOfDicGroups,
97                       TCollection_AsciiString, Handle(DDS_DicGroup))
98
99 #endif