Merge "Ensuring test files match dali-core/adaptor" into devel/master
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / transition-effects / cube-transition-effect.h
index 5afab34..8c670c4 100644 (file)
@@ -1,8 +1,8 @@
-#ifndef __DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H__
-#define __DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H__
+#ifndef DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H
+#define DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H
 
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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.
  *
  */
 
+// INTERNAL INCLUDES
+#include <dali-toolkit/public-api/controls/control.h>
+#include <dali-toolkit/public-api/dali-toolkit-common.h>
+
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/actor.h>
-#include <dali/public-api/actors/image-actor.h>
+#include <dali/public-api/rendering/texture.h>
 
 namespace Dali
 {
-
 namespace Toolkit
 {
-
 namespace Internal DALI_INTERNAL
 {
-
 /**
  * CubeTransitionEffect implementation class
  */
 class CubeTransitionEffect;
 
-} // namespace Internal
+} // namespace DALI_INTERNAL
 
 /**
- * CubeTransitionEffect is a base class of custom transition effect on Image actors
+ * CubeTransitionEffect is a base class of custom transition effect on Images
  * The two images are partitioned into tiles and serves as two perpendicular faces of cubes
  * By rotating these cubes to transit from one image to another
  *
@@ -49,7 +49,7 @@ class CubeTransitionEffect;
  *
  * //create a new CubeTransitionEffect
  * //use the New funtion of subclass ( CubeTransitionWaveEffect or CubeTransitionCrossEffect )
- * CubeTransitionEffect cubeEffect = CubeTransitionWaveEffect::New(numRows, numColumns, viewAreaSize);
+ * CubeTransitionEffect cubeEffect = CubeTransitionWaveEffect::New(numRows, numColumns);
  *
  * //set the duration of transition animation
  * cubeEffect.SetTransitionDuration( animationDuration );
@@ -58,14 +58,14 @@ class CubeTransitionEffect;
  * cubeEffect.SetCubeDisplacement( cubeDisplacement  );
  *
  * // Add to stage
- * stage.Add( cubeEffect.GetRoot() );
+ * stage.Add( cubeEffect );
  *
  * // Set the current image,
- * // only need to set at beginning or when the current image was transited to with no effect or other effect
- * cubeEffect.SetCurrentImage( firstImageActor );
+ * // only need to set at beginning or when the current image was transitioned to with no effect or other effect
+ * cubeEffect.SetCurrentImage( firstImage );
  *
  * // Set target image, paired with startTransition. These two steps would be repeated as needed
- * cubeEffect.SetTargetimage( secondImageActor );
+ * cubeEffect.SetTargetimage( secondImage );
  * // Activate the effect
  * //   no param / param ture: default horizontally left panGesture
  * //   or param false:  default horizontally right panGesture
@@ -75,14 +75,13 @@ class CubeTransitionEffect;
  * @endcode
  *
  * Signals
- * | %Signal Name         | Method                           |
- * |----------------------|----------------------------------|
- * | transition-completed | @ref TransitionCompletedSignal() |
+ * | %Signal Name        | Method                           |
+ * |---------------------|----------------------------------|
+ * | transitionCompleted | @ref TransitionCompletedSignal() |
  */
-class DALI_IMPORT_API CubeTransitionEffect : public BaseHandle
+class DALI_TOOLKIT_API CubeTransitionEffect : public Control
 {
 public:
-
   /**
    * Create an uninitialized CubeTransitionEffect;
    * this can be initialized by New function of its subclass
@@ -103,13 +102,13 @@ public:
    * @param[in] handle A handle to an object
    * @return A handle to a CubeTransitionEffect object or an uninitialized handle
    */
-  static CubeTransitionEffect DownCast( BaseHandle handle );
+  static CubeTransitionEffect DownCast(BaseHandle handle);
 
   /**
    * Set the duration of transition animation
    * @param[in] duration The duration of transition animation
    */
-  void SetTransitionDuration( float duration );
+  void SetTransitionDuration(float duration);
 
   /**
    * Get the duration of transition animation
@@ -121,45 +120,39 @@ public:
    * Set the displacement of bouncing animation during cube's rotation
    * @param[in] displacement The displacement of bouncing animation
    */
-  void SetCubeDisplacement( float displacement );
+  void SetCubeDisplacement(float displacement);
 
   /**
-   * Getet the displacement of bouncing animation during cube's rotation
+   * Get the displacement of bouncing animation during cube's rotation
    * @return displacement The displacement of bouncing animation
    */
   float GetCubeDisplacement() const;
 
   /**
-   * Return the transition effect root actor, should then be added to stage
-   * @return The transition effect root actor
-   */
-  Actor GetRoot();
-
-  /**
    * Return the transition status
    * @return True if the transition is under processing; false if finished
    */
-  bool IsTransiting();
+  bool IsTransitioning();
 
   /**
-   * Set the current image to transite from
-   * if using this same effect continuely, only need to set once
-   * @param[in] imageActor The current imageActor
+   * Set the current texture to transition from
+   * if using this same effect continually, only need to set once
+   * @param[in] texture The current texture
    */
-  void SetCurrentImage(ImageActor imageActor);
+  void SetCurrentTexture(Texture texture);
 
   /**
-   * Set the target image to transit to
-   * @param[in] imageActor The new imageActor showing on stage
+   * Set the target texture to transit to
+   * @param[in] texture The new Texture showing on stage
    */
-  void SetTargetImage(ImageActor imageActor);
+  void SetTargetTexture(Texture texture);
 
   /**
    * Activate the transition animation with horizontally left/right panGesture
    * @pre target image is set
-   * @param[in] toNextImage Horizontally left panGesture if ture, horizontally right if false
+   * @param[in] toNextImage Horizontally left panGesture if true, horizontally right if false
    */
-  void StartTransition( bool toNextImage = true );
+  void StartTransition(bool toNextImage = true);
 
   /**
    * Activate the transition animation with specified panGesture
@@ -167,7 +160,7 @@ public:
    * @param[in] panPosition The press down position of panGesture
    * @param[in] panDisplacement The displacement vector of panGesture
    */
-  void StartTransition( Vector2 panPosition, Vector2 panDisplacement );
+  void StartTransition(Vector2 panPosition, Vector2 panDisplacement);
 
   /**
    * Pause the transition animation.
@@ -183,29 +176,39 @@ public:
 
   /**
    * Inactivate the transition animation if it is running.
-   * Also set the rotation and position of cubes, colors of tile to the same as the final state when the animation if finished completely
+   * Also set the rotation and position of cubes, colors of tile to the same as the start state when the animation if finished completely
    * It does nothing if the animation is not running.
    */
   void StopTransition();
 
 public: //Signal
-
   //Transition animation completed signal
-  typedef Signal< void ( CubeTransitionEffect, ImageActor ) > TransitionCompletedSignalType;
+  typedef Signal<void(CubeTransitionEffect, Texture)> TransitionCompletedSignalType;
 
   /**
    * Signal emitted when the transition has completed animation
    * A callback of the following type may be connected
    * @code
-   *   void YourCallbackName( CubeTransitionEffect cubeEffect, ImageActor currentImage );
+   *   void YourCallbackName( CubeTransitionEffect cubeEffect, Texture currentTexture );
    * @endcode
    * @return The Signal to connect to.
    */
   TransitionCompletedSignalType& TransitionCompletedSignal();
 
 public: // Not intended for developer use
+  /**
+   * @brief Creates a handle using the Toolkit::Internal implementation.
+   *
+   * @param[in]  implementation  The Control implementation.
+   */
+  DALI_INTERNAL CubeTransitionEffect(Internal::CubeTransitionEffect& implementation);
 
-  explicit DALI_INTERNAL CubeTransitionEffect( Internal::CubeTransitionEffect* impl );
+  /**
+   * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
+   *
+   * @param[in]  internal  A pointer to the internal CustomActor.
+   */
+  DALI_INTERNAL CubeTransitionEffect(Dali::Internal::CustomActor* internal);
 
 }; //class CubeTransitionEffect
 
@@ -213,4 +216,4 @@ public: // Not intended for developer use
 
 } // namespace Dali
 
-#endif /* __DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H__ */
+#endif // DALI_TOOLKIT_CUBE_TRANSITION_EFFECT_H