X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Factors%2Fcustom-actor-impl.h;h=f4cc9fef5c2a833637292f588b6ce118433c1a54;hb=646f736e77b085c86e982c0d1d4b895c2a431330;hp=fadf9b5815e92abae097c6c7b54385f57398a074;hpb=53ad0a8d1d3c644d74301687625e3dedabe592b0;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/actors/custom-actor-impl.h b/dali/public-api/actors/custom-actor-impl.h index fadf9b5..f4cc9fe 100644 --- a/dali/public-api/actors/custom-actor-impl.h +++ b/dali/public-api/actors/custom-actor-impl.h @@ -2,7 +2,7 @@ #define __DALI_CUSTOM_ACTOR_IMPL_H__ /* - * Copyright (c) 2016 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. @@ -18,6 +18,9 @@ * */ +// EXTERNAL INCLUDES +#include // uint32_t + // INTERNAL INCLUDES #include #include @@ -61,12 +64,20 @@ typedef IntrusivePtr CustomActorImplPtr; * And CustomActorImpl is typically owned by a single CustomActor instance; see also CustomActor::CustomActor( CustomActorImpl &implementation ). * @SINCE_1_0.0 */ -class DALI_IMPORT_API CustomActorImpl : public Dali::RefObject +class DALI_CORE_API CustomActorImpl : public Dali::RefObject { public: class Extension; ///< Forward declare future extension interface +protected: + /** + * @brief Virtual destructor + * @SINCE_1_0.0 + */ + virtual ~CustomActorImpl(); + +public: /** * @brief Used by derived CustomActorImpl instances, to access the public Actor interface. * @@ -98,12 +109,12 @@ public: * @endcode * @param[in] depth The depth in the hierarchy for the actor */ - virtual void OnStageConnection( int depth ) = 0; + virtual void OnStageConnection( int32_t depth ) = 0; /** * @brief Called after the actor has been disconnected from Stage. * - * If an actor is disconnected it either has no parent, or is parented to a disconnected actor. + * If an actor is disconnected, it either has no parent or is parented to a disconnected actor. * * @SINCE_1_0.0 * @note When the parent of a set of actors is disconnected to the stage, then all of the children @@ -131,7 +142,7 @@ public: virtual void OnChildAdd(Actor& child) = 0; /** - * @brief Called after the owning actor has attempted to remove a child( regardless of whether it succeeded or not ). + * @brief Called after the owning actor has attempted to remove a child (regardless of whether it succeeded or not). * * @SINCE_1_0.0 * @param[in] child The child being removed @@ -151,7 +162,7 @@ public: * @brief Called when the owning actor's size is set e.g. using Actor::SetSize(). * * @SINCE_1_0.0 - * @param[in] targetSize The target size. Note that this target size may not match the size returned via @ref Actor::GetTargetSize. + * @param[in] targetSize The target size. Note that this target size may not match the size returned via @ref Actor::GetTargetSize */ virtual void OnSizeSet(const Vector3& targetSize) = 0; @@ -159,8 +170,8 @@ public: * @brief Called when the owning actor's size is animated e.g. using Animation::AnimateTo( Property( actor, Actor::Property::SIZE ), ... ). * * @SINCE_1_0.0 - * @param[in] animation The object which is animating the owning actor. - * @param[in] targetSize The target size. Note that this target size may not match the size returned via @ref Actor::GetTargetSize. + * @param[in] animation The object which is animating the owning actor + * @param[in] targetSize The target size. Note that this target size may not match the size returned via @ref Actor::GetTargetSize */ virtual void OnSizeAnimation(Animation& animation, const Vector3& targetSize) = 0; @@ -171,17 +182,17 @@ public: * * @SINCE_1_0.0 * @param[in] event The touch event - * @return True if the event should be consumed. + * @return True if the event should be consumed * @note CustomActorImpl::REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomActorImpl::CustomActorImpl( ActorFlags flags ). */ - virtual bool OnTouchEvent(const TouchEvent& event) = 0; + virtual bool OnTouchEvent(const TouchEvent& event) DALI_DEPRECATED_API = 0; /** * @brief Called after a hover-event is received by the owning actor. * * @SINCE_1_0.0 * @param[in] event The hover event - * @return True if the event should be consumed. + * @return True if the event should be consumed * @note CustomActorImpl::REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomActorImpl::CustomActorImpl( ActorFlags flags ). */ virtual bool OnHoverEvent(const HoverEvent& event) = 0; @@ -190,8 +201,8 @@ public: * @brief Called after a key-event is received by the actor that has had its focus set. * * @SINCE_1_0.0 - * @param[in] event the Key Event - * @return True if the event should be consumed. + * @param[in] event The Key Event + * @return True if the event should be consumed */ virtual bool OnKeyEvent(const KeyEvent& event) = 0; @@ -200,7 +211,7 @@ public: * * @SINCE_1_0.0 * @param[in] event The wheel event - * @return True if the event should be consumed. + * @return True if the event should be consumed * @note CustomActorImpl::REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomActorImpl::CustomActorImpl( ActorFlags flags ). */ virtual bool OnWheelEvent(const WheelEvent& event) = 0; @@ -215,16 +226,16 @@ public: * actors, resize or after changing specific properties. * * @SINCE_1_0.0 - * @param[in] size The allocated size. + * @param[in] size The allocated size * @param[in,out] container The control should add actors to this container that it is not able - * to allocate a size for. + * to allocate a size for * @note As this function is called from inside the size negotiation algorithm, you cannot * call RequestRelayout (the call would just be ignored). */ virtual void OnRelayout( const Vector2& size, RelayoutContainer& container ) = 0; /** - * @brief Notification for deriving classes + * @brief Notification for deriving classes. * * @SINCE_1_0.0 * @param[in] policy The policy being set @@ -233,7 +244,7 @@ public: virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) = 0; /** - * @brief Return the natural size of the actor. + * @brief Returns the natural size of the actor. * * @SINCE_1_0.0 * @return The actor's natural size @@ -241,12 +252,12 @@ public: virtual Vector3 GetNaturalSize() = 0; /** - * @brief Calculate the size for a child. + * @brief Calculates the size for a child. * * @SINCE_1_0.0 * @param[in] child The child actor to calculate the size for - * @param[in] dimension The dimension to calculate the size for. E.g. width or height. - * @return Return the calculated size for the given dimension. + * @param[in] dimension The dimension to calculate the size for. E.g. width or height + * @return Return the calculated size for the given dimension */ virtual float CalculateChildSize( const Dali::Actor& child, Dimension::Type dimension ) = 0; @@ -256,8 +267,8 @@ public: * Derived classes should override this if they wish to customize the height returned. * * @SINCE_1_0.0 - * @param width Width to use. - * @return The height based on the width. + * @param[in] width Width to use + * @return The height based on the width */ virtual float GetHeightForWidth( float width ) = 0; @@ -267,32 +278,32 @@ public: * Derived classes should override this if they wish to customize the width returned. * * @SINCE_1_0.0 - * @param height Height to use. - * @return The width based on the width. + * @param[in] height Height to use + * @return The width based on the width */ virtual float GetWidthForHeight( float height ) = 0; /** - * @brief Determine if this actor is dependent on it's children for relayout. + * @brief Determines if this actor is dependent on its children for relayout. * * @SINCE_1_0.0 - * @param dimension The dimension(s) to check for - * @return Return if the actor is dependent on it's children. + * @param[in] dimension The dimension(s) to check for + * @return Return if the actor is dependent on it's children */ virtual bool RelayoutDependentOnChildren( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ) = 0; /** * @brief Virtual method to notify deriving classes that relayout dependencies have been - * met and the size for this object is about to be calculated for the given dimension + * met and the size for this object is about to be calculated for the given dimension. * * @SINCE_1_0.0 - * @param dimension The dimension that is about to be calculated + * @param[in] dimension The dimension that is about to be calculated */ virtual void OnCalculateRelayoutSize( Dimension::Type dimension ) = 0; /** * @brief Virtual method to notify deriving classes that the size for a dimension - * has just been negotiated + * has just been negotiated. * * @SINCE_1_0.0 * @param[in] size The new size for the given dimension @@ -301,7 +312,7 @@ public: virtual void OnLayoutNegotiated( float size, Dimension::Type dimension ) = 0; /** - * @brief Retrieve the extension for this control. + * @brief Retrieves the extension for this control. * * @SINCE_1_0.0 * @return The extension if available, NULL otherwise @@ -314,7 +325,7 @@ public: protected: // For derived classes /** - * @brief Flags for the constructor + * @brief Enumeration for the constructor flags. * @SINCE_1_0.0 */ enum ActorFlags @@ -329,25 +340,19 @@ protected: // For derived classes LAST_ACTOR_FLAG ///< Special marker for last actor flag @SINCE_1_0.0 }; - static const int ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1; ///< Value for deriving classes to continue on the flag enum + static const int32_t ACTOR_FLAG_COUNT = Log< LAST_ACTOR_FLAG - 1 >::value + 1; ///< Value for deriving classes to continue on the flag enum /** - * @brief Create a CustomActorImpl. + * @brief Creates a CustomActorImpl. * @SINCE_1_0.0 * @param[in] flags Bitfield of ActorFlags to define behaviour */ CustomActorImpl( ActorFlags flags ); - /** - * @brief Virtual destructor - * @SINCE_1_0.0 - */ - virtual ~CustomActorImpl(); - // Size negotiation helpers /** - * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene). + * @brief Requests a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene). * * This method can also be called from a derived class every time it needs a different size. * At the end of event processing, the relayout process starts and @@ -362,42 +367,42 @@ protected: // For derived classes /** * @brief Provides the Actor implementation of GetHeightForWidth. * @SINCE_1_0.0 - * @param width Width to use. - * @return The height based on the width. + * @param[in] width Width to use + * @return The height based on the width */ float GetHeightForWidthBase( float width ); /** * @brief Provides the Actor implementation of GetWidthForHeight. * @SINCE_1_0.0 - * @param height Height to use. - * @return The width based on the height. + * @param[in] height Height to use + * @return The width based on the height */ float GetWidthForHeightBase( float height ); /** - * @brief Calculate the size for a child using the base actor object. + * @brief Calculates the size for a child using the base actor object. * * @SINCE_1_0.0 * @param[in] child The child actor to calculate the size for * @param[in] dimension The dimension to calculate the size for. E.g. width or height - * @return Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found. + * @return Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found */ float CalculateChildSizeBase( const Dali::Actor& child, Dimension::Type dimension ); /** - * @brief Determine if this actor is dependent on it's children for relayout from the base class. + * @brief Determines if this actor is dependent on its children for relayout from the base class. * * @SINCE_1_0.0 - * @param dimension The dimension(s) to check for - * @return Return if the actor is dependent on it's children. + * @param[in] dimension The dimension(s) to check for + * @return Return if the actor is dependent on it's children */ bool RelayoutDependentOnChildrenBase( Dimension::Type dimension = Dimension::ALL_DIMENSIONS ); public: // Not intended for application developers /** - * @brief Initialize a CustomActor. + * @brief Initializes a CustomActor. * @SINCE_1_0.0 * @param[in] owner The owning object * @pre The CustomActorImpl is not already owned. @@ -406,7 +411,7 @@ public: // Not intended for application developers void Initialize(Internal::CustomActor& owner); /** - * @brief Get the owner. + * @brief Gets the owner. * * This method is needed when creating additional handle objects to existing objects. * Owner is the Dali::Internal::CustomActor that owns the implementation of the custom actor @@ -419,7 +424,7 @@ public: // Not intended for application developers /** * @brief Returns whether the OnTouchEvent() callback is required. * @SINCE_1_0.0 - * @return True if the OnTouchEvent() callback is required. + * @return True if the OnTouchEvent() callback is required * @note Called when ownership of the CustomActorImpl is passed to a CustomActor. */ bool RequiresTouchEvents() const; @@ -427,7 +432,7 @@ public: // Not intended for application developers /** * @brief Returns whether the OnHoverEvent() callback is required. * @SINCE_1_0.0 - * @return True if the OnHoverEvent() callback is required. + * @return True if the OnHoverEvent() callback is required * @note Called when ownership of the CustomActorImpl is passed to a CustomActor. */ bool RequiresHoverEvents() const; @@ -435,7 +440,7 @@ public: // Not intended for application developers /** * @brief Returns whether the OnWheelEvent() callback is required. * @SINCE_1_0.0 - * @return True if the OnWheelEvent() callback is required. + * @return True if the OnWheelEvent() callback is required * @note Called when ownership of the CustomActorImpl is passed to a CustomActor. */ bool RequiresWheelEvents() const; @@ -443,7 +448,7 @@ public: // Not intended for application developers /** * @brief Returns whether relayout is enabled. * @SINCE_1_0.0 - * @return Return true if relayout is enabled on the custom actor. + * @return Return true if relayout is enabled on the custom actor * @note Called when ownership of the CustomActorImpl is passed to a CustomActor. */ bool IsRelayoutEnabled() const;