X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fvisual-base-impl.h;h=754c8383ed1698c7ef06346aa70309c248c603a1;hp=b9cf7e911ce9bed77cda5eacfe3c27e4653598bc;hb=71246d76250be34fc60950da4eb5d7bf6241c740;hpb=fedf87ade1e326c925e463906b0400a09b86ae0a diff --git a/dali-toolkit/internal/visuals/visual-base-impl.h b/dali-toolkit/internal/visuals/visual-base-impl.h index b9cf7e9..754c838 100644 --- a/dali-toolkit/internal/visuals/visual-base-impl.h +++ b/dali-toolkit/internal/visuals/visual-base-impl.h @@ -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 #include #include +#include namespace Dali { @@ -46,7 +47,9 @@ namespace Internal namespace Visual { -class ResourceObserver; +class EventObserver; + +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. */ @@ -221,16 +227,15 @@ public: Internal::TransitionData::Animator& animator ); /** - * @brief Add an observer to watch for when the Visuals resources are loaded. + * @brief Add an observer to watch for when the Visuals have events to notify * Currently only supports a single observer - * */ - void AddResourceObserver( Visual::ResourceObserver& observer ); + void AddEventObserver( Visual::EventObserver& observer ); /** * @brief Remove an observer */ - void RemoveResourceObserver( Visual::ResourceObserver& observer ); + void RemoveEventObserver( Visual::EventObserver& observer ); /** * @brief Called when the visuals resources are loaded / ready @@ -249,14 +254,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().