Updates following canvas-renderer devel header location change
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / canvas-view / canvas-view.h
index 9e59722..390cabd 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_CANVAS_VIEW_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -22,8 +22,8 @@
 #include <dali-toolkit/public-api/controls/control.h>
 
 // EXTERNAL INCLUDES
-#include <dali/devel-api/adaptor-framework/canvas-renderer-drawable.h>
-#include <dali/devel-api/adaptor-framework/canvas-renderer-shape.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-drawable.h>
+#include <dali/devel-api/adaptor-framework/canvas-renderer/canvas-renderer-shape.h>
 
 namespace Dali
 {
@@ -51,12 +51,42 @@ class CanvasView;
  *    myCanvasView.AddDrawable( shape );
  * @endcode
  *
+ * @section CanvasViewProperties Properties
+ * |%Property enum                    |String name          |Type            |Writable|Animatable|
+ * |----------------------------------|---------------------|----------------|--------|----------|
+ * | Property::VIEW_BOX               | viewBox             |  Vector2       | O      | X        |
  *
  */
 class DALI_TOOLKIT_API CanvasView : public Control
 {
 public:
   /**
+   * @brief The start and end property ranges for this control.
+   */
+  enum PropertyRange
+  {
+    PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
+  };
+
+  /**
+   * @brief An enumeration of properties belonging to the CanvasView class.
+   */
+  struct Property
+  {
+    /**
+     * @brief An enumeration of properties belonging to the CanvasView class.
+     */
+    enum
+    {
+      /**
+       * @brief the viewbox of the CanvasView.
+       * @details Name "viewBox", type Property::VECTOR2.
+       */
+      VIEW_BOX = PROPERTY_START_INDEX,
+    };
+  };
+public:
+  /**
    * @brief Creates an uninitialized CanvasView.
    */
   CanvasView();
@@ -64,6 +94,13 @@ public:
   /**
    * @brief Creates an initialized CanvasView
    *
+   * @return A handle to a newly allocated CanvasView
+   */
+  static CanvasView New();
+
+  /**
+   * @brief Creates an initialized CanvasView
+   *
    * @param [in] viewBox The width and height.
    * @return A handle to a newly allocated CanvasView
    */
@@ -120,9 +157,23 @@ public:
   /**
    * @brief Add drawable object to the CanvasView.
    * This method is similar to registration. The added shape is drawn on the inner canvas.
+   * @param[in] drawable the drawable object.
    */
   void AddDrawable(Dali::CanvasRenderer::Drawable& drawable);
 
+  /**
+   * @brief Remove drawable object to the CanvasView.
+   * This method is similar to deregistration.
+   * @param[in] drawable the drawable object.
+   * @return Returns True when it's successful. False otherwise.
+   */
+  bool RemoveDrawable(Dali::CanvasRenderer::Drawable& drawable);
+
+  /**
+   * @brief Remove all drawable objects added to the CanvasView.
+   */
+  void RemoveAllDrawables();
+
 public: // Not intended for application developers
   /// @cond internal
   /**