-#ifndef __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H__
-#define __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H__
+#ifndef DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H
+#define DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <dali/public-api/animation/animation.h>
-#include <dali/devel-api/rendering/renderer.h>
+#include <dali/public-api/rendering/renderer.h>
// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/transition-effects/cube-transition-effect.h>
namespace Dali
{
-
namespace Toolkit
{
-
class CubeTransitionEffect;
namespace Internal
{
-
/**
* CubeTransitionEffect implementation class
*/
class CubeTransitionEffect : public Control
{
-
public:
-
/**
* Destructor
*/
/**
* @copydoc Toolkit::CubeTransitionEffect::SetTransitionDuration
*/
- void SetTransitionDuration( float duration );
+ void SetTransitionDuration(float duration);
/**
* @copydoc Toolkit::CubeTransitionEffect::GetTransitionDuration
/**
* @copydoc Toolkit::CubeTransitionEffect::SetCubeDisplacement
*/
- void SetCubeDisplacement( float displacement );
+ void SetCubeDisplacement(float displacement);
/**
* @copydoc Toolkit::CubeTransitionEffect::GetCubeDisplacement
bool IsTransitioning();
/**
- * @copydoc Toolkit::CubeTransitionEffect::SetFirstImage
+ * @copydoc Toolkit::CubeTransitionEffect::SetCurrentTexture
*/
- void SetCurrentImage( Image image );
+ void SetCurrentTexture(Texture texture);
/**
- * @copydoc Toolkit::CubeTransitionEffect::SetTargetImage
+ * @copydoc Toolkit::CubeTransitionEffect::SetTargetTexture
*/
- void SetTargetImage( Image image );
+ void SetTargetTexture(Texture texture);
/**
* @copydoc Toolkit::CubeTransitionEffect::StartTransition(bool)
*/
- void StartTransition( bool toNextImage = true );
+ void StartTransition(bool toNextImage = true);
/**
* @copydoc Toolkit::CubeTransitionEffect::StartTransition(Vector2, Vector2)
*/
- void StartTransition( Vector2 panPosition, Vector2 panDisplacement );
+ void StartTransition(Vector2 panPosition, Vector2 panDisplacement);
/**
* @copydoc Toolkit::CubeTransitionEffect::PauseTransition()
void StopTransition();
public: //Signal
-
/**
* @copydoc Toolkit::CubeTransitionEffect::TransitionCompletedSignal()
*/
* @return True if the signal was connected.
* @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
*/
- static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
+ static bool DoConnectSignal(BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor);
protected:
/**
- * @copydoc CustomActorImpl::OnStageConnection()
+ * @copydoc CustomActorImpl::OnSceneConnection()
*/
- virtual void OnStageConnection( int depth );
+ void OnSceneConnection(int depth) override;
/**
- * @copydoc CustomActorImpl::OnStageDisconnection()
+ * @copydoc CustomActorImpl::OnSceneDisconnection()
*/
- virtual void OnStageDisconnection();
+ void OnSceneDisconnection() override;
protected:
-
/**
* Construct a new CubeTransitionEffect object
* Called in the constructor of subclasses
* @param[in] numRows How many rows of cubes
* @param[in] numColumns How many columns of cubes
*/
- CubeTransitionEffect( unsigned int numRows, unsigned int numColumns );
+ CubeTransitionEffect(unsigned int numRows, unsigned int numColumns);
/**
* Initialization steps: creating a layer, two groups of tiles,
*/
void Initialize();
-
protected:
- void SetTargetLeft( unsigned int idx );
- void SetTargetRight( unsigned int idx );
- void SetTargetTop( unsigned int idx );
- void SetTargetBottom( unsigned int idx );
+ void SetTargetLeft(unsigned int idx);
+ void SetTargetRight(unsigned int idx);
+ void SetTargetTop(unsigned int idx);
+ void SetTargetBottom(unsigned int idx);
private:
-
/**
* Callback function of transition animation finished
* Hide transition layer, show current image, and set isAnimating flag to false
* This method is called after the CubeTransitionEffect has been initialized. Derived classes should do
* any second phase initialization by overriding this method.
*/
- virtual void OnInitialize() { }
+ virtual void OnInitialize()
+ {
+ }
/**
* This method is called after the a new transition is activated.
* @param[in] panPosition The press down position of panGesture
* @param[in] panDisplacement The displacement vector of panGesture
*/
- virtual void OnStartTransition( Vector2 panPosition, Vector2 panDisplacement ) {}
+ virtual void OnStartTransition(Vector2 panPosition, Vector2 panDisplacement)
+ {
+ }
/**
* This method is called when the transition is forced stop in the middle of animation.
* Derived classed should set the rotation status of the cubes to the same as the final state when the animation is finished completely.
* So that the next transition would be started correctly.
*/
- virtual void OnStopTransition() {}
+ virtual void OnStopTransition()
+ {
+ }
- virtual void OnRelayout( const Vector2& size, RelayoutContainer& container );
+ void OnRelayout(const Vector2& size, RelayoutContainer& container) override;
void ResetToInitialState();
-
protected:
- typedef std::vector< Actor > ActorArray;
- enum FACE { TOP, BOTTOM, LEFT, RIGHT };
+ typedef std::vector<Actor> ActorArray;
+ enum FACE
+ {
+ TOP,
+ BOTTOM,
+ LEFT,
+ RIGHT
+ };
- ActorArray mBoxes;
- Vector< FACE > mBoxType;
- ActorArray mCurrentTiles;
- ActorArray mTargetTiles;
+ ActorArray mBoxes;
+ Vector<FACE> mBoxType;
+ ActorArray mCurrentTiles;
+ ActorArray mTargetTiles;
- Actor mBoxRoot;
+ Actor mBoxRoot;
- unsigned int mRows;
- unsigned int mColumns;
+ unsigned int mRows;
+ unsigned int mColumns;
- Renderer mCurrentRenderer;
- Renderer mTargetRenderer;
+ Renderer mCurrentRenderer;
+ Renderer mTargetRenderer;
- Image mCurrentImage;
- Image mTargetImage;
- Animation mAnimation;
+ Texture mCurrentTexture;
+ Texture mTargetTexture;
- Vector2 mTileSize;
+ Animation mAnimation;
- bool mIsAnimating;
- bool mIsPaused;
+ Vector2 mTileSize;
- float mAnimationDuration;
- float mCubeDisplacement;
+ bool mIsAnimating;
+ bool mIsPaused;
- static const Vector4 FULL_BRIGHTNESS;
- static const Vector4 HALF_BRIGHTNESS;
+ float mAnimationDuration;
+ float mCubeDisplacement;
-private:
+ static const Vector4 FULL_BRIGHTNESS;
+ static const Vector4 HALF_BRIGHTNESS;
+private:
Toolkit::CubeTransitionEffect::TransitionCompletedSignalType mTransitionCompletedSignal;
-
};
} // namespace Internal
} // namespace Dali
-#endif /* __DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H__ */
+#endif // DALI_TOOLKIT_INTERNAL_CUBE_TRANSITION_EFFECT_H