Back to index

salome-gui  6.5.0
DDS_KeyWords.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 #include "DDS_KeyWords.h"
00024 
00025 IMPLEMENT_STANDARD_HANDLE(DDS_KeyWords, MMgt_TShared)
00026 IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, MMgt_TShared)
00027 
00090 DDS_KeyWords::DDS_KeyWords()
00091 : MMgt_TShared()
00092 {
00093   SetKeyWord( "D_URI",                "dictionary" );
00094 
00095   SetKeyWord( "COMPONENT",            "component" );
00096   SetKeyWord( "COMPONENT_NAME",       "name" );
00097 
00098   SetKeyWord( "UNIT_SYSTEMS",         "unitSystems" );
00099   SetKeyWord( "UNIT_SYSTEM",          "system" );
00100   SetKeyWord( "UNIT_SYSTEM_NAME",     "name" );
00101   SetKeyWord( "UNIT_SYSTEM_LABEL",    "label" );
00102 
00103   SetKeyWord( "DATUM",                "datum" );
00104   SetKeyWord( "DATUM_ID",             "id" );
00105   SetKeyWord( "DATUM_LABEL",          "label" );
00106   SetKeyWord( "DATUM_UNITS",          "units" );
00107   SetKeyWord( "DATUM_FORMAT",         "format" );
00108   SetKeyWord( "DATUM_FILTER",         "filter" );
00109   SetKeyWord( "DATUM_REQUIRED",       "required" );
00110 
00111   SetKeyWord( "VALUE_LIST",           "valueList" );
00112   SetKeyWord( "VALUE_LIST_ID",        "listid" );
00113   SetKeyWord( "VALUE_LIST_NAME",      "name" );
00114   SetKeyWord( "VALUE_LIST_TYPE",      "type" );
00115   SetKeyWord( "VALUE_LIST_VALUE",     "value" );
00116   SetKeyWord( "VALUE_LIST_VALUEID",   "id" );
00117   SetKeyWord( "VALUE_LIST_VALUEICON", "icon" );
00118 
00119   SetKeyWord( "DY_DOMAIN",            "domain" );
00120   SetKeyWord( "WARNING_LEVEL",        "warningLevel" );
00121   SetKeyWord( "WRONG_VALUE",          "wrongValue" );
00122   SetKeyWord( "VALUE_DESCR",          "valueDescr" );
00123   SetKeyWord( "VALUE_LIST_REF",       "listRef" );
00124 
00125   SetKeyWord( "DESCR",                "description" );
00126   SetKeyWord( "LONG_D",               "longDescr" );
00127   SetKeyWord( "SHORT_D",              "shortDescr" );
00128 
00129   SetKeyWord( "VD_TYPE",              "type" );
00130   SetKeyWord( "VD_DEFV",              "default" );
00131   SetKeyWord( "VD_MAXV",              "max" );
00132   SetKeyWord( "VD_MINV",              "min" );
00133   SetKeyWord( "VD_SPEC",              "specVal" );
00134   SetKeyWord( "VLR_LIST",             "list" );
00135   SetKeyWord( "PRS",                  "presentation" );
00136   SetKeyWord( "LATERAL_ZOOM",         "lateralZoom" );
00137   SetKeyWord( "LZ_MINV",              "min" );
00138   SetKeyWord( "LZ_MAXV",              "max" );
00139   SetKeyWord( "LZ_ORDER",             "order" );
00140 
00141   SetKeyWord( "OPTIONS",              "options" );
00142   SetKeyWord( "OPTION",               "option" );
00143   SetKeyWord( "OPTION_NAME",          "name" );
00144 }
00145 
00150 Handle_DDS_KeyWords DDS_KeyWords::Get()
00151 {
00152   static Handle(DDS_KeyWords) keyWords;
00153 
00154   if ( keyWords.IsNull() )
00155     keyWords = new DDS_KeyWords();
00156 
00157   return keyWords;
00158 }
00159 
00167 TCollection_AsciiString DDS_KeyWords::GetKeyWord( const TCollection_AsciiString& key ) const
00168 {
00169   TCollection_AsciiString keyWord;
00170   if ( myKeyWord.IsBound( key ) )
00171     keyWord = myKeyWord.Find( key );
00172   return keyWord;
00173 }
00174 
00180 void DDS_KeyWords::SetKeyWord( const TCollection_AsciiString& key,
00181                                const TCollection_AsciiString& keyWord )
00182 {
00183   if ( myKeyWord.IsBound( key ) )
00184     myKeyWord.UnBind( key );
00185 
00186   myKeyWord.Bind( key, keyWord );
00187 }