[dali_2.1.0] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / controls / scrollable / scroll-view / scroll-view-impl-property-handler.h
1 #ifndef DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_IMPL_PROPERTY_HANDLER_H
2 #define DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_IMPL_PROPERTY_HANDLER_H
3
4 /*
5  * Copyright (c) 2021 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/base-object.h>
23 #include <dali/public-api/object/property.h>
24
25 namespace Dali::Toolkit::Internal
26 {
27 class ScrollView;
28
29 /// Handles the properties in scroll view calling the appropriate scroll view methods
30 struct ScrollViewPropertyHandler
31 {
32   /**
33    * @brief Sets the property on the given scroll-view object.
34    *
35    * @param object The scrollview object
36    * @param index The index to set
37    * @param value The value to set
38    */
39   static void Set(BaseObject* object, Property::Index index, const Property::Value& value);
40
41   /**
42    * @brief Retrieves the value of a scroll-view property.
43    *
44    * @param object The scrollview object
45    * @param index The index whose value is to be retrieved
46    * @return
47    */
48   static Property::Value Get(BaseObject* object, Property::Index index);
49
50   /**
51    * Set up default rulers using a property map
52    * @param[in] scrollView    The scroll view to apply this on
53    * @param[in] scrollModeMap A map defining the characteristics of X and Y scrolling
54    * using either FixedRuler or DefaultRuler.
55    */
56   static void SetScrollMode(ScrollView& scrollView, const Property::Map& scrollModeMap);
57
58   /**
59    * This is called whenever the Scroll Rulers are modified.
60    *
61    * This will update the properties: 'scrollPositionMin' * and 'scrollPositionMax' to reflect the changes.
62    * @param scrollView The Scroll View to modify
63    */
64   static void UpdatePropertyDomain(ScrollView& scrollView);
65 };
66
67 } // namespace Dali::Toolkit::Internal
68
69 #endif // DALI_TOOLKIT_INTERNAL_SCROLL_VIEW_IMPL_PROPERTY_HANDLER_H