Merge "Fix a heap-buffer-overflow issue." into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / atspi-interfaces / value.h
index 69bba32..6c9a963 100644 (file)
@@ -33,21 +33,21 @@ public:
    *
    * @return The minimum value
   */
-  virtual double GetMinimum() = 0;
+  virtual double GetMinimum() const = 0;
 
   /**
    * @brief Gets the current value.
    *
    * @return The current value
   */
-  virtual double GetCurrent() = 0;
+  virtual double GetCurrent() const = 0;
 
   /**
    * @brief Gets the highest possible value.
    *
    * @return The highest value.
   */
-  virtual double GetMaximum() = 0;
+  virtual double GetMaximum() const = 0;
 
   /**
    * @brief Sets the current value.
@@ -63,8 +63,32 @@ public:
    *
    * @return The lowest increment
   */
-  virtual double GetMinimumIncrement() = 0;
+  virtual double GetMinimumIncrement() const = 0;
+
+  /**
+   * @brief Downcasts an Accessible to a Value.
+   *
+   * @param obj The Accessible
+   * @return A Value or null
+   *
+   * @see Dali::Accessibility::Accessible::DownCast()
+   */
+  static inline Value* DownCast(Accessible* obj);
+};
+
+namespace Internal
+{
+template<>
+struct AtspiInterfaceTypeHelper<AtspiInterface::VALUE>
+{
+  using Type = Value;
 };
+} // namespace Internal
+
+inline Value* Value::DownCast(Accessible* obj)
+{
+  return Accessible::DownCast<AtspiInterface::VALUE>(obj);
+}
 
 } // namespace Dali::Accessibility