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 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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 #include <dali/public-api/animation/constraint.h>
25 #include <dali-toolkit/public-api/shader-effects/page-turn-effect.h>
37 * PageTurnEffect implementation class
39 class PageTurnEffect : public ShaderEffect::Extension
47 virtual ~PageTurnEffect();
50 * @copydoc Dali::Toolkit::PageTurnEffect::New
52 static Toolkit::PageTurnEffect CreateShaderEffect( bool enableBlending );
55 * @copydoc Dali::Toolkit::PageTurnEffect::SetPageSize
57 void SetPageSize(const Vector2& pageSize);
60 * @copydoc Dali::Toolkit::PageTurnEffect::SetOriginalCenter
62 void SetOriginalCenter(const Vector2& originalCenter);
65 * @copydoc Dali::Toolkit::PageTurnEffect::SetCurrentCenter
67 void SetCurrentCenter(const Vector2& currentCenter);
70 * @copydoc Dali::Toolkit::PageTurnEffect::SetIsTurningBack
72 void SetIsTurningBack(bool isTurningBack);
75 * @copydoc Dali::Toolkit::PageTurnEffect::SetShadowWidth
77 void SetShadowWidth(float shadowWidth);
80 *@copydoc Dali::Toolkit::PageTurnEffect::SetSpineShadowParameter
82 void SetSpineShadowParameter(const Vector2& spineShadowParameter);
85 * The internal constraint uses the OriginalCenter property and the CurrentCenter Property
86 * to update the variety of common parameters which are with the same value for all the vertices.
87 * Note: For each actor, the constraints are applied in the same order as the calls to Actor::ApplyConstraint().
88 * So if there are other contraints applied to the OriginalCenter or CurrentCenter while when using this effect,
89 * call this method to get the internal constraints and re-apply it afterwards.
91 void ApplyInternalConstraint();
94 * @copydoc Dali::Toolkit::PageTurnEffect::GetPageSizePropertyName
96 const std::string& GetPageSizePropertyName() const;
99 * @copydoc Dali::Toolkit::PageTurnEffect::GetOriginalCenterPropertyName
101 const std::string& GetOriginalCenterPropertyName() const;
104 * @copydoc Dali::Toolkit::PageTurnEffect::GetCurrentCenterPropertyName
106 const std::string& GetCurrentCenterPropertyName() const;
110 void Initialize( ShaderEffect shaderEffect );
113 ShaderEffect mShaderEffect;
115 Property::Index mOriginalCenterPropertyIndex;
116 Property::Index mCurrentCenterPropertyIndex;
117 Constraint mInternalConstraint;
120 //undefined copy constructor.
121 PageTurnEffect( const PageTurnEffect& );
123 //Undefined assignment operator.
124 PageTurnEffect& operator=( const PageTurnEffect& );
128 } // namespace Internal
130 //Helpers for public-api forwarding methods
131 inline Toolkit::Internal::PageTurnEffect& GetImpl( Toolkit::PageTurnEffect& effect )
133 DALI_ASSERT_ALWAYS( effect );
134 return static_cast<Internal::PageTurnEffect&>( effect.GetExtension() );
137 inline const Toolkit::Internal::PageTurnEffect& GetImpl( const Toolkit::PageTurnEffect& effect )
139 DALI_ASSERT_ALWAYS( effect );
140 return static_cast<const Internal::PageTurnEffect&>( effect.GetExtension() );
143 } // namespace Toolkit
147 #endif /* __DALI_TOOLKIT_INTERNAL_PAGE_TURN_EFFECT_H__*/