Make radio buttons work with size negotiation, bug fixes.
[platform/core/uifw/dali-toolkit.git] / base / 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 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 // INTERNAL INCLUDES
22 #include <dali/dali.h>
23
24 namespace Dali DALI_IMPORT_API
25 {
26
27 namespace Toolkit
28 {
29 /**
30  * @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.
31  *
32  * When the page is turned over in landscape, call
33  * SetIsBackImageVisible(true), this effect can display the back image
34  * correctly after the imageActor been rotated 180 degrees.  To
35  * display the pages visually consistent with its turning state,
36  * please set the uniforms with the same values as the PageTurnEffect.
37  **/
38 class PageTurnBookSpineEffect : public ShaderEffect
39 {
40 public:
41   /**
42    * @brief Create an uninitialized PageTurnBookSpineEffect; this can be initialized with PageTurnBookSpineEffect::New().
43    *
44    * Calling member functions with an uninitialized Dali::Object is not allowed.
45    */
46   PageTurnBookSpineEffect();
47
48   /**
49    * @brief Destructor
50    *
51    * This is non-virtual since derived Handle types must not contain data or virtual methods.
52    */
53   ~PageTurnBookSpineEffect();
54
55   /**
56    * @brief Create an initialized PageTurnBookSpineEffect.
57    *
58    * @return A handle to a newly allocated Dali resource.
59    */
60   static PageTurnBookSpineEffect New();
61
62   /**
63    * @brief Set whether the current page is with its backside visible.
64    *
65    * Need to pass the parameter as true for the page which is turned over but still visible in Landscape
66    * @param [in] isBackVisible True for page with its backside upwards
67    */
68   void SetIsBackImageVisible( bool isBackVisible );
69
70   /**
71    * @brief Set the page width of the PageTurnBookSpineEffect.
72    *
73    * @param [in] pageWidth The width of the page size.
74    */
75   void SetPageWidth( float pageWidth );
76
77   /**
78    * @brief Set the width of shadow to be pageSize * shadowWidth.
79    *
80    * this shadow appears at the edges of the actor which is not visible on static pages
81    * @param [in] shadowWidth The width for the simulated shadow
82    */
83   void SetShadowWidth( float shadowWidth );
84
85   /**
86    * @brief Set the spine shadow parameter.
87    *
88    * The two parameters are the major&minor radius (in pixels) to form an ellipse shape
89    * The top-left quarter of this ellipse is used to calculate spine normal for simulating shadow
90    * @param [in] spineShadowParameter The major&minor ellipse radius for the simulated spine shadow
91    */
92   void SetSpineShadowParameter( const Vector2& spineShadowParameter );
93
94
95 private:// Helper for New()
96   PageTurnBookSpineEffect( ShaderEffect handle );
97
98 }; // End of PageTurnBookSpineEffect class
99
100 } // namespace Toolkit
101
102 } // namespace Dali
103
104 #endif /* __DALI_PAGE_TURN_BOOK_SPINE_EFFECT_H__ */