Updated CAPI documentation style
[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_TOOLKIT_SHADER_EFFECTS_MODULE
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  * @brief This is an assisting effect of PageTurnEffect to display a book spine on _static_ pages, and also to flip the image horizontally when needed.
35  *
36  * When the page is turned over in landscape, call
37  * SetIsBackImageVisible(true), this effect can display the back image
38  * correctly after the imageActor been rotated 180 degrees.  To
39  * display the pages visually consistent with its turning state,
40  * please set the uniforms with the same values as the PageTurnEffect.
41  **/
42 class PageTurnBookSpineEffect : public ShaderEffect
43 {
44 public:
45   /**
46    * @brief Create an uninitialized PageTurnBookSpineEffect; this can be initialized with PageTurnBookSpineEffect::New().
47    *
48    * Calling member functions with an uninitialized Dali::Object is not allowed.
49    */
50   PageTurnBookSpineEffect();
51
52   /**
53    * @brief Virtual destructor.
54    */
55   virtual ~PageTurnBookSpineEffect();
56
57   /**
58    * @brief Create an initialized PageTurnBookSpineEffect.
59    *
60    * @return A handle to a newly allocated Dali resource.
61    */
62   static PageTurnBookSpineEffect New();
63
64   /**
65    * @brief Set whether the current page is with its backside visible.
66    *
67    * Need to pass the parameter as true for the page which is turned over but still visible in Landscape
68    * @param [in] isBackVisible True for page with its backside upwards
69    */
70   void SetIsBackImageVisible( bool isBackVisible );
71
72   /**
73    * @brief Set the page width of the PageTurnBookSpineEffect.
74    *
75    * @param [in] pageWidth The width of the page size.
76    */
77   void SetPageWidth( float pageWidth );
78
79   /**
80    * @brief Set the width of shadow to be pageSize * shadowWidth.
81    *
82    * this shadow appears at the edges of the actor which is not visible on static pages
83    * @param [in] shadowWidth The width for the simulated shadow
84    */
85   void SetShadowWidth( float shadowWidth );
86
87   /**
88    * @brief Set the spine shadow parameter.
89    *
90    * The two parameters are the major&minor radius (in pixels) to form an ellipse shape
91    * The top-left quarter of this ellipse is used to calculate spine normal for simulating shadow
92    * @param [in] spineShadowParameter The major&minor ellipse radius for the simulated spine shadow
93    */
94   void SetSpineShadowParameter( const Vector2& spineShadowParameter );
95
96
97 private:// Helper for New()
98   PageTurnBookSpineEffect( ShaderEffect handle );
99
100 }; // End of PageTurnBookSpineEffect class
101
102 } // namespace Toolkit
103
104 } // namespace Dali
105
106 /**
107  * @}
108  */
109 #endif /* __DALI_PAGE_TURN_BOOK_SPINE_EFFECT_H__ */