Fix DALI_DEBUG_RENDERING crash
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / visuals / visual-base-impl.h
index b9cf7e9..02419d2 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_VISUAL_H
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -33,6 +33,7 @@
 #include <dali-toolkit/internal/visuals/visual-factory-cache.h>
 #include <dali-toolkit/devel-api/direction-enums.h>
 #include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/devel-api/visuals/visual-properties-devel.h>
 
 namespace Dali
 {
@@ -48,6 +49,8 @@ namespace Visual
 
 class ResourceObserver;
 
+using FittingMode = DevelVisual::FittingMode;
+
 /**
  * Base class for all Control rendering logic. A control may have multiple visuals.
  *
@@ -86,7 +89,7 @@ public:
   /**
    * @copydoc Toolkit::Visual::Base::GetName
    */
-  const std::string& GetName();
+  const std::string& GetName() const;
 
   /**
    * @copydoc Toolkit::Visual::Base::SetSize
@@ -214,6 +217,9 @@ public:
    * If the visual isn't staged (i.e. it doesn't have a renderer),
    * then this will not add an animation.
    *
+   * If the animator is valid and the transition handle is empty - it will
+   * be created.
+   *
    * @param[in] transition The animation to create or attach to
    * @param[in] animator The animation parameters of the property.
    */
@@ -249,14 +255,26 @@ public:
    */
   Toolkit::Visual::ResourceStatus GetResourceStatus() const;
 
-protected:
+  /**
+   * @brief Get the fitting mode for the visual
+   */
+  FittingMode GetFittingMode() const;
+
+  /**
+   * @brief Get the actual Visual Object.
+   * @return The actual visual object
+   * @note Should be overridden by deriving controls if they are acting as a proxy to other visual objects.
+   */
+  virtual Base& GetVisualObject();
+
+ protected:
 
   /**
    * @brief Constructor.
    *
    * @param[in] factoryCache A pointer pointing to the VisualFactoryCache object
    */
-  Base( VisualFactoryCache& factoryCache );
+  Base( VisualFactoryCache& factoryCache, FittingMode fittingMode );
 
   /**
    * @brief A reference counted object may only be deleted by calling Unreference().