More ItemView Insert/Remove/Replace APIs
[platform/core/uifw/dali-toolkit.git] / capi / dali-toolkit / public-api / shader-effects / page-turn-book-spine-effect.h
1 #ifndef __DALI_PAGE_TURN_BOOK_SPINE_EFFECT_H__
2 #define __DALI_PAGE_TURN_BOOK_SPINE_EFFECT_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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  * @addtogroup CAPI_DALI_FRAMEWORK
22  * @{
23  */
24
25 // INTERNAL INCLUDES
26 #include <dali/dali.h>
27
28 namespace Dali DALI_IMPORT_API
29 {
30
31 namespace Toolkit
32 {
33 /**
34  * It is an assisting effect of PageTurnEffect to display book spine on STATIC pages, and also flip the image horizontally when needed.
35  * When the page is turned over in landscape, call SetIsBackImageVisible(true), this effect can display the back image correctly after the imageActor been rotated 180 degrees.
36  * To display the pages visually consistent with its turning state, please set the uniforms with the same values as the PageTurnEffect
37  **/
38 class PageTurnBookSpineEffect : public ShaderEffect
39 {
40 public:
41   /**
42    * Create an uninitialized PageTurnBookSpineEffect; this can be initialized with PageTurnBookSpineEffect::New()
43    * Calling member functions with an uninitialized Dali::Object is not allowed.
44    */
45   PageTurnBookSpineEffect();
46
47   /**
48    * Virtual destructor.
49    */
50   virtual ~PageTurnBookSpineEffect();
51
52   /**
53    * Create an initialized PageTurnBookSpineEffect.
54    * @return A handle to a newly allocated Dali resource.
55    */
56   static PageTurnBookSpineEffect New();
57
58   /**
59    * Set whether the current page is with its backside visible
60    * Need to pass the parameter as true for the page which is turned over but still visible in Landscape
61    * @param [in] isBackVisible True for page with its backside upwards
62    */
63   void SetIsBackImageVisible( bool isBackVisible );
64
65   /**
66    * Set the page width of the PageTurnBookSpineEffect.
67    * @param [in] pageWidth The width of the page size.
68    */
69   void SetPageWidth( float pageWidth );
70
71   /**
72    * Set the width of shadow to be pageSize * shadowWidth
73    * this shadow appears at the edges of the actor which is not visible on static pages
74    * @param [in] shadowWidth The width for the simulated shadow
75    */
76   void SetShadowWidth( float shadowWidth );
77
78   /**
79    * Set the spine shadow parameter
80    * The two parameters are the major&minor radius (in pixels) to form an ellipse shape
81    * The top-left quarter of this ellipse is used to calculate spine normal for simulating shadow
82    * @param [in] spineShadowParameter The major&minor ellipse radius for the simulated spine shadow
83    */
84   void SetSpineShadowParameter( const Vector2& spineShadowParameter );
85
86
87 private:// Helper for New()
88   PageTurnBookSpineEffect( ShaderEffect handle );
89
90 }; // End of PageTurnBookSpineEffect class
91
92 } // namespace Toolkit
93
94 } // namespace Dali
95
96 /**
97  * @}
98  */
99 #endif /* __DALI_PAGE_TURN_BOOK_SPINE_EFFECT_H__ */