Salome HOME
Merge branch 'master' into agy/NewPV1_For_850
[modules/gui.git] / src / DDS / DDS_KeyWords.cxx
index 8ea7f6a97915cee2a65e5b47ff203de93c76a243..db9796076b561b66a596bc23118285b86bb67a7f 100644 (file)
@@ -1,11 +1,14 @@
-// Copyright (C) 2005  CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D
+// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
 //
-// This library is distributed in the hope that it will be useful
+// This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Lesser General Public License for more details.
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 #include "DDS_KeyWords.h"
 
-IMPLEMENT_STANDARD_HANDLE(DDS_KeyWords, MMgt_TShared)
-IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, MMgt_TShared)
+IMPLEMENT_STANDARD_RTTIEXT(DDS_KeyWords, Standard_Transient)
+
+/*!
+  \class DDS_KeyWords
+  \brief This class defines the pairs of internal keys and XML tags or 
+  attributes names. 
+
+  This class allows user to define a set of XML keywords used in the datums
+  definition (XML) file.
 
+  Default keywords table:
+  - \c D_URI - dictionary
+  - \c COMPONENT - component
+  - \c COMPONENT_NAME - name
+  - \c UNIT_SYSTEMS - unitSystems
+  - \c UNIT_SYSTEM - system
+  - \c UNIT_SYSTEM_NAME - name
+  - \c UNIT_SYSTEM_LABEL - label
+  - \c DATUM - datum
+  - \c DATUM_ID - id
+  - \c DATUM_LABEL - label
+  - \c DATUM_UNITS - units
+  - \c DATUM_FORMAT - format
+  - \c DATUM_FILTER - filter
+  - \c DATUM_REQUIRED - required
+  - \c VALUE_LIST - valueList
+  - \c VALUE_LIST_ID - listid
+  - \c VALUE_LIST_NAME - name
+  - \c VALUE_LIST_TYPE - type
+  - \c VALUE_LIST_VALUE - value
+  - \c VALUE_LIST_VALUEID - id
+  - \c VALUE_LIST_VALUEICON - icon
+  - \c DY_DOMAIN - domain
+  - \c WARNING_LEVEL - warningLevel
+  - \c WRONG_VALUE - wrongValue
+  - \c VALUE_DESCR - valueDescr
+  - \c VALUE_LIST_REF - listRef
+  - \c DESCR - description
+  - \c LONG_D - longDescr
+  - \c SHORT_D - shortDescr
+  - \c VD_TYPE - type
+  - \c VD_DEFV - default
+  - \c VD_MAXV - max
+  - \c VD_MINV - min
+  - \c VD_SPEC - specVal
+  - \c VLR_LIST - list
+  - \c PRS - presentation
+  - \c LATERAL_ZOOM - lateralZoom
+  - \c LZ_MINV - min
+  - \c LZ_MAXV - max
+  - \c LZ_ORDER - order
+  - \c OPTIONS - options
+  - \c OPTION - option
+  - \c OPTION_NAME - name
+
+  There is the only instance of the class DDS_KeyWords in the application
+  which can be retrieved by method Get().
+*/
+
+/*!
+  \brief Constructor. 
+  Create an instance of the object. Can not be used directly.
+  Use Get() method instead.
+*/
 DDS_KeyWords::DDS_KeyWords()
-: MMgt_TShared()
+: Standard_Transient()
 {
   SetKeyWord( "D_URI",                "dictionary" );
 
@@ -71,8 +136,16 @@ DDS_KeyWords::DDS_KeyWords()
   SetKeyWord( "LZ_MINV",              "min" );
   SetKeyWord( "LZ_MAXV",              "max" );
   SetKeyWord( "LZ_ORDER",             "order" );
+
+  SetKeyWord( "OPTIONS",              "options" );
+  SetKeyWord( "OPTION",               "option" );
+  SetKeyWord( "OPTION_NAME",          "name" );
 }
 
+/*!
+  \brief Get the only instance of the class DDS_KeyWords.
+  \return the only instance of the class
+*/
 Handle(DDS_KeyWords) DDS_KeyWords::Get()
 {
   static Handle(DDS_KeyWords) keyWords;
@@ -83,6 +156,13 @@ Handle(DDS_KeyWords) DDS_KeyWords::Get()
   return keyWords;
 }
 
+/*!
+  \brief Get the XML keyword by specified internal key \a key.
+
+  If the internal key is not registered, empty string is returned.
+  \param key internal key
+  \return XML keyword 
+*/
 TCollection_AsciiString DDS_KeyWords::GetKeyWord( const TCollection_AsciiString& key ) const
 {
   TCollection_AsciiString keyWord;
@@ -91,6 +171,11 @@ TCollection_AsciiString DDS_KeyWords::GetKeyWord( const TCollection_AsciiString&
   return keyWord;
 }
 
+/*!
+  \brief Register the pair of the internal key \a key and XML keyword \a keyWord.
+  \param key internal key
+  \param keyWord XML keyword
+*/
 void DDS_KeyWords::SetKeyWord( const TCollection_AsciiString& key,
                                const TCollection_AsciiString& keyWord )
 {