X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=sharp%2Finternal%2FCustomView.cs;fp=src%2FTizen.NUI%2Fdevel-src%2FCustomView.cs;h=9811515fb6b9906502f4e0f403b0bf19e26ae263;hb=7a8e18ba46f931edcc9995ffe112033e1a22f8b1;hp=7f2acf5ebfb6064aa09c17be22659c3e11b623b3;hpb=97105260d2b66c80239ccf7d3f8392135193fe8d;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.NUI/devel-src/CustomView.cs b/sharp/internal/CustomView.cs old mode 100755 new mode 100644 similarity index 73% rename from src/Tizen.NUI/devel-src/CustomView.cs rename to sharp/internal/CustomView.cs index 7f2acf5..9811515 --- a/src/Tizen.NUI/devel-src/CustomView.cs +++ b/sharp/internal/CustomView.cs @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * Copyright (c) 2017 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. @@ -15,14 +15,11 @@ * */ -namespace Tizen.NUI +namespace Dali { - /// - /// CustomView provides some common functionality required by all views. - /// public class CustomView : ViewWrapper { - public CustomView(string typeName, CustomViewBehaviour behaviour) : base(typeName, new ViewWrapperImpl(behaviour)) + public CustomView(string typeName, ViewWrapperImpl.CustomViewBehaviour behaviour) : base(typeName, new ViewWrapperImpl(behaviour)) { // Registering CustomView virtual functions to viewWrapperImpl delegates. viewWrapperImpl.OnStageConnection = new ViewWrapperImpl.OnStageConnectionDelegate(OnStageConnection); @@ -56,7 +53,7 @@ namespace Tizen.NUI viewWrapperImpl.OnAccessibilityZoom = new ViewWrapperImpl.OnAccessibilityZoomDelegate(OnAccessibilityZoom); viewWrapperImpl.OnKeyInputFocusGained = new ViewWrapperImpl.OnKeyInputFocusGainedDelegate(OnKeyInputFocusGained); viewWrapperImpl.OnKeyInputFocusLost = new ViewWrapperImpl.OnKeyInputFocusLostDelegate(OnKeyInputFocusLost); - viewWrapperImpl.GetNextKeyboardFocusableView = new ViewWrapperImpl.GetNextKeyboardFocusableViewDelegate(GetNextKeyboardFocusableView); + viewWrapperImpl.GetNextKeyboardFocusableActor = new ViewWrapperImpl.GetNextKeyboardFocusableActorDelegate(GetNextKeyboardFocusableView); viewWrapperImpl.OnKeyboardFocusChangeCommitted = new ViewWrapperImpl.OnKeyboardFocusChangeCommittedDelegate(OnKeyboardFocusChangeCommitted); viewWrapperImpl.OnKeyboardEnter = new ViewWrapperImpl.OnKeyboardEnterDelegate(OnKeyboardEnter); viewWrapperImpl.OnPinch = new ViewWrapperImpl.OnPinchDelegate(OnPinch); @@ -72,15 +69,16 @@ namespace Tizen.NUI // Set the StyleName the name of the View // We have to do this because the StyleManager on Native side can't workout it out - // This will also ensure that the style of actors/visuals initialized above are applied by the style manager. - SetStyleName(this.GetType().Name); + // This will also ensure that the style of views/visuals initialized above are applied by the style manager. + SetStyleName( this.GetType().Name ); } - /// - /// Set the background with a property map. - /// - /// The background property map - public void SetBackground(Tizen.NUI.PropertyMap map) + /** + * @brief Set the background with a property map. + * + * @param[in] map The background property map. + */ + public void SetBackground(Dali.Property.Map map) { viewWrapperImpl.SetBackground(map); } @@ -106,70 +104,42 @@ namespace Tizen.NUI * @param[in] type The gesture type(s) to disable. * @see EnableGetureDetection */ - internal void DisableGestureDetection(Gesture.GestureType type) + public void DisableGestureDetection(Gesture.GestureType type) { viewWrapperImpl.DisableGestureDetection(type); } - /// - /// Sets whether this control supports two dimensional keyboard navigation - /// (i.e. whether it knows how to handle the keyboard focus movement between its child actors). - /// The control doesn't support it by default. - /// - /// Whether this control supports two dimensional keyboard navigation. - public bool FocusNavigationSupport - { - get - { - return IsKeyboardNavigationSupported(); - } - set - { - SetKeyboardNavigationSupport(value); - } - } - - internal void SetKeyboardNavigationSupport(bool isSupported) + /** + * @brief Sets whether this control supports two dimensional + * keyboard navigation (i.e. whether it knows how to handle the + * keyboard focus movement between its child views). + * + * The control doesn't support it by default. + * @param[in] isSupported Whether this control supports two dimensional keyboard navigation. + */ + public void SetKeyboardNavigationSupport(bool isSupported) { viewWrapperImpl.SetKeyboardNavigationSupport(isSupported); } - /** * @brief Gets whether this control supports two dimensional keyboard navigation. * * @return true if this control supports two dimensional keyboard navigation. */ - internal bool IsKeyboardNavigationSupported() + public bool IsKeyboardNavigationSupported() { return viewWrapperImpl.IsKeyboardNavigationSupported(); } - - /// - /// Sets or Gets whether this control is a focus group for keyboard navigation. - /// - /// true if this control is set as a focus group for keyboard navigation - public bool FocusGroup - { - get - { - return IsKeyboardFocusGroup(); - } - set - { - SetAsKeyboardFocusGroup(value); - } - } - /** * @brief Sets whether this control is a focus group for keyboard navigation. * * (i.e. the scope of keyboard focus movement - * can be limitied to its child actors). The control is not a focus group by default. + * can be limitied to its child views). The control is not a focus group by default. * @param[in] isFocusGroup Whether this control is set as a focus group for keyboard navigation. */ - internal void SetAsKeyboardFocusGroup(bool isFocusGroup) + public void SetAsKeyboardFocusGroup(bool isFocusGroup) { viewWrapperImpl.SetAsKeyboardFocusGroup(isFocusGroup); } @@ -179,7 +149,7 @@ namespace Tizen.NUI * * @return true if this control is set as a focus group for keyboard navigation. */ - internal bool IsKeyboardFocusGroup() + public bool IsKeyboardFocusGroup() { return viewWrapperImpl.IsKeyboardFocusGroup(); } @@ -188,31 +158,32 @@ namespace Tizen.NUI * @brief Called by the AccessibilityManager to activate the Control. * @SINCE_1_0.0 */ - internal void AccessibilityActivate() + public void AccessibilityActivate() { viewWrapperImpl.AccessibilityActivate(); } - /// - /// Called by the KeyboardFocusManager. - /// - internal void KeyboardEnter() + /** + * @brief Called by the KeyboardFocusManager. + */ + public void KeyboardEnter() { viewWrapperImpl.KeyboardEnter(); } - /// - /// Called by the KeyInputFocusManager to emit key event signals. - /// - /// The key event - /// True if the event was consumed - internal bool EmitKeyEventSignal(Key key) + /** + * @brief Called by the KeyInputFocusManager to emit key event signals. + * + * @param[in] key The key event. + * @return True if the event was consumed. + */ + public bool EmitKeyEventSignal(Key key) { return viewWrapperImpl.EmitKeyEventSignal(key); } /** - * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene). + * @brief Request a relayout, which means performing a size negotiation on this view, 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 @@ -227,53 +198,53 @@ namespace Tizen.NUI } /** - * @brief Provides the Actor implementation of GetHeightForWidth. + * @brief Provides the View implementation of GetHeightForWidth. * @param width Width to use. * @return The height based on the width. */ protected float GetHeightForWidthBase(float width) { - return viewWrapperImpl.GetHeightForWidthBase(width); + return viewWrapperImpl.GetHeightForWidthBase( width ); } /** - * @brief Provides the Actor implementation of GetWidthForHeight. + * @brief Provides the View implementation of GetWidthForHeight. * @param height Height to use. * @return The width based on the height. */ protected float GetWidthForHeightBase(float height) { - return viewWrapperImpl.GetWidthForHeightBase(height); + return viewWrapperImpl.GetWidthForHeightBase( height ); } /** - * @brief Calculate the size for a child using the base actor object. + * @brief Calculate the size for a child using the base view object. * - * @param[in] child The child actor to calculate the size for + * @param[in] child The child view 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. */ - protected float CalculateChildSizeBase(Actor child, DimensionType dimension) + protected float CalculateChildSizeBase(View child, DimensionType dimension) { - return viewWrapperImpl.CalculateChildSizeBase(child, dimension); + return viewWrapperImpl.CalculateChildSizeBase( child, dimension ); } /** - * @brief Determine if this actor is dependent on it's children for relayout from the base class. + * @brief Determine if this view is dependent on it's children for relayout from the base class. * * @param dimension The dimension(s) to check for - * @return Return if the actor is dependent on it's children. + * @return Return if the view is dependent on it's children. */ protected bool RelayoutDependentOnChildrenBase(DimensionType dimension) { - return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension); + return viewWrapperImpl.RelayoutDependentOnChildrenBase( dimension ); } /** - * @brief Determine if this actor is dependent on it's children for relayout from the base class. + * @brief Determine if this view is dependent on it's children for relayout from the base class. * * @param dimension The dimension(s) to check for - * @return Return if the actor is dependent on it's children. + * @return Return if the view is dependent on it's children. */ protected bool RelayoutDependentOnChildrenBase() { @@ -281,23 +252,23 @@ namespace Tizen.NUI } /** - * @brief Register a visual by Property Index, linking an Actor to visual when required. - * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle. + * @brief Register a visual by Property Index, linking an View to visual when required. + * In the case of the visual being an view or control deeming visual not required then visual should be an empty handle. * No parenting is done during registration, this should be done by derived class. * * @param[in] index The Property index of the visual, used to reference visual * @param[in] visual The visual to register - * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage. + * @note Derived class should not call visual.SetOnStage(view). It is the responsibility of the base class to connect/disconnect registered visual to stage. * Use below API with enabled set to false if derived class wishes to control when visual is staged. */ protected void RegisterVisual(int index, VisualBase visual) { - viewWrapperImpl.RegisterVisual(index, visual); + viewWrapperImpl.RegisterVisual( index, visual ); } /** - * @brief Register a visual by Property Index, linking an Actor to visual when required. - * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle. + * @brief Register a visual by Property Index, linking an View to visual when required. + * In the case of the visual being an view or control deeming visual not required then visual should be an empty handle. * If enabled is false then the visual is not set on stage until enabled by the derived class. * @see EnableVisual * @@ -308,7 +279,7 @@ namespace Tizen.NUI */ protected void RegisterVisual(int index, VisualBase visual, bool enabled) { - viewWrapperImpl.RegisterVisual(index, visual, enabled); + viewWrapperImpl.RegisterVisual( index, visual, enabled ); } /** @@ -318,7 +289,7 @@ namespace Tizen.NUI */ protected void UnregisterVisual(int index) { - viewWrapperImpl.UnregisterVisual(index); + viewWrapperImpl.UnregisterVisual( index ); } /** @@ -330,7 +301,7 @@ namespace Tizen.NUI */ protected VisualBase GetVisual(int index) { - return viewWrapperImpl.GetVisual(index); + return viewWrapperImpl.GetVisual( index ); } /** @@ -341,7 +312,7 @@ namespace Tizen.NUI */ protected void EnableVisual(int index, bool enable) { - viewWrapperImpl.EnableVisual(index, enable); + viewWrapperImpl.EnableVisual( index, enable ); } /** @@ -352,7 +323,7 @@ namespace Tizen.NUI */ protected bool IsVisualEnabled(int index) { - return viewWrapperImpl.IsVisualEnabled(index); + return viewWrapperImpl.IsVisualEnabled( index ); } /** @@ -364,7 +335,7 @@ namespace Tizen.NUI */ protected Animation CreateTransition(TransitionData transitionData) { - return viewWrapperImpl.CreateTransition(transitionData); + return viewWrapperImpl.CreateTransition( transitionData ); } /** @@ -376,7 +347,7 @@ namespace Tizen.NUI */ protected void EmitKeyInputFocusSignal(bool focusGained) { - viewWrapperImpl.EmitKeyInputFocusSignal(focusGained); + viewWrapperImpl.EmitKeyInputFocusSignal( focusGained ); } /** @@ -389,15 +360,15 @@ namespace Tizen.NUI } /** - * @brief Called after the actor has been connected to the stage. + * @brief Called after the view has been connected to the stage. * - * When an actor is connected, it will be directly or indirectly parented to the root Actor. - * @param[in] depth The depth in the hierarchy for the actor + * When an view is connected, it will be directly or indirectly parented to the root View. + * @param[in] depth The depth in the hierarchy for the view * - * @note The root Actor is provided automatically by Dali::Stage, and is always considered to be connected. - * When the parent of a set of actors is connected to the stage, then all of the children + * @note The root View is provided automatically by Dali::Stage, and is always considered to be connected. + * When the parent of a set of views is connected to the stage, then all of the children * will received this callback. - * For the following actor tree, the callback order will be A, B, D, E, C, and finally F. + * For the following view tree, the callback order will be A, B, D, E, C, and finally F. * * @code * @@ -408,20 +379,20 @@ namespace Tizen.NUI * D E F * * @endcode - * @param[in] depth The depth in the hierarchy for the actor + * @param[in] depth The depth in the hierarchy for the view */ public virtual void OnStageConnection(int depth) { } /** - * @brief Called after the actor has been disconnected from Stage. + * @brief Called after the view has been disconnected from Stage. * - * If an actor is disconnected it either has no parent, or is parented to a disconnected actor. + * If an view is disconnected it either has no parent, or is parented to a disconnected view. * - * @note When the parent of a set of actors is disconnected to the stage, then all of the children - * will received this callback, starting with the leaf actors. - * For the following actor tree, the callback order will be D, E, B, F, C, and finally A. + * @note When the parent of a set of views is disconnected to the stage, then all of the children + * will received this callback, starting with the leaf views. + * For the following view tree, the callback order will be D, E, B, F, C, and finally A. * * @code * @@ -438,47 +409,47 @@ namespace Tizen.NUI } /** - * @brief Called after a child has been added to the owning actor. + * @brief Called after a child has been added to the owning view. * * @param[in] child The child which has been added */ - public virtual void OnChildAdd(Actor actor) + public virtual void OnChildAdd(View view) { } /** - * @brief Called after the owning actor has attempted to remove a child( regardless of whether it succeeded or not ). + * @brief Called after the owning view has attempted to remove a child( regardless of whether it succeeded or not ). * * @param[in] child The child being removed */ - public virtual void OnChildRemove(Actor actor) + public virtual void OnChildRemove(View View) { } /** - * @brief Called when the owning actor property is set. + * @brief Called when the owning view property is set. * * @param[in] index The Property index that was set * @param[in] propertyValue The value to set */ - public virtual void OnPropertySet(int index, Tizen.NUI.PropertyValue propertyValue) + public virtual void OnPropertySet(int index, Dali.Property.Value propertyValue) { } /** - * @brief Called when the owning actor's size is set e.g. using Actor::SetSize(). + * @brief Called when the owning view's size is set e.g. using View::SetSize(). * - * @param[in] targetSize The target size. Note that this target size may not match the size returned via Actor.GetTargetSize. + * @param[in] targetSize The target size. Note that this target size may not match the size returned via View.GetTargetSize. */ public virtual void OnSizeSet(Vector3 targetSize) { } /** - * @brief Called when the owning actor's size is animated e.g. using Animation::AnimateTo( Property( actor, Actor::Property::SIZE ), ... ). + * @brief Called when the owning view's size is animated e.g. using Animation::AnimateTo( Property( view, View::Property::SIZE ), ... ). * - * @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 view. + * @param[in] targetSize The target size. Note that this target size may not match the size returned via @ref View.GetTargetSize. */ public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize) { @@ -487,7 +458,7 @@ namespace Tizen.NUI /** * @DEPRECATED_1_1.37 Connect to TouchSignal() instead. * - * @brief Called after a touch-event is received by the owning actor. + * @brief Called after a touch-event is received by the owning view. * * @param[in] touch The touch event * @return True if the event should be consumed. @@ -499,7 +470,7 @@ namespace Tizen.NUI } /** - * @brief Called after a hover-event is received by the owning actor. + * @brief Called after a hover-event is received by the owning view. * * @param[in] hover The hover event * @return True if the hover event should be consumed. @@ -511,7 +482,7 @@ namespace Tizen.NUI } /** - * @brief Called after a key-event is received by the actor that has had its focus set. + * @brief Called after a key-event is received by the view that has had its focus set. * * @param[in] key the Key Event * @return True if the event should be consumed. @@ -522,7 +493,7 @@ namespace Tizen.NUI } /** - * @brief Called after a wheel-event is received by the owning actor. + * @brief Called after a wheel-event is received by the owning view. * * @param[in] wheel The wheel event * @return True if the event should be consumed. @@ -539,11 +510,11 @@ namespace Tizen.NUI * The control is expected to assign this given size to itself/its children. * * Should be overridden by derived classes if they need to layout - * actors differently after certain operations like add or remove - * actors, resize or after changing specific properties. + * views differently after certain operations like add or remove + * views, resize or after changing specific properties. * * @param[in] size The allocated size. - * @param[in,out] container The control should add actors to this container that it is not able + * @param[in,out] container The control should add views to this container that it is not able * 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). @@ -563,25 +534,25 @@ namespace Tizen.NUI } /** - * @brief Return the natural size of the actor. + * @brief Return the natural size of the view. * - * @return The actor's natural size + * @return The view's natural size */ - public virtual Size GetNaturalSize() + public virtual Vector3 GetNaturalSize() { - return new Size(0.0f, 0.0f, 0.0f); + return new Vector3(0.0f, 0.0f, 0.0f); } /** * @brief Calculate the size for a child. * - * @param[in] child The child actor to calculate the size for + * @param[in] child The child view 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. */ - public virtual float CalculateChildSize(Actor child, DimensionType dimension) + public virtual float CalculateChildSize(View child, DimensionType dimension) { - return viewWrapperImpl.CalculateChildSizeBase(child, dimension); + return viewWrapperImpl.CalculateChildSizeBase( child, dimension ); } /** @@ -594,7 +565,7 @@ namespace Tizen.NUI */ public virtual float GetHeightForWidth(float width) { - return viewWrapperImpl.GetHeightForWidthBase(width); + return viewWrapperImpl.GetHeightForWidthBase( width ); } /** @@ -607,24 +578,24 @@ namespace Tizen.NUI */ public virtual float GetWidthForHeight(float height) { - return viewWrapperImpl.GetWidthForHeightBase(height); + return viewWrapperImpl.GetWidthForHeightBase( height ); } /** - * @brief Determine if this actor is dependent on it's children for relayout. + * @brief Determine if this view is dependent on it's children for relayout. * * @param dimension The dimension(s) to check for - * @return Return if the actor is dependent on it's children. + * @return Return if the view is dependent on it's children. */ public virtual bool RelayoutDependentOnChildren(DimensionType dimension) { - return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension); + return viewWrapperImpl.RelayoutDependentOnChildrenBase( dimension ); } /** - * @brief Determine if this actor is dependent on it's children for relayout from the base class. + * @brief Determine if this view is dependent on it's children for relayout from the base class. * - * @return Return if the actor is dependent on it's children. + * @return Return if the view is dependent on it's children. */ public virtual bool RelayoutDependentOnChildren() { @@ -668,7 +639,7 @@ namespace Tizen.NUI * Derived classes should override this to perform custom accessibility activation. * @return true if this control can perform accessibility activation. */ - internal virtual bool OnAccessibilityActivated() + public virtual bool OnAccessibilityActivated() { return false; } @@ -680,7 +651,7 @@ namespace Tizen.NUI * @param[in] gesture The pan gesture. * @return true if the pan gesture has been consumed by this control */ - internal virtual bool OnAccessibilityPan(PanGesture gestures) + public virtual bool OnAccessibilityPan(PanGesture gestures) { return false; } @@ -692,7 +663,7 @@ namespace Tizen.NUI * @param[in] touch The touch event. * @return true if the touch event has been consumed by this control */ - internal virtual bool OnAccessibilityTouch(Touch touch) + public virtual bool OnAccessibilityTouch(Touch touch) { return false; } @@ -704,7 +675,7 @@ namespace Tizen.NUI * @param[in] isIncrease Whether the value should be increased or decreased * @return true if the value changed action has been consumed by this control */ - internal virtual bool OnAccessibilityValueChange(bool isIncrease) + public virtual bool OnAccessibilityValueChange(bool isIncrease) { return false; } @@ -715,7 +686,7 @@ namespace Tizen.NUI * * @return true if the zoom action has been consumed by this control */ - internal virtual bool OnAccessibilityZoom() + public virtual bool OnAccessibilityZoom() { return false; } @@ -740,26 +711,26 @@ namespace Tizen.NUI } /** - * @brief Gets the next keyboard focusable actor in this control towards the given direction. + * @brief Gets the next keyboard focusable view in this control towards the given direction. * * A control needs to override this function in order to support two dimensional keyboard navigation. - * @param[in] currentFocusedActor The current focused actor. + * @param[in] currentFocusedView The current focused view. * @param[in] direction The direction to move the focus towards. - * @param[in] loopEnabled Whether the focus movement should be looped within the control. - * @return the next keyboard focusable actor in this control or an empty handle if no actor can be focused. + * @param[in] loopEnabled Whether the focus movement should be looped within the view. + * @return the next keyboard focusable view in this control or an empty handle if no view can be focused. */ - public virtual View GetNextKeyboardFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled) + public virtual View GetNextKeyboardFocusableView(View currentFocusedView, View.KeyboardFocus.Direction direction, bool loopEnabled) { return new View(); } /** - * @brief Informs this control that its chosen focusable actor will be focused. + * @brief Informs this control that its chosen focusable view will be focused. * * This allows the application to preform any actions if wishes - * before the focus is actually moved to the chosen actor. + * before the focus is actually moved to the chosen view. * - * @param[in] commitedFocusableActor The commited focusable actor. + * @param[in] commitedFocusableView The commited focusable view. */ public virtual void OnKeyboardFocusChangeCommitted(View commitedFocusableView) { @@ -788,7 +759,7 @@ namespace Tizen.NUI * @note Pinch detection should be enabled via EnableGestureDetection(). * @see EnableGestureDetection */ - internal virtual void OnPinch(PinchGesture pinch) + public virtual void OnPinch(PinchGesture pinch) { } @@ -833,24 +804,16 @@ namespace Tizen.NUI * @note Long press detection should be enabled via EnableGestureDetection(). * @see EnableGestureDetection */ - internal virtual void OnLongPress(LongPressGesture longPress) + public virtual void OnLongPress(LongPressGesture longPress) { } - private void OnControlChildAdd(Actor child) + private void OnControlChildAdd(View child) { } - private void OnControlChildRemove(Actor child) + private void OnControlChildRemove(View child) { } } - public enum CustomViewBehaviour - { - ViewBehaviourDefault = 0, - DisableSizeNegotiation = 1 << 0, - RequiresKeyboardNavigationSupport = 1 << 5, - DisableStyleChangeSignals = 1 << 6, - LastViewBehaviourFlag - } }