/*
- * 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.
*
*/
-namespace Tizen.NUI
+namespace Dali
{
- /// <summary>
- /// CustomView provides some common functionality required by all views.
- /// </summary>
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);
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);
// 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 );
}
- /// <summary>
- /// Set the background with a property map.
- /// </summary>
- /// <param name="map">The background property map</param>
- 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);
}
* @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);
}
- /// <summary>
- /// 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.
- /// </summary>
- /// <param name="isSupported">Whether this control supports two dimensional keyboard navigation.</param>
- 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();
}
-
- /// <summary>
- /// Sets or Gets whether this control is a focus group for keyboard navigation.
- /// </summary>
- /// <returns>true if this control is set as a focus group for keyboard navigation</returns>
- 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);
}
*
* @return true if this control is set as a focus group for keyboard navigation.
*/
- internal bool IsKeyboardFocusGroup()
+ public bool IsKeyboardFocusGroup()
{
return viewWrapperImpl.IsKeyboardFocusGroup();
}
* @brief Called by the AccessibilityManager to activate the Control.
* @SINCE_1_0.0
*/
- internal void AccessibilityActivate()
+ public void AccessibilityActivate()
{
viewWrapperImpl.AccessibilityActivate();
}
- /// <summary>
- /// Called by the KeyboardFocusManager.
- /// </summary>
- internal void KeyboardEnter()
+ /**
+ * @brief Called by the KeyboardFocusManager.
+ */
+ public void KeyboardEnter()
{
viewWrapperImpl.KeyboardEnter();
}
- /// <summary>
- /// Called by the KeyInputFocusManager to emit key event signals.
- /// </summary>
- /// <param name="key">The key event</param>
- /// <returns>True if the event was consumed</returns>
- 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
}
/**
- * @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()
{
}
/**
- * @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
*
*/
protected void RegisterVisual(int index, VisualBase visual, bool enabled)
{
- viewWrapperImpl.RegisterVisual(index, visual, enabled);
+ viewWrapperImpl.RegisterVisual( index, visual, enabled );
}
/**
*/
protected void UnregisterVisual(int index)
{
- viewWrapperImpl.UnregisterVisual(index);
+ viewWrapperImpl.UnregisterVisual( index );
}
/**
*/
protected VisualBase GetVisual(int index)
{
- return viewWrapperImpl.GetVisual(index);
+ return viewWrapperImpl.GetVisual( index );
}
/**
*/
protected void EnableVisual(int index, bool enable)
{
- viewWrapperImpl.EnableVisual(index, enable);
+ viewWrapperImpl.EnableVisual( index, enable );
}
/**
*/
protected bool IsVisualEnabled(int index)
{
- return viewWrapperImpl.IsVisualEnabled(index);
+ return viewWrapperImpl.IsVisualEnabled( index );
}
/**
*/
protected Animation CreateTransition(TransitionData transitionData)
{
- return viewWrapperImpl.CreateTransition(transitionData);
+ return viewWrapperImpl.CreateTransition( transitionData );
}
/**
*/
protected void EmitKeyInputFocusSignal(bool focusGained)
{
- viewWrapperImpl.EmitKeyInputFocusSignal(focusGained);
+ viewWrapperImpl.EmitKeyInputFocusSignal( focusGained );
}
/**
}
/**
- * @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
*
* 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
*
}
/**
- * @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)
{
/**
* @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.
}
/**
- * @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.
}
/**
- * @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.
}
/**
- * @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.
* 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).
}
/**
- * @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 );
}
/**
*/
public virtual float GetHeightForWidth(float width)
{
- return viewWrapperImpl.GetHeightForWidthBase(width);
+ return viewWrapperImpl.GetHeightForWidthBase( width );
}
/**
*/
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()
{
* 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;
}
* @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;
}
* @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;
}
* @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;
}
*
* @return true if the zoom action has been consumed by this control
*/
- internal virtual bool OnAccessibilityZoom()
+ public virtual bool OnAccessibilityZoom()
{
return false;
}
}
/**
- * @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)
{
* @note Pinch detection should be enabled via EnableGestureDetection().
* @see EnableGestureDetection
*/
- internal virtual void OnPinch(PinchGesture pinch)
+ public virtual void OnPinch(PinchGesture pinch)
{
}
* @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
- }
}