]> SALOME platform Git repositories - modules/gui.git/blob - src/DDS/DDS_KeyWords.cxx
Salome HOME
42ffad97d024b2823c2518b508d8ccf092d377cb
[modules/gui.git] / src / DDS / DDS_KeyWords.cxx
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 #include "DDS_KeyWords.h"
20
21 IMPLEMENT_STANDARD_HANDLE(DDS_KeyWords, MMgt_TShared)
22 IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, MMgt_TShared)
23
24 DDS_KeyWords::DDS_KeyWords()
25 : MMgt_TShared()
26 {
27   SetKeyWord( "D_URI",                "dictionary" );
28
29   SetKeyWord( "COMPONENT",            "component" );
30   SetKeyWord( "COMPONENT_NAME",       "name" );
31
32   SetKeyWord( "UNIT_SYSTEMS",         "unitSystems" );
33   SetKeyWord( "UNIT_SYSTEM",          "system" );
34   SetKeyWord( "UNIT_SYSTEM_NAME",     "name" );
35   SetKeyWord( "UNIT_SYSTEM_LABEL",    "label" );
36
37   SetKeyWord( "DATUM",                "datum" );
38   SetKeyWord( "DATUM_ID",             "id" );
39   SetKeyWord( "DATUM_LABEL",          "label" );
40   SetKeyWord( "DATUM_UNITS",          "units" );
41   SetKeyWord( "DATUM_FORMAT",         "format" );
42   SetKeyWord( "DATUM_FILTER",         "filter" );
43   SetKeyWord( "DATUM_REQUIRED",       "required" );
44
45   SetKeyWord( "VALUE_LIST",           "valueList" );
46   SetKeyWord( "VALUE_LIST_ID",        "listid" );
47   SetKeyWord( "VALUE_LIST_NAME",      "name" );
48   SetKeyWord( "VALUE_LIST_TYPE",      "type" );
49   SetKeyWord( "VALUE_LIST_VALUE",     "value" );
50   SetKeyWord( "VALUE_LIST_VALUEID",   "id" );
51   SetKeyWord( "VALUE_LIST_VALUEICON", "icon" );
52
53   SetKeyWord( "DY_DOMAIN",            "domain" );
54   SetKeyWord( "WARNING_LEVEL",        "warningLevel" );
55   SetKeyWord( "WRONG_VALUE",          "wrongValue" );
56   SetKeyWord( "VALUE_DESCR",          "valueDescr" );
57   SetKeyWord( "VALUE_LIST_REF",       "listRef" );
58
59   SetKeyWord( "DESCR",                "description" );
60   SetKeyWord( "LONG_D",               "longDescr" );
61   SetKeyWord( "SHORT_D",              "shortDescr" );
62
63   SetKeyWord( "VD_TYPE",              "type" );
64   SetKeyWord( "VD_DEFV",              "default" );
65   SetKeyWord( "VD_MAXV",              "max" );
66   SetKeyWord( "VD_MINV",              "min" );
67   SetKeyWord( "VD_SPEC",              "specVal" );
68   SetKeyWord( "VLR_LIST",             "list" );
69   SetKeyWord( "PRS",                  "presentation" );
70   SetKeyWord( "LATERAL_ZOOM",         "lateralZoom" );
71   SetKeyWord( "LZ_MINV",              "min" );
72   SetKeyWord( "LZ_MAXV",              "max" );
73   SetKeyWord( "LZ_ORDER",             "order" );
74 }
75
76 Handle(DDS_KeyWords) DDS_KeyWords::Get()
77 {
78   static Handle(DDS_KeyWords) keyWords;
79
80   if ( keyWords.IsNull() )
81     keyWords = new DDS_KeyWords();
82
83   return keyWords;
84 }
85
86 TCollection_AsciiString DDS_KeyWords::GetKeyWord( const TCollection_AsciiString& key ) const
87 {
88   TCollection_AsciiString keyWord;
89   if ( myKeyWord.IsBound( key ) )
90     keyWord = myKeyWord.Find( key );
91   return keyWord;
92 }
93
94 void DDS_KeyWords::SetKeyWord( const TCollection_AsciiString& key,
95                                const TCollection_AsciiString& keyWord )
96 {
97   if ( myKeyWord.IsBound( key ) )
98     myKeyWord.UnBind( key );
99
100   myKeyWord.Bind( key, keyWord );
101 }