X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fpopup%2Fpopup-impl.h;h=e9dffef07ae1203891dc686ad982e4e1d5e32b34;hb=9e3fd659c4d25706ab65345bc7c562ac27248325;hp=c40811c5b71f5f29b1b18762c5229cff4a6190d3;hpb=9dfe326faf6f6376bb7f4415a8ca35792c669d4c;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/popup/popup-impl.h b/dali-toolkit/internal/controls/popup/popup-impl.h old mode 100755 new mode 100644 index c40811c..e9dffef --- a/dali-toolkit/internal/controls/popup/popup-impl.h +++ b/dali-toolkit/internal/controls/popup/popup-impl.h @@ -1,8 +1,8 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_POPUP_H__ -#define __DALI_TOOLKIT_INTERNAL_POPUP_H__ +#ifndef DALI_TOOLKIT_INTERNAL_POPUP_H +#define DALI_TOOLKIT_INTERNAL_POPUP_H /* - * Copyright (c) 2015 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 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. @@ -19,7 +19,6 @@ */ // EXTERNAL INCLUDES -#include #include #include #include @@ -27,8 +26,9 @@ // INTERNAL INCLUDES #include -#include +#include #include +#include namespace Dali { @@ -245,6 +245,13 @@ public: static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex ); protected: + struct AccessibleImpl : public Control::Impl::AccessibleImpl + { + using Control::Impl::AccessibleImpl::AccessibleImpl; + + std::string GetNameRaw() override; + Dali::Accessibility::States CalculateStates() override; + }; /** * Construct a new Popup. @@ -309,9 +316,9 @@ private: /** * @brief Create Dimmed Backing (covers all content behind the dialog). * - * @return The backing actor. + * @return The backing control. */ - ImageActor CreateBacking(); + Toolkit::Control CreateBacking(); /** * @brief Creates the lower area within the popup. @@ -348,6 +355,11 @@ private: */ void SetExitAnimationData( const Property::Map& map ); + /** + * @briefs Updates the popup background's position and size. + */ + void UpdateBackgroundPositionAndSize(); + public: // Signals /** @@ -397,10 +409,10 @@ private: /** * Signal occurs when the dimmed backing for the Popup is touched. * @param[in] actor The Actor Touched - * @param[in] event The Touch Event. + * @param[in] touch The Touch Data. * @return Whether to consume event or not. */ - bool OnBackingTouched(Actor actor, const TouchEvent& event); + bool OnBackingTouched(Actor actor, const TouchEvent& touch); /** * Signal occurs when a mouse wheel event occurs on the dimmed backing. @@ -413,15 +425,15 @@ private: /** * Signal occurs when the dialog has been touched. * @param[in] actor The Actor Touched - * @param[in] event The Touch Event. + * @param[in] touch The Touch Data. * @return Whether to consume event or not. */ - bool OnDialogTouched(Actor actor, const TouchEvent& event); + bool OnDialogTouched( Actor actor, const TouchEvent& touch ); /** * @copydoc Toolkit::Control::OnInitialize() */ - virtual void OnInitialize(); + void OnInitialize() override; /** * Called whenever the popup layout is re-set up. @@ -433,43 +445,43 @@ private: /** * Called when the popup is directly or indirectly parented to the stage. */ - virtual void OnControlStageConnection(); + void OnSceneConnection( int depth ) override; /** * From Control; called after a child has been added to the owning actor. * @param[in] child The child which has been added. */ - virtual void OnControlChildAdd( Actor& child ); + void OnChildAdd( Actor& child ) override; /** * @copydoc Control::OnRelayOut() */ - virtual void OnRelayout( const Vector2& size, RelayoutContainer& container ); + void OnRelayout( const Vector2& size, RelayoutContainer& container ) override; /** * @copydoc Control::OnSetResizePolicy() */ - virtual void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ); + void OnSetResizePolicy( ResizePolicy::Type policy, Dimension::Type dimension ) override; /** * @copydoc Control::GetNaturalSize() */ - virtual Vector3 GetNaturalSize(); + Vector3 GetNaturalSize() override; /** * @copydoc Control::GetHeightForWidth() */ - virtual float GetHeightForWidth( float width ); + float GetHeightForWidth( float width ) override; /** * @copydoc Control::GetWidthForHeight() */ - virtual float GetWidthForHeight( float height ); + float GetWidthForHeight( float height ) override; /** * @copydoc Control::OnKeyEvent() */ - virtual bool OnKeyEvent( const KeyEvent& event ); + bool OnKeyEvent( const KeyEvent& event ) override; /** * @copydoc Control::GetNextKeyboardFocusableActor() @@ -478,6 +490,31 @@ private: private: + /** + * Recursively add any focusable actors or layout containers to the provided vector. + * Include the top level actor if it is a layout container. + * + * @param[in] parent The actor to start from + * @param[in/out] focusableActors The vector to add focusable actors to + */ + void AddFocusableChildren( Actor parent, std::vector< Actor >& focusableActors ); + + /** + * Recursively add any focusable actors or layout containers to the provided vector. + * + * @param[in] parent The actor to start from + * @param[in/out] focusableActors The vector to add focusable actors to + */ + void AddFocusableChildrenRecursive( Actor parent, std::vector< Actor >& focusableActors ); + + /** + * Sets up the touch signals connections as required. + * @note This must be called after all the members have been created. + */ + void SetupTouch(); + +private: + // Undefined. Popup(const Popup&); @@ -494,7 +531,7 @@ private: Layer mLayer; ///< Popup Layer (i.e. Dim backing and PopupBg reside in this). Toolkit::TableView mPopupLayout; ///< Popup Background (i.e. dialog reside in this). - ImageActor mBacking; ///< Backing actor (dim effect). + Toolkit::Control mBacking; ///< Backing actor (dim effect). Actor mPreviousFocusedActor; ///< Store the previous focused actor to restore the focus when popup hide. Actor mTailImage; ///< Stores the tail image. Actor mPopupContainer; ///< This actor is used to house the background image and the main popup layout. @@ -524,7 +561,7 @@ private: bool mBackingEnabled; ///< True if a dimmed backing will be used. Vector4 mBackingColor; ///< The color of the backing. Actor mPopupBackgroundImage; ///< Stores the background image. - Vector4 mBackgroundOuterBorder; ///< Background external border margin size + Rect mBackgroundBorder; ///< Background border. float mMargin; ///< Internal margin for popup contents. std::string mTailUpImage; ///< Image used for the tail for the up direction. std::string mTailDownImage; ///< Image used for the tail for the down direction. @@ -558,4 +595,4 @@ inline const Toolkit::Internal::Popup& GetImpl( const Toolkit::Popup& publicObje } // namespace Dali -#endif // __DALI_TOOLKIT_INTERNAL_POPUP_H__ +#endif // DALI_TOOLKIT_INTERNAL_POPUP_H