1 #ifndef __DALI_TOOLKIT_INTERNAL_PAGE_TURN_EFFECT_H__
2 #define __DALI_TOOLKIT_INTERNAL_PAGE_TURN_EFFECT_H__
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 // http://floralicense.org/license/
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.
20 #include <dali/dali.h>
21 #include <dali-toolkit/public-api/shader-effects/page-turn-effect.h>
33 * PageTurnEffect implementation class
35 class PageTurnEffect : public ShaderEffect::Extension
43 virtual ~PageTurnEffect();
46 * @copydoc Dali::Toolkit::PageTurnEffect::New
48 static Toolkit::PageTurnEffect CreateShaderEffect( bool enableBlending );
51 * @copydoc Dali::Toolkit::PageTurnEffect::SetPageSize
53 void SetPageSize(const Vector2& pageSize);
56 * @copydoc Dali::Toolkit::PageTurnEffect::SetOriginalCenter
58 void SetOriginalCenter(const Vector2& originalCenter);
61 * @copydoc Dali::Toolkit::PageTurnEffect::SetCurrentCenter
63 void SetCurrentCenter(const Vector2& currentCenter);
66 * @copydoc Dali::Toolkit::PageTurnEffect::SetIsTurningBack
68 void SetIsTurningBack(bool isTurningBack);
71 * @copydoc Dali::Toolkit::PageTurnEffect::SetShadowWidth
73 void SetShadowWidth(float shadowWidth);
76 *@copydoc Dali::Toolkit::PageTurnEffect::SetSpineShadowParameter
78 void SetSpineShadowParameter(const Vector2& spineShadowParameter);
81 * The internal constraint uses the OriginalCenter property and the CurrentCenter Property
82 * to update the variety of common parameters which are with the same value for all the vertices.
83 * Note: For each actor, the constraints are applied in the same order as the calls to Actor::ApplyConstraint().
84 * So if there are other contraints applied to the OriginalCenter or CurrentCenter while when using this effect,
85 * call this method to get the internal constraints and re-apply it afterwards.
87 void ApplyInternalConstraint();
90 * @copydoc Dali::Toolkit::PageTurnEffect::GetPageSizePropertyName
92 const std::string& GetPageSizePropertyName() const;
95 * @copydoc Dali::Toolkit::PageTurnEffect::GetOriginalCenterPropertyName
97 const std::string& GetOriginalCenterPropertyName() const;
100 * @copydoc Dali::Toolkit::PageTurnEffect::GetCurrentCenterPropertyName
102 const std::string& GetCurrentCenterPropertyName() const;
106 void Initialize( ShaderEffect shaderEffect );
109 ShaderEffect mShaderEffect;
111 Property::Index mOriginalCenterPropertyIndex;
112 Property::Index mCurrentCenterPropertyIndex;
113 Constraint mInternalConstraint;
116 //undefined copy constructor.
117 PageTurnEffect( const PageTurnEffect& );
119 //Undefined assignment operator.
120 PageTurnEffect& operator=( const PageTurnEffect& );
124 } // namespace Internal
126 //Helpers for public-api forwarding methods
127 inline Toolkit::Internal::PageTurnEffect& GetImpl( Toolkit::PageTurnEffect& effect )
129 DALI_ASSERT_ALWAYS( effect );
130 return static_cast<Internal::PageTurnEffect&>( effect.GetExtension() );
133 inline const Toolkit::Internal::PageTurnEffect& GetImpl( const Toolkit::PageTurnEffect& effect )
135 DALI_ASSERT_ALWAYS( effect );
136 return static_cast<const Internal::PageTurnEffect&>( effect.GetExtension() );
139 } // namespace Toolkit
143 #endif /* __DALI_TOOLKIT_INTERNAL_PAGE_TURN_EFFECT_H__*/