X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fslider%2Fslider.h;h=7b9ae6b85e00a2ddad93045e5cc5839fd941a1f7;hp=c5dc76fd8fd88e69cac1dc03d01df8d3badc7b5c;hb=b8c6f35737d76c86fe9e7b4f443a3682f718f29c;hpb=2f39909cd5a858fe940936258ee6f558073d33f0 diff --git a/dali-toolkit/public-api/controls/slider/slider.h b/dali-toolkit/public-api/controls/slider/slider.h index c5dc76f..7b9ae6b 100644 --- a/dali-toolkit/public-api/controls/slider/slider.h +++ b/dali-toolkit/public-api/controls/slider/slider.h @@ -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 -namespace Dali DALI_IMPORT_API +namespace Dali { namespace Toolkit @@ -32,48 +33,56 @@ 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 + * + * Signals + * | %Signal Name | Method | + * |-------------------|-----------------------------| + * | value-changed | @ref ValueChangedSignal() | + * | mark | @ref MarkSignal() | */ -class Slider : public Control +class DALI_IMPORT_API Slider : public Control { public: - //Signal Names - static const char* const SIGNAL_VALUE_CHANGED; - 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 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 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 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 std::string VALUE_PRECISION_PROPERTY_NAME; ///< 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 std::string ENABLED_PROPERTY_NAME; ///< Property, name "enabled", type BOOLEAN + /** + * @brief The start and end property ranges for this control. + */ + enum PropertyRange + { + PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1, + PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserving 1000 property indices + }; - static const std::string MARKS_PROPERTY_NAME; ///< Property, name "marks", type Property::Array - 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 + /** + * @brief An enumeration of properties belonging to the Slider class. + */ + struct Property + { + enum + { + LOWER_BOUND = PROPERTY_START_INDEX, ///< Property, name "lower-bound", type float + UPPER_BOUND, ///< Property, name "upper-bound", type float + VALUE, ///< Property, name "value", type float + HIT_REGION, ///< Property, name "hit-region", type Vector2 + BACKING_REGION, ///< Property, name "backing-region", type Vector2 + HANDLE_REGION, ///< Property, name "handle-region", type Vector2 + BACKING_IMAGE_NAME, ///< Property, name "backing-image-name", type std::string + HANDLE_IMAGE_NAME, ///< Property, name "handle-image-name", type std::string + PROGRESS_IMAGE_NAME, ///< Property, name "progress-image-name", type std::string + POPUP_IMAGE_NAME, ///< Property, name "popup-image-name", type std::string + POPUP_ARROW_IMAGE_NAME, ///< Property, name "popup-arrow-image-name", type std::string + DISABLE_COLOR, ///< Property, name "disable-color", type Vector4 + POPUP_TEXT_COLOR, ///< Property, name "popup-text-color", type Vector4 + VALUE_PRECISION, ///< Property, name "value-precision", type int + SHOW_POPUP, ///< Property, name "show-popup", type bool + SHOW_VALUE, ///< Property, name "show-value", type bool + ENABLED, ///< Property, name "enabled", type bool + MARKS, ///< Property, name "marks", type Property::Array + SNAP_TO_MARKS, ///< Property, name "snap-to-marks", type bool + MARK_TOLERANCE, ///< Property, name "mark-tolerance", type float + }; + }; public: @@ -99,10 +108,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 +127,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 +151,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