X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Fcontrol%2Fcontrol-data-impl.h;h=46cc97ba377eb078076097286e6a888c42221542;hp=492461e730e9b4453743f23fbef9fc68ef75df5b;hb=6da98d4f526029d51c8404964dd954afe9752401;hpb=c87b2e1b8bde8db53067b24e191a1adf9deeb8db diff --git a/dali-toolkit/internal/controls/control/control-data-impl.h b/dali-toolkit/internal/controls/control/control-data-impl.h index 492461e..46cc97b 100644 --- a/dali-toolkit/internal/controls/control/control-data-impl.h +++ b/dali-toolkit/internal/controls/control/control-data-impl.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_CONTROL_DATA_IMPL_H /* - * Copyright (c) 2021 Samsung Electronics Co., Ltd. + * Copyright (c) 2022 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. @@ -35,7 +35,9 @@ #include #include #include +#include #include +#include namespace Dali { @@ -69,7 +71,7 @@ typedef Dali::OwnerContainer RegisteredVisualContainer; */ class Control::Impl : public ConnectionTracker, public Visual::EventObserver { - friend class Toolkit::DevelControl::AccessibleImpl; + friend class Toolkit::DevelControl::ControlAccessible; public: /** @@ -139,6 +141,12 @@ public: void NotifyVisualEvent(Visual::Base& object, Property::Index signalId) override; /** + * @brief Called when the visual needs relayout request. + * @param[in] object The visual who requests relayout + */ + void RelayoutRequest(Visual::Base& object) override; + + /** * @copydoc Dali::Toolkit::DevelControl::RegisterVisual() */ void RegisterVisual(Property::Index index, Toolkit::Visual::Base& visual); @@ -216,6 +224,11 @@ public: void DoAction(Dali::Property::Index visualIndex, Dali::Property::Index actionId, const Dali::Property::Value attributes); /** + * @copydoc Dali::Toolkit::DevelControl::DoActionExtension() + */ + void DoActionExtension(Dali::Property::Index visualIndex, Dali::Property::Index actionId, Dali::Any attributes); + + /** * @brief Function used to set control properties. * @param[in] object The object whose property to set * @param[in] index The index of the property to set @@ -342,8 +355,7 @@ public: * Attribute is added if not existed previously or updated * if existed. */ - void AppendAccessibilityAttribute(const std::string& key, - const std::string value); + void AppendAccessibilityAttribute(const std::string& key, const std::string value); /** * @brief Removes accessibility attribute @@ -393,6 +405,40 @@ public: */ Dali::Property GetVisualProperty(Dali::Property::Index index, Dali::Property::Key visualPropertyKey); + /** + * @brief Retrieves source and destination visual properties for the Transition of this Control. + * The properties of this Control will be transitioned from the propeties of source Control to that of destination control. + * If a property value is different between source and destination Control, + * the property information of each Control will be included in sourceProperties and destinationProperties. + * + * @param[out] sourceProperties Source property list to be applied on this Control. + * @param[out] destinationProperties Destination property list to be applied on this Control. + * @param[in] source Source control of the animation. + * @param[in] destination Destination control of the animation. + * + * @note This method do not handle Actor properties. + * And the size and order of the sourceProperties and destinationProperties must be synchronized. + * + * This method triggers Control::OnCreateTransition(). + */ + void CreateTransitions(std::vector>& sourceProperties, + std::vector>& destinationProperties, + Dali::Toolkit::Control source, + Dali::Toolkit::Control destination); + + /** + * @brief Update visual properties. + * @param[in] properties Property list to be used to update visual properties of this Control. + * + * @note This method triggers Control::OnUpdateVisualProperties(). + */ + void UpdateVisualProperties(const std::vector>& properties); + + /** + * @copydoc Dali::Toolkit::Internal::Control::GetAccessibleObject() + */ + Toolkit::DevelControl::ControlAccessible* GetAccessibleObject(); + private: /** * Used as an alternative to boolean so that it is obvious whether a visual is enabled/disabled. @@ -441,28 +487,47 @@ private: */ void OnIdleCallback(); + /** + * @brief Checks highlighted object geometry if it is showing or not + */ + void CheckHighlightedObjectGeometry(); + + /** + * @brief Register property notification to check highlighted object position + */ + void RegisterAccessibilityPositionPropertyNotification(); + + /** + * @brief Remove property notification added by RegisterPropertyNotification + */ + void UnregisterAccessibilityPositionPropertyNotification(); + public: Control& mControlImpl; DevelControl::State mState; std::string mSubStateName; Property::Map mAccessibilityAttributes; - int mLeftFocusableActorId; ///< Actor ID of Left focusable control. - int mRightFocusableActorId; ///< Actor ID of Right focusable control. - int mUpFocusableActorId; ///< Actor ID of Up focusable control. - int mDownFocusableActorId; ///< Actor ID of Down focusable control. - - RegisteredVisualContainer mVisuals; ///< Stores visuals needed by the control, non trivial type so std::vector used. - std::string mStyleName; - Vector4 mBackgroundColor; ///< The color of the background visual - Vector3* mStartingPinchScale; ///< The scale when a pinch gesture starts, TODO: consider removing this - Extents mMargin; ///< The margin values - Extents mPadding; ///< The padding values - Toolkit::Control::KeyEventSignalType mKeyEventSignal; - Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusGainedSignal; - Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusLostSignal; - Toolkit::Control::ResourceReadySignalType mResourceReadySignal; - DevelControl::VisualEventSignalType mVisualEventSignal; + int mLeftFocusableActorId; ///< Actor ID of Left focusable control. + int mRightFocusableActorId; ///< Actor ID of Right focusable control. + int mUpFocusableActorId; ///< Actor ID of Up focusable control. + int mDownFocusableActorId; ///< Actor ID of Down focusable control. + int mClockwiseFocusableActorId; ///< Actor ID of Clockwise focusable control. + int mCounterClockwiseFocusableActorId; ///< Actor ID of Counter clockwise focusable control. + + RegisteredVisualContainer mVisuals; ///< Stores visuals needed by the control, non trivial type so std::vector used. + std::string mStyleName; + Vector4 mBackgroundColor; ///< The color of the background visual + Vector3* mStartingPinchScale; ///< The scale when a pinch gesture starts, TODO: consider removing this + Extents mMargin; ///< The margin values + Extents mPadding; ///< The padding values + Toolkit::Control::KeyEventSignalType mKeyEventSignal; + Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusGainedSignal; + Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusLostSignal; + Toolkit::Control::ResourceReadySignalType mResourceReadySignal; + DevelControl::VisualEventSignalType mVisualEventSignal; + + // Accessibility Toolkit::DevelControl::AccessibilityActivateSignalType mAccessibilityActivateSignal; Toolkit::DevelControl::AccessibilityReadingSkippedSignalType mAccessibilityReadingSkippedSignal; Toolkit::DevelControl::AccessibilityReadingPausedSignalType mAccessibilityReadingPausedSignal; @@ -475,21 +540,17 @@ public: Toolkit::DevelControl::AccessibilityDoGestureSignalType mAccessibilityDoGestureSignal; std::string mAccessibilityName; - bool mAccessibilityNameSet = false; - std::string mAccessibilityDescription; - bool mAccessibilityDescriptionSet = false; - std::string mAccessibilityTranslationDomain; - bool mAccessibilityTranslationDomainSet = false; + std::string mAutomationId; - bool mAccessibilityHighlightable = false; - bool mAccessibilityHighlightableSet = false; + bool mAccessibilityHighlightable = false; + bool mAccessibilityHidden = false; Dali::Accessibility::Role mAccessibilityRole = Dali::Accessibility::Role::UNKNOWN; - std::vector> mAccessibilityRelations; - bool mAccessibilityAnimated = false; + std::map> mAccessibilityRelations; + std::unique_ptr mAccessibleObject; // Gesture Detection PinchGestureDetector mPinchGestureDetector; @@ -508,6 +569,7 @@ public: bool mIsKeyboardFocusGroup : 1; ///< Stores whether the control is a focus group. bool mIsEmittingResourceReadySignal : 1; ///< True during ResourceReady(). bool mNeedToEmitResourceReady : 1; ///< True if need to emit the resource ready signal again. + bool mDispatchKeyEvents : 1; ///< Whether the actor emits key event signals RegisteredVisualContainer mRemoveVisuals; ///< List of visuals that are being replaced by another visual once ready @@ -534,24 +596,16 @@ public: static const PropertyRegistration PROPERTY_20; static const PropertyRegistration PROPERTY_21; static const PropertyRegistration PROPERTY_22; + static const PropertyRegistration PROPERTY_23; + static const PropertyRegistration PROPERTY_24; + static const PropertyRegistration PROPERTY_25; + static const PropertyRegistration PROPERTY_26; - /** - * The method acquires Accessible handle from Actor object - * @param actor Actor object - * @return handle to Accessible object - */ - static Dali::Accessibility::Accessible* GetAccessibilityObject(Dali::Actor actor); - Dali::Accessibility::Accessible* GetAccessibilityObject(); - - void AccessibilityRegister(); - void AccessibilityDeregister(); - - std::function(Actor)> accessibilityConstructor; - std::unique_ptr accessibilityObject; - Dali::PropertyNotification accessibilityNotificationPosition, accessibilityNotificationSize, accessibilityNotificationCulled; - bool accessibilityNotificationSet = false; - static void PositionOrSizeChangedCallback(PropertyNotification&); - static void CulledChangedCallback(PropertyNotification&); +private: + // Accessibility - notification for highlighted object to check if it is showing. + bool mIsAccessibilityPositionPropertyNotificationSet{false}; + Dali::PropertyNotification mAccessibilityPositionNotification; + Dali::Accessibility::ScreenRelativeMoveType mAccessibilityLastScreenRelativeMoveType{Accessibility::ScreenRelativeMoveType::OUTSIDE}; }; } // namespace Internal