X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fevent%2Factors%2Factor-impl.h;h=b1050a74850b1662b0edabf336fdb3a827d10476;hb=032363632332b2657f0afe41d1b47ead0621b374;hp=8ab4be7f0994ad7efef60984369df4df4a58caa9;hpb=b812c0a74928ce3bf17381d74247536c0b0b3a72;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/event/actors/actor-impl.h b/dali/internal/event/actors/actor-impl.h index 8ab4be7..b1050a7 100644 --- a/dali/internal/event/actors/actor-impl.h +++ b/dali/internal/event/actors/actor-impl.h @@ -644,6 +644,41 @@ public: } /** + * Sets whether an actor should be enabled all user interaction including touch, focus and activation. + * This value have higher priority over the sensitve and focusable in negative action, + * which means IsSensitive() or IsFocusable() and enable is false, actor will not emits touch or focus event. + * An actor is enabled by default. + * + * If the application wishes to temporarily disable user interaction: + * @code + * actor.SetUserInteractionEnabled(false); + * @endcode + * + * Then, to re-enable user interaction, the application should call: + * @code + * actor.SetUserInteractionEnabled(true); + * @endcode + * + * @see IsSensitive(), IsHittable(), IsKeyboardFocusable() and IsTouchFocusable(). + * @note If an actor's disabled, child still can be enabled. + * @param[in] enabled true to enable user interaction, false otherwise. + */ + void SetUserInteractionEnabled(bool enabled) + { + mUserInteractionEnabled = enabled; + } + + /** + * Query whether an actor is enabled user interaction. + * @see SetSensitive(bool) + * @return true, if user interaction is enabled, false otherwise. + */ + bool IsUserInteractionEnabled() const + { + return mUserInteractionEnabled; + } + + /** * @copydoc Dali::Actor::SetDrawMode */ void SetDrawMode(DrawMode::Type drawMode); @@ -1247,7 +1282,7 @@ public: */ bool IsHittable() const { - return IsSensitive() && IsVisible() && (GetCurrentWorldColor().a > FULLY_TRANSPARENT) && IsNodeConnected(); + return (IsUserInteractionEnabled()) && IsSensitive() && IsVisible() && (GetCurrentWorldColor().a > FULLY_TRANSPARENT) && IsNodeConnected(); } /** @@ -1859,6 +1894,7 @@ protected: bool mCaptureAllTouchAfterStart : 1; ///< Whether the actor should capture all touch after touch starts even if the motion moves outside of the actor area. bool mIsBlendEquationSet : 1; ///< Flag to identify whether the Blend equation is set bool mNeedGesturePropagation : 1; ///< Whether the parent listens for gesture events or not + bool mUserInteractionEnabled : 1; ///< Whether the actor should be enabled user interaction. LayoutDirection::Type mLayoutDirection : 2; ///< Layout direction, Left to Right or Right to Left. DrawMode::Type mDrawMode : 3; ///< Cached: How the actor and its children should be drawn ColorMode mColorMode : 3; ///< Cached: Determines whether mWorldColor is inherited