#ifndef __DALI_TOOLKIT_SCROLL_BAR_H__
#define __DALI_TOOLKIT_SCROLL_BAR_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/dali.h>
static const char* const SCROLL_POSITION_NOTIFIED_SIGNAL_NAME; ///< "scroll-position-notified" signal name
typedef SignalV2< void ( float ) > ScrollPositionNotifiedSignalType;
+ // Properties
+ static const Property::Index PROPERTY_INDICATOR_HEIGHT_POLICY; ///< name "indicator-height-policy", @see SetIndicatorHeightPolicy(), type STRING
+ static const Property::Index PROPERTY_INDICATOR_FIXED_HEIGHT; ///< name "indicator-fixed-height", @see SetIndicatorFixedHeight(), type FLOAT
+ static const Property::Index PROPERTY_INDICATOR_SHOW_DURATION; ///< name "indicator-show-duration", @see SetIndicatorShowDuration(), type FLOAT
+ static const Property::Index PROPERTY_INDICATOR_HIDE_DURATION; ///< name "indicator-hide-duration", @see SetIndicatorHideDuration(), type FLOAT
+
public:
/**
+ * @brief Indicator height policy.
+ */
+ enum IndicatorHeightPolicy
+ {
+ Variable = 0, ///< Variable height changed dynamically according to the length of scroll content
+ Fixed ///< Fixed height regardless of the length of scroll content
+ };
+
+ /**
* @brief Create an uninitialized ScrollBar; this can be initialized with ScrollBar::New()
* Calling member functions with an uninitialized Dali::Object is not allowed.
* or horizontally (false)
ScrollBar& operator=( const ScrollBar& scrollBar );
/**
- * @brief 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 ~ScrollBar();
+ ~ScrollBar();
/**
* @brief Create an initialized ScrollBar
static ScrollBar DownCast( BaseHandle handle );
/**
- * @brief Sets the image for the background of scroll indicator.
- *
- * @pre The scroll bar actor has been initialised.
- *
- * The background image is resized (stretched according to scale settings),
- * to the size of the ScrollBar.
- *
- * @param[in] image The image to cover background
- * @param[in] border The nine patch border for the image.
- */
- void SetBackgroundImage( Image image, const Vector4& border );
-
- /**
* @brief Sets the image for the indicator of scroll bar.
*
* @pre The scroll bar actor has been initialised.
* of the scroll position.
*
* @param[in] image The image of indicator that moves to indicate the current scroll position.
- * @param[in] border The nine patch border for the image.
*/
- void SetIndicatorImage( Image image, const Vector4& border );
+ void SetIndicatorImage( Image image );
/**
* @brief Gets the indicator of scroll bar.
*
* @pre The scroll bar actor has been initialised.
*
- * The indicator indicates the current scroll position of the scrollable content.
+ * @return The indicator indicates the current scroll position of the scrollable content.
*/
Actor GetScrollIndicator();
void SetPositionNotifications( const std::vector<float>& positions );
/**
+ * @brief Sets the height policy of scroll indicator to have either variable or fixed height.
+ *
+ * @pre The scroll bar actor has been initialised.
+ *
+ * @param[in] policy The height policy of scroll indicator
+ */
+ void SetIndicatorHeightPolicy( IndicatorHeightPolicy policy );
+
+ /**
+ * @brief Gets the height policy of scroll indicator.
+ *
+ * @return The height policy of scroll indicator
+ */
+ IndicatorHeightPolicy GetIndicatorHeightPolicy();
+
+ /**
+ * @brief Sets the fixed height of scroll indicator.
+ * Normally the height of scroll indicator is changed dynamically according to the length of scroll content.
+ * However, when the height policy of scroll indicator is set to be fixed, the height will keep fixed
+ * regardless of the length of scroll content.
+ *
+ * @pre The scroll bar actor has been initialised.
+ *
+ * @param[in] height The fixed height of the scroll indicator
+ */
+ void SetIndicatorFixedHeight( float height );
+
+ /**
+ * @brief Gets the fix height of scroll indicator.
+ * @return The fixed height of the scroll indicator
+ */
+ float GetIndicatorFixedHeight();
+
+ /**
+ * @brief Sets the duration in second for the scroll indicator to become fully visible
+ *
+ * @pre The scroll bar actor has been initialised.
+ *
+ * @param[in] durationSeconds The duration for the scroll indicator to become fully visible
+ */
+ void SetIndicatorShowDuration( float durationSeconds );
+
+ /**
+ * @brief Gets the duration in second for the scroll indicator to become fully visible
+ * @return The duration for the scroll indicator to become fully visible
+ */
+ float GetIndicatorShowDuration();
+
+ /**
+ * @brief Sets the duration in second for the scroll indicator to become fully invisible
+ *
+ * @pre The scroll bar actor has been initialised.
+ *
+ * @param[in] durationSeconds The duration for the scroll indicator to become fully invisible
+ */
+ void SetIndicatorHideDuration( float durationSeconds );
+
+ /**
+ * @brief Gets the duration in second for the scroll indicator to become fully invisible
+ * @return The duration for the scroll indicator to become fully invisible
+ */
+ float GetIndicatorHideDuration();
+
+ /**
* @brief Shows the scroll indicator
*/
void Show();