Conversion to Apache 2.0 license
[platform/core/uifw/dali-toolkit.git] / capi / dali-toolkit / public-api / controls / scrollable / scroll-connector.h
index fad7fb2..c8ac206 100644 (file)
@@ -1,21 +1,27 @@
 #ifndef __DALI_TOOLKIT_SCROLL_CONNECTOR_H__
 #define __DALI_TOOLKIT_SCROLL_CONNECTOR_H__
 
 #ifndef __DALI_TOOLKIT_SCROLL_CONNECTOR_H__
 #define __DALI_TOOLKIT_SCROLL_CONNECTOR_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.
+ *
+ */
+
+/**
+ * @addtogroup CAPI_DALI_TOOLKIT_SCROLL_CONNECTOR_MODULE
+ * @{
+ */
 
 // INTERNAL INCLUDES
 #include <dali/dali.h>
 
 // INTERNAL INCLUDES
 #include <dali/dali.h>
@@ -37,23 +43,32 @@ class ScrollConnector;
  * This basically consists of:
  *   - A "scroll-position" property which controls which part of the scrollable content is visible
  *   - The minimum/maximum limits of the scroll position, which corresponds to the start & end points of the scollable list etc.
  * This basically consists of:
  *   - A "scroll-position" property which controls which part of the scrollable content is visible
  *   - The minimum/maximum limits of the scroll position, which corresponds to the start & end points of the scollable list etc.
+ *   - An "overshoot" property which shows any attempts to exceed the start & end points.
+ *   - The scrollable content size, which corresponds to the length of the scrollable content in the scrollable container in actor coordinates.
  *
  *
- * The provider of the scrollable content is responsible for calling SetLimits(). Scroll-bar components are then expected to
- * receive these values via the LIMITS_CHANGED signal.
+ * The provider of the scrollable content is responsible for calling SetScrollDomain(). Scroll-bar components are then expected to
+ * receive these values via the DOMAIN_CHANGED signal.
  *
  * The scroll-position property is accessible via GetScrollPositionObject(). This is intended to be shared by multiple controls
  * e.g. a list control may be scrolled by panning the list content, or indirectly by dragging a connected scroll-bar control.
  *
  * The scroll-position property is accessible via GetScrollPositionObject(). This is intended to be shared by multiple controls
  * e.g. a list control may be scrolled by panning the list content, or indirectly by dragging a connected scroll-bar control.
+ *
+ * The overshoot property is intended for implementing 'end of list' style indicators. This property is expected to be in the range
+ * -1 to 1, where -1 shows an attempt the scroll beyond the minimum limit, and 1 shows an attempt the scroll beyond the maximum limit.
+ * Zero indicates normal scrolling i.e. when overshoot indicators should be hidden.
  */
 class ScrollConnector : public BaseHandle
 {
 public:
 
   static const char* const SCROLL_POSITION_PROPERTY_NAME; ///< This float "scroll-position" property is available via GetScrollPositionObject()
  */
 class ScrollConnector : public BaseHandle
 {
 public:
 
   static const char* const SCROLL_POSITION_PROPERTY_NAME; ///< This float "scroll-position" property is available via GetScrollPositionObject()
+  static const char* const OVERSHOOT_PROPERTY_NAME;       ///< This float "overshoot" property is available via GetScrollPositionObject()
+
   static const Property::Index SCROLL_POSITION;           ///< The index of the "scroll-position" property
   static const Property::Index SCROLL_POSITION;           ///< The index of the "scroll-position" property
+  static const Property::Index OVERSHOOT;                 ///< The index of the "overshoot" property
 
   // Signals
 
   // Signals
-  static const char* const LIMITS_CHANGED_SIGNAL_NAME;    ///< "limits-changed" signal name
-  typedef SignalV2< void ( float min, float max ) > LimitsChangedSignalType;
+  static const char* const DOMAIN_CHANGED_SIGNAL_NAME;    ///< "domain-changed" signal name
+  typedef SignalV2< void ( float min, float max, float size ) > DomainChangedSignalType;
 
   /**
    * Create a ScrollConnector.
 
   /**
    * Create a ScrollConnector.
@@ -89,11 +104,12 @@ public:
   static ScrollConnector DownCast( BaseHandle handle );
 
   /**
   static ScrollConnector DownCast( BaseHandle handle );
 
   /**
-   * Set The min/max values, corresponding to the start & end position of the scrollable content.
-   * @param[in] min The minimum value.
-   * @param[in] max The maximum value.
+   * Set the scroll domain, corresponding to the start & end position, and size of the scrollable content in actor coordinates.
+   * @param[in] min The minimum scroll position limit.
+   * @param[in] max The maximum scroll position limit.
+   * @param[in] length The length of the scrollable content in actor coordinates.
    */
    */
-  void SetLimits( float min, float max );
+  void SetScrollDomain( float min, float max, float length );
 
   /**
    * Retrieve the min limit.
 
   /**
    * Retrieve the min limit.
@@ -108,9 +124,15 @@ public:
   float GetMaxLimit() const;
 
   /**
   float GetMaxLimit() const;
 
   /**
-   * Signal emitted after the SetLimits() method has been called.
+   * Retrieve the length of the scrollable content in actor coordinates.
+   * @return The length of the scrollable content.
+   */
+  float GetContentLength() const;
+
+  /**
+   * Signal emitted after the SetScrollDomain() method has been called.
    */
    */
-  ScrollConnector::LimitsChangedSignalType& LimitsChangedSignal();
+  ScrollConnector::DomainChangedSignalType& DomainChangedSignal();
 
   /**
    * Retrieve the object which provides the "scroll-position" property.
 
   /**
    * Retrieve the object which provides the "scroll-position" property.
@@ -131,4 +153,8 @@ public: // Not intended for application developers
 
 } // namespace Dali
 
 
 } // namespace Dali
 
+/**
+ * @}
+ */
+
 #endif // __DALI_TOOLKIT_SCROLL_CONNECTOR_H__
 #endif // __DALI_TOOLKIT_SCROLL_CONNECTOR_H__