Rendering API clean-up
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / renderer-factory / renderer-factory.h
index 3c3cec7..c6fc451 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/base-handle.h>
+#include <dali/public-api/images/image-operations.h>
 
 // INTERNAK INCLUDES
 #include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
 
 namespace Dali
 {
+class Image;
+class Vector4;
 
 namespace Toolkit
 {
@@ -35,13 +38,15 @@ class RendererFactory;
 }
 
 /**
- * RendererFactory is a singleton object that provides and shares renderers for controls
+ * @brief RendererFactory is a singleton object that provides and shares renderers for controls
+ *
+ * By setting environment variable 'DALI_DEBUG_RENDERING', all concrete renderer is replaced with the debug renderer which renders a quad wireframe.
  *
  * The renderer type is required in the property map for requesting a control renderer.
  *
- * | %Property Name            | Type             |
- * |---------------------------|------------------|
- * | renderer-type             | STRING           |
+ * | %Property Name           | Type             |
+ * |--------------------------|------------------|
+ * | rendererType             | STRING           |
  */
 class DALI_IMPORT_API RendererFactory : public BaseHandle
 {
@@ -84,13 +89,111 @@ public:
   RendererFactory& operator=( const RendererFactory& handle );
 
   /**
-   * Request the control renderer
+   * @brief Request the control renderer
+   *
    * @param[in] propertyMap The map contains the properties required by the control renderer
    *            Depends on the content of the map, different kind of renderer would be returned.
-   * @return the  pointer pointing to control renderer
+   * @return The pointer pointing to control renderer
    */
   ControlRenderer GetControlRenderer( const Property::Map& propertyMap  );
 
+  /**
+   * @brief Request the control renderer to render the given color
+   *
+   * @param[in] color The color to be rendered
+   * @return The pointer pointing to the control renderer
+   */
+  ControlRenderer GetControlRenderer( const Vector4& color );
+
+  /**
+   * @brief Request the current control renderer to render the given color
+   *
+   * if the current renderer is a handle to an internal color renderer, set this color to it,
+   * else the renderer would be a handle to a newly created internal color renderer.
+   *
+   * @param[in] renderer The ControlRenderer to reset
+   * @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
+   * @param[in] color The color to be rendered.
+   */
+  void ResetRenderer( ControlRenderer& renderer, Actor& actor, const Vector4& color );
+
+  /**
+   * @brief Request the control renderer to renderer the border with the given size and color.
+   *
+   * @param[in] borderSize The size of the border. Border size is the same along all edges.
+   * @param[in] borderColor The color of the border.
+   * @return The pointer pointing to the control renderer
+   */
+  ControlRenderer GetControlRenderer( float borderSize, const Vector4& borderColor );
+
+  /**
+   * @brief Request the control renderer to renderer the border with the given size and color, and specify whether anti-aliasing is needed.
+   *
+   * @param[in] borderSize The size of the border. Border size is the same along all edges.
+   * @param[in] borderColor The color of the border.
+   * @param[in] antiAliasing Whether anti-aliasing is required for border rendering.
+   * @return The pointer pointing to the control renderer
+   */
+  ControlRenderer GetControlRenderer( float borderSize, const Vector4& borderColor, bool antiAliasing );
+
+  /**
+   * @brief Request the control renderer to render the image.
+   *
+   * @param[in] image The image to be rendered.
+   * @return The pointer pointing to the control renderer
+   */
+  ControlRenderer GetControlRenderer( const Image& image );
+
+  /**
+   * @brief Request the current control renderer to render the given image
+   *
+   * if the current renderer is a handle to an internal image renderer, set this image to it,
+   * else the renderer would be a handle to a newly created internal image renderer.
+   *
+   * @param[in] renderer The ControlRenderer to reset
+   * @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
+   * @param[in] image The Image to be rendered.
+   */
+  void ResetRenderer( ControlRenderer& renderer, Actor& actor, const Image& image );
+
+  /**
+   * @brief Request the control renderer to render the given resource at the url.
+   *
+   * @param[in] url The URL to the resource to be rendered.
+   * @param[in] size The width and height to fit the loaded image to.
+   * @return The pointer pointing to the control renderer
+   */
+  ControlRenderer GetControlRenderer( const std::string& url,
+                                      ImageDimensions size = ImageDimensions() );
+
+  /**
+   * @brief Request the current control renderer to render the given resource at the url
+   *
+   * if the current renderer is a handle to an internal image renderer, set this image to it,
+   * else the renderer would be a handle to a newly created internal image renderer.
+   *
+   * @param[in] renderer The ControlRenderer to reset
+   * @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
+   * @param[in] url The URL to the resource to be rendered.
+   * @param[in] size The width and height to fit the loaded image to.
+   */
+  void ResetRenderer( ControlRenderer& renderer, Actor& actor, const std::string& url,
+                      ImageDimensions size = ImageDimensions() );
+
+
+  /**
+   * @brief Request the current control renderer from the property map, merging the property map with the renderer
+   *
+   * if the current renderer is capable of merging with the property map the reset the renderer with the merged properties
+   * else the renderer would be a handle to a newly created internal renderer.
+   *
+   * @param[in] renderer The ControlRenderer to reset
+   * @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
+   * @param[in] propertyMap The map contains the properties required by the control renderer
+   *            Depends on the content of the map, different kind of renderer would be returned.
+   */
+  void ResetRenderer( ControlRenderer& renderer, Actor& actor, const Property::Map& propertyMap );
+
 private:
 
   explicit DALI_INTERNAL RendererFactory(Internal::RendererFactory *impl);