X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fdevel-api%2Flayouting%2Flayout-item-impl.h;h=47d65cc27c448e43e2c02398edb483def67a23a3;hp=fb129132345d905eeb2dbdb8b62c66b4786ab327;hb=267bed869a0b35414526b5c393fc2586603ee173;hpb=9eecb41468197eb2fc03e55c151011ea387e1bed diff --git a/dali-toolkit/devel-api/layouting/layout-item-impl.h b/dali-toolkit/devel-api/layouting/layout-item-impl.h index fb12913..47d65cc 100644 --- a/dali-toolkit/devel-api/layouting/layout-item-impl.h +++ b/dali-toolkit/devel-api/layouting/layout-item-impl.h @@ -20,11 +20,13 @@ #include #include +#include #include #include +#include #include #include -#include +#include #include #include #include @@ -37,15 +39,19 @@ namespace Toolkit namespace Internal { +struct LayoutData; + class LayoutItem; using LayoutItemPtr = IntrusivePtr; +class LayoutTransitionData; +using LayoutTransitionDataPtr = IntrusivePtr; /** * Base class for layouts. */ -class DALI_IMPORT_API LayoutItem : public BaseObject, - public LayoutParent +class DALI_TOOLKIT_API LayoutItem : public BaseObject, + public LayoutChild { public: /** @@ -94,7 +100,8 @@ public: Handle GetOwner() const; /** - * @brief Unparent this layout from it's owner, and remove any layout children in derived types + * @brief Unparent this layout from it's parent, remove it from it's owner + * and remove any layout children in derived types. */ void Unparent(); @@ -113,14 +120,26 @@ public: bool IsLayoutAnimated() const; /** - * @brief Register child properties of layout with owner type. + * @brief Get the default transition * - * The Actor hierarchy uses these registered properties in the type - * system to ensure child custom properties are properly initialized. + * @return The default transition + */ + LayoutTransitionDataPtr GetDefaultTransition(); + + /** + * @brief Set the layout transition data + * @param[in] layoutTransitionType The type of the transition + * @param[in] layoutTransitionDataPtr The transition data pointer + */ + void SetTransitionData( int layoutTransitionType, LayoutTransitionDataPtr layoutTransitionDataPtr ); + + /** + * @brief Get the transition data + * @param[in] layoutTransitionType The type of the transition * - * @param[in] containerType The type of the containing view (owner) + * @return The transition */ - void RegisterChildProperties( const std::string& containerType ); + LayoutTransitionDataPtr GetTransitionData( int layoutTransitionType ) const; /** * @brief This is called to find out how big a layout should be. @@ -168,9 +187,14 @@ public: static LayoutLength GetDefaultSize( LayoutLength size, MeasureSpec measureSpec ); /** - * @copydoc LayoutParent::GetParent + * @copydoc LayoutChild::SetParent */ - virtual LayoutParent* GetParent() override; + void SetParent( LayoutParent* parent ) override; + + /** + * @copydoc LayoutChild::GetParent + */ + LayoutParent* GetParent() override; /** * @brief Request that this layout is re-laid out. @@ -180,6 +204,24 @@ public: void RequestLayout(); /** + * @brief Request that this layout is re-laid out with particular transition. + * @param[in] layoutTranstionType The transition type + * + * This will make this layout and all it's parent layouts dirty and set the transition queued. + */ + void RequestLayout( Dali::Toolkit::LayoutTransitionData::Type layoutTranstionType ); + + /** + * @brief Request that this layout is re-laid out with particular transition. + * @param[in] layoutTranstionType The transition type + * @param[in] gainedChild The gained owners's child due to add/remove or focus gained/lost + * @param[in] lostChild The lost owners's child due to add/remove or focus gained/lost + * + * This will make this layout and all it's parent layouts dirty and set the transition queued. + */ + void RequestLayout( Dali::Toolkit::LayoutTransitionData::Type layoutTranstionType, Actor gainedChild, Actor lostChild ); + + /** * @brief Predicate to determine if this layout has been requested to re-layout * * @return True if a layout request has occured on this layout @@ -187,6 +229,23 @@ public: bool IsLayoutRequested() const; /** + * @brief Set layout requested flag (mark the layout dirty). + */ + void SetLayoutRequested(); + + /** + * @brief Checks if the Resize policy is being used for this LayoutItem + * @return true is ResizePolicy is used + */ + bool IsResizePolicyRequired() const; + + /** + * @brief Sets if the ResizePolicy is needed or not for this LayoutItem + * @param[in] resizeRequired true or false flag + */ + void SetResizePolicyRequired( bool resizeRequired ); + + /** * @brief Get the measured width (without any measurement flags). * * This method should be used only during measurement and layout calculations. @@ -289,11 +348,17 @@ public: LayoutLength GetMinimumHeight() const; /** - * Get the padding information + * Get the padding information. * @return The padding information */ Extents GetPadding() const; + /** + * Get the margin information. + * @return The margin information + */ + Extents GetMargin() const; + protected: /** * @brief Allow directly deriving classes to remove layout children when unparented @@ -307,7 +372,6 @@ protected: */ virtual void OnRegisterChildProperties( const std::string& containerType ); - /** * @brief Measure the layout and its content to determine the measured width and the * measured height. @@ -390,10 +454,9 @@ protected: MeasuredSize::State childMeasuredState ); /** - * @brief Sets the frame (the size and position) of the layout onto it's owner + * @brief Sets the frame (the size and position) of the layout onto it's owner. + * Collect all properties to animate after the layout update. * - * @todo Consider instead, collating properties into LayoutCollector in order to set/animate them all - * in one block. * @param[in] left The horizontal position of the left edge of this frame within the parent layout * @param[in] top The vertical position of the top edge of this frame within the parent layout * @param[in] right The horizontal position of the right edge of this frame within the parent layout @@ -414,6 +477,11 @@ protected: */ virtual void OnInitialize(); + /** + * @brief Called when a layer animation state is changed. + */ + virtual void OnAnimationStateChanged( bool animateLayout ) {} + private: /** * @brief Called to change the size of the layout. @@ -430,10 +498,19 @@ private: */ void OnLayoutAnimationFinished( Animation& animation ); + /** + * @brief Register child properties of layout with owner type. + * + * The Actor hierarchy uses these registered properties in the type + * system to ensure child custom properties are properly initialized. + * + * @param[in] containerType The type of the containing view (owner) + */ + void RegisterChildProperties( const std::string& containerType ); + public: class Impl; // Class declaration is public so we can add devel API's in the future - private: std::unique_ptr mImpl; ///< Implementation class holds all the data SlotDelegate mSlotDelegate;