TextSelectionPopup follows Handles and button change with state and other improvements
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / shader-effects / carousel-effect.h
1 #ifndef __DALI_TOOLKIT_CAROUSEL_EFFECT_H__
2 #define __DALI_TOOLKIT_CAROUSEL_EFFECT_H__
3
4 /*
5  * Copyright (c) 2015 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/shader-effects/shader-effect.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 /**
31  * CarouselEffect is a custom shader effect to achieve Carousel effects in actors
32  *
33  * A Carousel has a Radius property which can be +ve (appear as if viewing from the outside of
34  * a cylinder/sphere)
35  * or -ve (appear as if viewing from the inside of a cylinder/sphere).
36  *
37  * It can be a horizontal or vertical (cylindrical) or both (spherical). The AnglePerUnit
38  * property provides this functionality as a Vector2.
39  *
40  * Finally, the carousel's center position can be specified as a Screen coordinate (top-left being
41  * the origin).
42  */
43 class DALI_IMPORT_API CarouselEffect : public ShaderEffect
44 {
45 public:
46
47   /**
48    * Create an uninitialized CarouselEffect; this can be initialized with CarouselEffect::New()
49    * Calling member functions with an uninitialized Dali::Object is not allowed.
50    */
51   CarouselEffect();
52
53   /**
54    * @brief Destructor
55    *
56    * This is non-virtual since derived Handle types must not contain data or virtual methods.
57    */
58   ~CarouselEffect();
59
60   /**
61    * Create an initialized CarouselEffect.
62    * @return A handle to a newly allocated Dali resource.
63    */
64   static CarouselEffect New();
65
66   /**
67    * Set the radius of the Carousel effect.
68    * A positive Radius will bend toward the camera,
69    * while a negative Radius will bend away from the camera.
70    * @param[in] radius The new radius.
71    */
72   void SetRadius( float radius);
73
74   /**
75    * Sets the center point of the carousel (in screen coordinates)
76    * this is where the peek of the carousel should appear.
77    * this defaults to top-left corner (0.0f, 0.0f).
78    *
79    * @param[in] center The center point.
80    */
81   void SetCenter( const Vector2& center );
82
83   /**
84    * Set the angle deviation of Carousel in degrees per
85    * geometric unit for each axis. For example if you
86    * wish for the horizontal angle deviation to vary from +/- 10
87    * degrees, then a Value of 20.0f / stageWidth for the X
88    * component should be specified.
89    *
90    * @param[in] angle the Angle Spread in X and Y axes.
91    */
92   void SetAnglePerUnit( const Vector2& angle );
93
94   /**
95    * Get the name for the radius property
96    * @return A std::string containing the property name
97    */
98   const std::string& GetRadiusPropertyName() const;
99
100   /**
101    * Get the name for the center property
102    * @return A std::string containing the property name
103    */
104   const std::string& GetCenterPropertyName() const;
105
106   /**
107    * Get the name for the angle spread property
108    * @return A std::string containing the property name
109    */
110   const std::string& GetAnglePerUnitPropertyName() const;
111
112
113 private: // Not intended for application developers
114   DALI_INTERNAL CarouselEffect(ShaderEffect handle);
115 };
116
117 } // namespace Toolkit
118
119 } // namespace Dali
120
121 #endif // __DALI_TOOLKIT_CAROUSEL_EFFECT_H__