DALi signals refactor to remove V2 naming
[platform/core/uifw/dali-toolkit.git] / optional / dali-toolkit / public-api / controls / slider / slider.h
index c5dc76f..1a382bd 100644 (file)
@@ -1,26 +1,27 @@
 #ifndef __DALI_TOOLKIT_SLIDER_H__
 #define __DALI_TOOLKIT_SLIDER_H__
 
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
 
-namespace Dali DALI_IMPORT_API
+namespace Dali
 {
 
 namespace Toolkit
@@ -32,9 +33,9 @@ class Slider;
 }
 
 /**
- * Slider is a control to enable sliding an indicator between two values
+ * @brief Slider is a control to enable sliding an indicator between two values
  */
-class Slider : public Control
+class DALI_IMPORT_API Slider : public Control
 {
 public:
 
@@ -43,37 +44,33 @@ public:
   static const char* const SIGNAL_MARK;
 
   // Properties
-  static const std::string LOWER_BOUND_PROPERTY_NAME;           ///< Property, name "lower-bound",       type FLOAT
-  static const std::string UPPER_BOUND_PROPERTY_NAME;           ///< Property, name "upper-bound",       type FLOAT
-  static const std::string VALUE_PROPERTY_NAME;                 ///< Property, name "value",             type FLOAT
-
-  static const std::string HIT_REGION_PROPERTY_NAME;            ///< Property, name "hit-region",        type VECTOR2
-  static const std::string BACKING_REGION_PROPERTY_NAME;        ///< Property, name "backing-region",    type VECTOR2
-  static const std::string HANDLE_REGION_PROPERTY_NAME;         ///< Property, name "handle-region",     type VECTOR2
+  static const Property::Index LOWER_BOUND_PROPERTY;            ///< Property, name "lower-bound",       type FLOAT
+  static const Property::Index UPPER_BOUND_PROPERTY;            ///< Property, name "upper-bound",       type FLOAT
+  static const Property::Index VALUE_PROPERTY;                  ///< Property, name "value",             type FLOAT
 
-  static const std::string BACKING_IMAGE_NAME_PROPERTY_NAME;    ///< Property, name "backing-image-name",  type std::string
-  static const std::string HANDLE_IMAGE_NAME_PROPERTY_NAME;     ///< Property, name "handle-image-name",   type std::string
-  static const std::string PROGRESS_IMAGE_NAME_PROPERTY_NAME;   ///< Property, name "progress-image-name", type std::string
-  static const std::string POPUP_IMAGE_NAME_PROPERTY_NAME;      ///< Property, name "popup-image-name",    type std::string
-  static const std::string POPUP_ARROW_IMAGE_NAME_PROPERTY_NAME; ///< Property, name "popup-arrow-image-name", type std::string
+  static const Property::Index HIT_REGION_PROPERTY;             ///< Property, name "hit-region",        type VECTOR2
+  static const Property::Index BACKING_REGION_PROPERTY;         ///< Property, name "backing-region",    type VECTOR2
+  static const Property::Index HANDLE_REGION_PROPERTY;          ///< Property, name "handle-region",     type VECTOR2
 
-  static const std::string BACKING_SCALE9_BORDER_PROPERTY_NAME;  ///< Property, name "backing-scale9-border",  type VECTOR4
-  static const std::string PROGRESS_SCALE9_BORDER_PROPERTY_NAME; ///< Property, name "progress-scale9-border", type VECTOR4
-  static const std::string POPUP_SCALE9_BORDER_PROPERTY_NAME;    ///< Property, name "popup-scale9-border",    type VECTOR4
+  static const Property::Index BACKING_IMAGE_NAME_PROPERTY;     ///< Property, name "backing-image-name",  type STRING
+  static const Property::Index HANDLE_IMAGE_NAME_PROPERTY;      ///< Property, name "handle-image-name",   type STRING
+  static const Property::Index PROGRESS_IMAGE_NAME_PROPERTY;    ///< Property, name "progress-image-name", type STRING
+  static const Property::Index POPUP_IMAGE_NAME_PROPERTY;       ///< Property, name "popup-image-name",    type STRING
+  static const Property::Index POPUP_ARROW_IMAGE_NAME_PROPERTY; ///< Property, name "popup-arrow-image-name", type STRING
 
-  static const std::string DISABLE_COLOR_PROPERTY_NAME;          ///< Property, name "disable-color",    type VECTOR4
-  static const std::string POPUP_TEXT_COLOR_PROPERTY_NAME;       ///< Property, name "popup-text-color", type VECTOR4
+  static const Property::Index DISABLE_COLOR_PROPERTY;          ///< Property, name "disable-color",    type VECTOR4
+  static const Property::Index POPUP_TEXT_COLOR_PROPERTY;       ///< Property, name "popup-text-color", type VECTOR4
 
-  static const std::string VALUE_PRECISION_PROPERTY_NAME;        ///< Property, name "value-precision",  type INT
+  static const Property::Index VALUE_PRECISION_PROPERTY;        ///< Property, name "value-precision",  type INT
 
-  static const std::string SHOW_POPUP_PROPERTY_NAME;             ///< Property, name "show-popup",       type BOOLEAN
-  static const std::string SHOW_VALUE_PROPERTY_NAME;             ///< Property, name "show-value",       type BOOLEAN
+  static const Property::Index SHOW_POPUP_PROPERTY;             ///< Property, name "show-popup",       type BOOLEAN
+  static const Property::Index SHOW_VALUE_PROPERTY;             ///< Property, name "show-value",       type BOOLEAN
 
-  static const std::string ENABLED_PROPERTY_NAME;                ///< Property, name "enabled",          type BOOLEAN
+  static const Property::Index ENABLED_PROPERTY;                ///< Property, name "enabled",          type BOOLEAN
 
-  static const std::string MARKS_PROPERTY_NAME;                  ///< Property, name "marks",            type Property::Array<float>
-  static const std::string SNAP_TO_MARKS_PROPERTY_NAME;          ///< Property, name "snap-to-marks",    type BOOLEAN
-  static const std::string MARK_TOLERANCE_PROPERTY_NAME;         ///< Property, name "mark-tolerance",   type FLOAT
+  static const Property::Index MARKS_PROPERTY;                  ///< Property, name "marks",            type Property::Array<float>
+  static const Property::Index SNAP_TO_MARKS_PROPERTY;          ///< Property, name "snap-to-marks",    type BOOLEAN
+  static const Property::Index MARK_TOLERANCE_PROPERTY;         ///< Property, name "mark-tolerance",   type FLOAT
 
 public:
 
@@ -99,10 +96,11 @@ public:
   Slider& operator=( const Slider& handle );
 
   /**
-   * Virtual destructor.
-   * Dali::Object derived classes typically do not contain member data.
+   * @brief Destructor
+   *
+   * This is non-virtual since derived Handle types must not contain data or virtual methods.
    */
-  virtual ~Slider();
+  ~Slider();
 
   /**
    * Downcast an Object handle to Slider. If handle points to a Slider the
@@ -117,8 +115,8 @@ public:
   // Signals
 
   // Value changed
-  typedef SignalV2< bool ( Slider, float ) > ValueChangedSignalType;
-  typedef SignalV2< bool ( Slider, int ) > MarkSignalType;
+  typedef Signal< bool ( Slider, float ) > ValueChangedSignalType;
+  typedef Signal< bool ( Slider, int ) > MarkSignalType;
 
   /**
    * Signal emitted when the slider value changes
@@ -141,13 +139,13 @@ public: // Not intended for application developers
    * Creates a handle using the Toolkit::Internal implementation.
    * @param[in]  implementation  The Control implementation.
    */
-  Slider(Internal::Slider& implementation);
+  DALI_INTERNAL Slider(Internal::Slider& implementation);
 
   /**
    * Allows the creation of this Control from an Internal::CustomActor pointer.
    * @param[in]  internal  A pointer to the internal CustomActor.
    */
-  Slider( Dali::Internal::CustomActor* internal );
+  explicit DALI_INTERNAL Slider( Dali::Internal::CustomActor* internal );
 };
 
 } // namespace Toolkit