Salome HOME
bos #20661 EDF 22847 - Move to the end
[modules/shaper.git] / src / Config / Config_Prop.h
index fe64ca05886118dee592df0db576d5a69615a4e5..c807ea297fffcaccdf0789b2f426282315e3f37b 100644 (file)
@@ -1,17 +1,32 @@
-// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+//
+// 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, or (at your option) any later version.
+//
+// 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.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
-// File:        Config_Prop.h
-// Created:     12 Aug 2014
-// Author:      Vitaly SMETANNIKOV
-
-#ifndef Config_Prop_H
-#define Config_Prop_H
+#ifndef CONFIG_PROP_H
+#define CONFIG_PROP_H
 
 #include "Config_def.h"
 
 #include <string>
 #include <list>
 
+static const char SKETCH_TAB_NAME[] = "Sketch";
+
 /*!
  * \class Config_Prop
  * \brief Class which describes a one property
@@ -26,7 +41,7 @@ class Config_Prop
   {
     Disabled,
     Space,
-    Bool,
+    Boolean,
     Color,
     String,
     Selector,
@@ -45,18 +60,29 @@ class Config_Prop
     ShortcutTree,
     BiColor,
     Background,
-    Directory
+    Directory,
+    Cursor
+  };
+
+  enum CursorType
+  {
+    ArrowCursor,
+    CrossCursor,
+    HandCursor
   };
 
   /** 
    * Creates a one property
    * \param theSection - name of section (domain of using) of the property.
    * \param theName - name (title) of the value.
+   * \param theTitle - title of the value
    * \param theType - type of the value.
    * \param theDefaultValue - default value of the property. This is an initial property value
    */
   Config_Prop(const std::string& theSection, const std::string& theName,
-              const std::string& theTitle, PropType theType, const std::string& theDefaultValue)
+              const std::string& theTitle, PropType theType,
+              const std::string& theDefaultValue,
+              const std::string& theMin, const std::string& theMax)
   {
     mySection = theSection;
     myName = theName;
@@ -64,6 +90,8 @@ class Config_Prop
     myType = theType;
     myValue = theDefaultValue;
     myDefaultValue = theDefaultValue;
+    myMin = theMin;
+    myMax = theMax;
   }
 
   /// Get name of section
@@ -116,6 +144,20 @@ class Config_Prop
     return (mySection == theProp->section()) && (myName == theProp->name());
   }
 
+  /// Returns minimal value
+  std::string min() const { return myMin; }
+
+  void setMin(const std::string& theMin) {
+    myMin = theMin;
+  }
+
+  /// Returns maximal value
+  std::string max() const { return myMax; }
+
+  void setMax(const std::string& theMax) {
+    myMax = theMax;
+  }
+
  private:
   std::string mySection; ///< Name of section
   std::string myName; ///< Name of property
@@ -123,6 +165,8 @@ class Config_Prop
   PropType myType; ///< Type of property
   std::string myValue; // Value in string format
   std::string myDefaultValue; // Default value
+  std::string myMin; // Minimal value
+  std::string myMax; // Maximal value
 };
 
 typedef std::list<Config_Prop*> Config_Properties;