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.
21 #include <dali/dali.h>
22 #include <dali-toolkit/public-api/shader-effects/page-turn-effect.h>
34 * PageTurnEffect implementation class
36 class PageTurnEffect : public ShaderEffect::Extension
44 virtual ~PageTurnEffect();
47 * @copydoc Dali::Toolkit::PageTurnEffect::New
49 static Toolkit::PageTurnEffect CreateShaderEffect( bool enableBlending );
52 * @copydoc Dali::Toolkit::PageTurnEffect::SetPageSize
54 void SetPageSize(const Vector2& pageSize);
57 * @copydoc Dali::Toolkit::PageTurnEffect::SetOriginalCenter
59 void SetOriginalCenter(const Vector2& originalCenter);
62 * @copydoc Dali::Toolkit::PageTurnEffect::SetCurrentCenter
64 void SetCurrentCenter(const Vector2& currentCenter);
67 * @copydoc Dali::Toolkit::PageTurnEffect::SetIsTurningBack
69 void SetIsTurningBack(bool isTurningBack);
72 * @copydoc Dali::Toolkit::PageTurnEffect::SetShadowWidth
74 void SetShadowWidth(float shadowWidth);
77 *@copydoc Dali::Toolkit::PageTurnEffect::SetSpineShadowParameter
79 void SetSpineShadowParameter(const Vector2& spineShadowParameter);
82 * The internal constraint uses the OriginalCenter property and the CurrentCenter Property
83 * to update the variety of common parameters which are with the same value for all the vertices.
84 * Note: For each actor, the constraints are applied in the same order as the calls to Actor::ApplyConstraint().
85 * So if there are other contraints applied to the OriginalCenter or CurrentCenter while when using this effect,
86 * call this method to get the internal constraints and re-apply it afterwards.
88 void ApplyInternalConstraint();
91 * @copydoc Dali::Toolkit::PageTurnEffect::GetPageSizePropertyName
93 const std::string& GetPageSizePropertyName() const;
96 * @copydoc Dali::Toolkit::PageTurnEffect::GetOriginalCenterPropertyName
98 const std::string& GetOriginalCenterPropertyName() const;
101 * @copydoc Dali::Toolkit::PageTurnEffect::GetCurrentCenterPropertyName
103 const std::string& GetCurrentCenterPropertyName() const;
107 void Initialize( ShaderEffect shaderEffect );
110 ShaderEffect mShaderEffect;
112 Property::Index mOriginalCenterPropertyIndex;
113 Property::Index mCurrentCenterPropertyIndex;
114 Constraint mInternalConstraint;
117 //undefined copy constructor.
118 PageTurnEffect( const PageTurnEffect& );
120 //Undefined assignment operator.
121 PageTurnEffect& operator=( const PageTurnEffect& );
125 } // namespace Internal
127 //Helpers for public-api forwarding methods
128 inline Toolkit::Internal::PageTurnEffect& GetImpl( Toolkit::PageTurnEffect& effect )
130 DALI_ASSERT_ALWAYS( effect );
131 return static_cast<Internal::PageTurnEffect&>( effect.GetExtension() );
134 inline const Toolkit::Internal::PageTurnEffect& GetImpl( const Toolkit::PageTurnEffect& effect )
136 DALI_ASSERT_ALWAYS( effect );
137 return static_cast<const Internal::PageTurnEffect&>( effect.GetExtension() );
140 } // namespace Toolkit
144 #endif /* __DALI_TOOLKIT_INTERNAL_PAGE_TURN_EFFECT_H__*/