Class CustomView
Definition
- Namespace:
- Tizen.NUI.BaseComponents
- Assembly:
- Tizen.NUI.dll
- API Level:
- 3
CustomView provides some common functionality required by all views.
C#Copypublic class CustomView : ViewWrapper, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable, IResourcesProvider
- Inheritance
-
System.ObjectTizen.NUI.Binding.ElementCustomView
- Derived
- Implements
-
System.ComponentModel.INotifyPropertyChangedSystem.IDisposable
Constructors
Declaration
C#Copypublic CustomView(string typeName, CustomViewBehaviour behaviour)
Parameters
Type | Name | Description |
---|---|---|
System.String | typeName | typename |
CustomViewBehaviour | behaviour | CustomView Behaviour |
API Level: 3
Properties
Declaration
C#Copypublic bool FocusGroup { get; set; }
Property Value
Type | Description |
---|---|
Boolean | True if this control is set as a focus group for keyboard navigation. |
API Level: 3
FocusNavigationSupport
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.
Declaration
C#Copypublic bool FocusNavigationSupport { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
API Level: 3
Methods
Declaration
C#Copypublic virtual float CalculateChildSize(View child, DimensionType dimension)
Parameters
Type | Name | Description |
---|---|---|
View | child | The child view to calculate the size for. |
DimensionType | dimension | The dimension to calculate the size, for example, the width or the height. |
Returns
Type | Description |
---|---|
System.Single | Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found. |
API Level: 3
CalculateChildSizeBase(View, DimensionType)
Calculates the size for a child using the base view object.
Declaration
C#Copyprotected float CalculateChildSizeBase(View child, DimensionType dimension)
Parameters
Type | Name | Description |
---|---|---|
View | child | The child view to calculate the size for. |
DimensionType | dimension | The dimension to calculate the size, for example, the width or the height. |
Returns
Type | Description |
---|---|
System.Single | Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found. |
API Level: 3
Declaration
C#Copyprotected Animation CreateTransition(TransitionData transitionData)
Parameters
Type | Name | Description |
---|---|---|
TransitionData | transitionData | The transition data describing the effect to create. |
Returns
Type | Description |
---|---|
Animation | A handle to an animation defined with the given effect, or an empty handle if no properties match. |
API Level: 3
EmitFocusSignal(Boolean)
Emits the KeyInputFocusGained signal if true, else, emits the KeyInputFocusLost signal.
Should be called last by the control after it acts on the input focus change.
Declaration
C#Copyprotected void EmitFocusSignal(bool focusGained)
Parameters
Type | Name | Description |
---|---|---|
Boolean | focusGained | True if gained, false if lost. |
API Level: 3
EnableGestureDetection(Gesture.GestureType)
Allows deriving classes to enable any of the gesture detectors that are available.
Gesture detection can be enabled one at a time or in a bitwise format.
Declaration
C#Copypublic void EnableGestureDetection(Gesture.GestureType type)
Parameters
Type | Name | Description |
---|---|---|
Gesture.GestureType | type | The gesture type(s) to enable. |
API Level: 3
EnableVisual(Int32, Boolean)
Sets the given visual to be displayed or not when parent staged.
For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
Declaration
C#Copyprotected void EnableVisual(int index, bool enable)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The property index of the visual, used to reference visual. |
Boolean | enable | Flag set to enabled or disabled. |
API Level: 3
GetHeightForWidth(Single)
This method is called during size negotiation when a height is required for a given width.
Derived classes should override this if they wish to customize the height returned.
Declaration
C#Copy[Obsolete("This has been deprecated in API9 and will be removed in API11. Use HeightForWidth property instead.")] public virtual float GetHeightForWidth(float width)
Parameters
Type | Name | Description |
---|---|---|
System.Single | width | Width to use |
Returns
Type | Description |
---|---|
System.Single | The height based on the width |
API Level: 3
Declaration
C#Copyprotected float GetHeightForWidthBase(float width)
Parameters
Type | Name | Description |
---|---|---|
System.Single | width | The width to use. |
Returns
Type | Description |
---|---|
System.Single | The height based on the width. |
API Level: 3
Declaration
C#Copypublic virtual Size2D GetNaturalSize()
Returns
Type | Description |
---|---|
Size2D | The view's natural size |
API Level: 3
GetNextFocusableView(View, View.FocusDirection, Boolean)
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.
Declaration
C#Copypublic virtual View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled)
Parameters
Type | Name | Description |
---|---|---|
View | currentFocusedView | The current focused view. |
View.FocusDirection | direction | The direction to move the focus towards. |
Boolean | loopEnabled | Whether the focus movement should be looped within the control. |
Returns
Type | Description |
---|---|
View | The next keyboard focusable view in this control or null if no view can be focused. |
API Level: 3
GetVisual(Int32)
Retrieves the visual associated with the given property index.
For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
Declaration
C#Copyprotected VisualBase GetVisual(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The property index of the visual used to reference visual. |
Returns
Type | Description |
---|---|
VisualBase | The registered visual if exists, otherwise an empty handle. |
API Level: 3
GetWidthForHeight(Single)
This method is called during size negotiation when a width is required for a given height.
Derived classes should override this if they wish to customize the width returned.
Declaration
C#Copy[Obsolete("This has been deprecated since API9 and will be removed in API11. Use WidthForHeight property instead.")] public virtual float GetWidthForHeight(float height)
Parameters
Type | Name | Description |
---|---|---|
System.Single | height | Height to use |
Returns
Type | Description |
---|---|
System.Single | The width based on the width |
API Level: 3
Declaration
C#Copyprotected float GetWidthForHeightBase(float height)
Parameters
Type | Name | Description |
---|---|---|
System.Single | height | The height to use. |
Returns
Type | Description |
---|---|
System.Single | The width based on the height. |
API Level: 3
IsVisualEnabled(Int32)
Queries if the given visual is to be displayed when parent staged.
For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
Declaration
C#Copyprotected bool IsVisualEnabled(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The property index of the visual. |
Returns
Type | Description |
---|---|
Boolean | Whether visual is enabled or not. |
API Level: 3
OnCalculateRelayoutSize(DimensionType)
The virtual method to notify deriving classes that relayout dependencies have been met and the size for this object is about to be calculated for the given dimension.
Declaration
C#Copypublic virtual void OnCalculateRelayoutSize(DimensionType dimension)
Parameters
Type | Name | Description |
---|---|---|
DimensionType | dimension | The dimension that is about to be calculated. |
API Level: 3
Declaration
C#Copypublic virtual void OnChildAdd(View view)
Parameters
Type | Name | Description |
---|---|---|
View | view | The child which has been added. |
API Level: 3
OnChildRemove(View)
Called after the owning view has attempted to remove a child( regardless of whether it succeeded or not ).
Declaration
C#Copypublic virtual void OnChildRemove(View view)
Parameters
Type | Name | Description |
---|---|---|
View | view | The child being removed. |
API Level: 3
OnFocusChangeCommitted(View)
Informs this control that its chosen focusable view will be focused.
This allows the application to preform any actions it wishes before the focus is actually moved to the chosen view.
Declaration
C#Copypublic virtual void OnFocusChangeCommitted(View commitedFocusableView)
Parameters
Type | Name | Description |
---|---|---|
View | commitedFocusableView | The commited focused view. |
API Level: 3
OnFocusGained()
Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is gained.
Declaration
C#Copypublic virtual void OnFocusGained()
API Level: 3
OnFocusLost()
Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is lost.
Declaration
C#Copypublic virtual void OnFocusLost()
API Level: 3
OnHover(Hover)
Called after a hover event is received by the owning view.
CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
Declaration
C#Copypublic virtual bool OnHover(Hover hover)
Parameters
Type | Name | Description |
---|---|---|
Hover | hover | The hover event. |
Returns
Type | Description |
---|---|
Boolean | True if the hover event should be consumed. |
API Level: 3
OnInitialize()
This method is called after the CustomView has been initialized.
After OnInitialize, the view will apply the style if it exists in the theme or it was given from constructor.
Derived classes should do any second phase initialization by overriding this method.
Declaration
C#Copypublic virtual void OnInitialize()
API Level: 3
Declaration
C#Copypublic virtual bool OnKey(Key key)
Parameters
Type | Name | Description |
---|---|---|
Key | key | The key event. |
Returns
Type | Description |
---|---|
Boolean | True if the key event should be consumed. |
API Level: 3
OnKeyboardEnter()
This method is called when the control has enter pressed on it.
Derived classes should override this to perform custom actions.
Declaration
C#Copypublic virtual bool OnKeyboardEnter()
Returns
Type | Description |
---|---|
Boolean | True if this control supported this action. |
API Level: 3
OnLayoutNegotiated(Single, DimensionType)
The virtual method to notify deriving classes that the size for a dimension has just been negotiated.
Declaration
C#Copypublic virtual void OnLayoutNegotiated(float size, DimensionType dimension)
Parameters
Type | Name | Description |
---|---|---|
System.Single | size | The new size for the given dimension. |
DimensionType | dimension | The dimension that was just negotiated. |
API Level: 3
OnPan(PanGesture)
Called whenever a pan gesture is detected on this control.
This should be overridden by deriving classes when pan detection is enabled.
There is no default behavior with panning.
Pan detection should be enabled via EnableGestureDetection().
Declaration
C#Copypublic virtual void OnPan(PanGesture pan)
Parameters
Type | Name | Description |
---|---|---|
PanGesture | pan | The pan gesture. |
API Level: 3
Declaration
C#Copypublic virtual void OnPropertySet(int index, PropertyValue propertyValue)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The property index that was set. |
PropertyValue | propertyValue | The value to set. |
API Level: 3
OnRelayout(Vector2, RelayoutContainer)
Called after the size negotiation has been finished for this control.
The control is expected to assign this given size to itself or its children.
Should be overridden by derived classes if they need to layout views differently after certain operations like add or remove views, resize, or after changing specific properties.
As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).
Declaration
C#Copypublic virtual void OnRelayout(Vector2 size, RelayoutContainer container)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | size | The allocated size. |
RelayoutContainer | container | The control should add views to this container that it is not able to allocate a size for. |
API Level: 3
OnSceneConnection(Int32)
Called after the view has been connected to the scene.
When a view is connected, it will be directly or indirectly parented to the root view.
The root view is provided automatically by Tizen.NUI.Window, and is always considered to be connected.
When the parent of a set of views is connected to the scene, then all of the children will receive this callback.
Declaration
C#Copypublic virtual void OnSceneConnection(int depth)
Parameters
Type | Name | Description |
---|---|---|
Int32 | depth | The depth in the hierarchy for the view. |
API Level: 8
OnSceneDisconnection()
Called after the view has been disconnected from the scene.
If a view is disconnected, it either has no parent, or is parented to a disconnected view.
When the parent of a set of views is disconnected to the scene, then all of the children will receive this callback, starting with the leaf views.
Declaration
C#Copypublic virtual void OnSceneDisconnection()
API Level: 8
Declaration
C#Copypublic virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
Parameters
Type | Name | Description |
---|---|---|
ResizePolicyType | policy | The policy being set. |
DimensionType | dimension | The policy is being set for. |
API Level: 3
OnSizeAnimation(Animation, Vector3)
Called when the owning view's size is animated, for example, using Animation::AnimateTo( Property ( view, View::Property::SIZE ), ... ).
Declaration
C#Copypublic virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
Parameters
Type | Name | Description |
---|---|---|
Animation | animation | The object which is animating the owning view. |
Vector3 | targetSize | The target size. |
API Level: 3
OnSizeSet(Vector3)
Called when the owning view's size is set, for example, using View.SetSize().
Declaration
C#Copypublic virtual void OnSizeSet(Vector3 targetSize)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | targetSize | The target size. |
API Level: 3
OnStageConnection(Int32)
Called after the view has been connected to the stage.
When a view is connected, it will be directly or indirectly parented to the root view.
The root view is provided automatically by Tizen.NUI.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 receive this callback.
Declaration
C#Copy[Obsolete("This has been deprecated since API8 and will be removed in API10. Use OnSceneConnection instead.")] public virtual void OnStageConnection(int depth)
Parameters
Type | Name | Description |
---|---|---|
Int32 | depth | The depth in the hierarchy for the view. |
API Level: 3
OnStageDisconnection()
Called after the view has been disconnected from the stage.
If a view is disconnected, it either has no parent, or is parented to a disconnected view.
When the parent of a set of views is disconnected to the stage, then all of the children will receive this callback, starting with the leaf views.
Declaration
C#Copy[Obsolete("This has been deprecated since API8 and will be removed in API10. Use OnSceneDisconnection instead.")] public virtual void OnStageDisconnection()
API Level: 3
OnStyleChange(StyleManager, StyleChangeType)
This method should be overridden by deriving classes requiring notifications when the style changes.
Declaration
C#Copy[Obsolete("Deprecated in API9, Will be removed in API11.")] public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
Parameters
Type | Name | Description |
---|---|---|
StyleManager | styleManager | The StyleManager object. |
StyleChangeType | change | Information denoting what has changed. |
API Level: 3
OnTap(TapGesture)
Called whenever a tap gesture is detected on this control.
This should be overridden by deriving classes when tap detection is enabled.
There is no default behavior with a tap.
Tap detection should be enabled via EnableGestureDetection().
Declaration
C#Copypublic virtual void OnTap(TapGesture tap)
Parameters
Type | Name | Description |
---|---|---|
TapGesture | tap | The tap gesture. |
API Level: 3
OnTouch(Touch)
Called after a touch event is received by the owning view.
CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
Declaration
C#Copypublic virtual bool OnTouch(Touch touch)
Parameters
Type | Name | Description |
---|---|---|
Touch | touch | The touch event. |
Returns
Type | Description |
---|---|
Boolean | True if the event should be consumed. |
API Level: 3
OnWheel(Wheel)
Called after a wheel event is received by the owning view.
CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
Declaration
C#Copypublic virtual bool OnWheel(Wheel wheel)
Parameters
Type | Name | Description |
---|---|---|
Wheel | wheel | The wheel event. |
Returns
Type | Description |
---|---|
Boolean | True if the wheel event should be consumed. |
API Level: 3
RegisterVisual(Int32, VisualBase)
Registers a visual by property index, linking a view to visual when required.
In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.
No parenting is done during registration, this should be done by a derived class.
Declaration
C#Copyprotected void RegisterVisual(int index, VisualBase visual)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The property index of the visual used to reference visual. |
VisualBase | visual | The visual to register. |
API Level: 3
RegisterVisual(Int32, VisualBase, Boolean)
Registers a visual by the property index, linking a view to visual when required.
In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.
If enabled is false, then the visual is not set on the stage until enabled by the derived class.
Declaration
C#Copyprotected void RegisterVisual(int index, VisualBase visual, bool enabled)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The property index of the visual used to reference visual. |
VisualBase | visual | The visual to register. |
Boolean | enabled | False if derived class wants to control when the visual is set on the stage. |
API Level: 3
RelayoutDependentOnChildren()
Determines if this view is dependent on it's children for relayout from the base class.
Declaration
C#Copypublic virtual bool RelayoutDependentOnChildren()
Returns
Type | Description |
---|---|
Boolean | Return true if the view is dependent on it's children. |
API Level: 3
RelayoutDependentOnChildren(DimensionType)
Determines if this view is dependent on it's children for relayout.
Declaration
C#Copypublic virtual bool RelayoutDependentOnChildren(DimensionType dimension)
Parameters
Type | Name | Description |
---|---|---|
DimensionType | dimension | The dimension(s) to check for. |
Returns
Type | Description |
---|---|
Boolean | Return if the view is dependent on it's children. |
API Level: 3
RelayoutDependentOnChildrenBase()
Determines if this view is dependent on it's children for relayout from the base class.
Declaration
C#Copyprotected bool RelayoutDependentOnChildrenBase()
Returns
Type | Description |
---|---|
Boolean | Return if the view is dependent on it's children. |
API Level: 3
RelayoutDependentOnChildrenBase(DimensionType)
Determines if this view is dependent on it's children for relayout from the base class.
Declaration
C#Copyprotected bool RelayoutDependentOnChildrenBase(DimensionType dimension)
Parameters
Type | Name | Description |
---|---|---|
DimensionType | dimension | The dimension(s) to check for. |
Returns
Type | Description |
---|---|
Boolean | Return if the view is dependent on it's children. |
API Level: 3
RelayoutRequest()
Requests 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 all controls which requested relayout will have their sizes (re)negotiated.
It can be called multiple times; the size negotiation is still only performed once, i.e., there is no need to keep track of this in the calling side.
Declaration
C#Copyprotected void RelayoutRequest()
API Level: 3
Declaration
C#Copypublic void SetBackground(PropertyMap map)
Parameters
Type | Name | Description |
---|---|---|
PropertyMap | map | The background property map. |
API Level: 3
UnregisterVisual(Int32)
Erases the entry matching the given index from the list of registered visuals.
Declaration
C#Copyprotected void UnregisterVisual(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The property index of the visual used to reference visual. |