#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.
#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
{
* 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();
/**
* @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
*/
/**
* @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
/**