2 * Copyright (c) 2017 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 namespace Tizen.NUI.BaseComponents
21 /// CustomView provides some common functionality required by all views.
23 public class CustomView : ViewWrapper
25 public CustomView(string typeName, CustomViewBehaviour behaviour) : base(typeName, new ViewWrapperImpl(behaviour))
27 // Registering CustomView virtual functions to viewWrapperImpl delegates.
28 viewWrapperImpl.OnStageConnection = new ViewWrapperImpl.OnStageConnectionDelegate(OnStageConnection);
29 viewWrapperImpl.OnStageDisconnection = new ViewWrapperImpl.OnStageDisconnectionDelegate(OnStageDisconnection);
30 viewWrapperImpl.OnChildAdd = new ViewWrapperImpl.OnChildAddDelegate(OnChildAdd);
31 viewWrapperImpl.OnChildRemove = new ViewWrapperImpl.OnChildRemoveDelegate(OnChildRemove);
32 viewWrapperImpl.OnPropertySet = new ViewWrapperImpl.OnPropertySetDelegate(OnPropertySet);
33 viewWrapperImpl.OnSizeSet = new ViewWrapperImpl.OnSizeSetDelegate(OnSizeSet);
34 viewWrapperImpl.OnSizeAnimation = new ViewWrapperImpl.OnSizeAnimationDelegate(OnSizeAnimation);
35 viewWrapperImpl.OnTouch = new ViewWrapperImpl.OnTouchDelegate(OnTouch);
36 viewWrapperImpl.OnHover = new ViewWrapperImpl.OnHoverDelegate(OnHover);
37 viewWrapperImpl.OnKey = new ViewWrapperImpl.OnKeyDelegate(OnKey);
38 viewWrapperImpl.OnWheel = new ViewWrapperImpl.OnWheelDelegate(OnWheel);
39 viewWrapperImpl.OnRelayout = new ViewWrapperImpl.OnRelayoutDelegate(OnRelayout);
40 viewWrapperImpl.OnSetResizePolicy = new ViewWrapperImpl.OnSetResizePolicyDelegate(OnSetResizePolicy);
41 viewWrapperImpl.GetNaturalSize = new ViewWrapperImpl.GetNaturalSizeDelegate(GetNaturalSize);
42 viewWrapperImpl.CalculateChildSize = new ViewWrapperImpl.CalculateChildSizeDelegate(CalculateChildSize);
43 viewWrapperImpl.GetHeightForWidth = new ViewWrapperImpl.GetHeightForWidthDelegate(GetHeightForWidth);
44 viewWrapperImpl.GetWidthForHeight = new ViewWrapperImpl.GetWidthForHeightDelegate(GetWidthForHeight);
45 viewWrapperImpl.RelayoutDependentOnChildrenDimension = new ViewWrapperImpl.RelayoutDependentOnChildrenDimensionDelegate(RelayoutDependentOnChildren);
46 viewWrapperImpl.RelayoutDependentOnChildren = new ViewWrapperImpl.RelayoutDependentOnChildrenDelegate(RelayoutDependentOnChildren);
47 viewWrapperImpl.OnCalculateRelayoutSize = new ViewWrapperImpl.OnCalculateRelayoutSizeDelegate(OnCalculateRelayoutSize);
48 viewWrapperImpl.OnLayoutNegotiated = new ViewWrapperImpl.OnLayoutNegotiatedDelegate(OnLayoutNegotiated);
49 viewWrapperImpl.OnControlChildAdd = new ViewWrapperImpl.OnControlChildAddDelegate(OnControlChildAdd);
50 viewWrapperImpl.OnControlChildRemove = new ViewWrapperImpl.OnControlChildRemoveDelegate(OnControlChildRemove);
51 viewWrapperImpl.OnStyleChange = new ViewWrapperImpl.OnStyleChangeDelegate(OnStyleChange);
52 viewWrapperImpl.OnAccessibilityActivated = new ViewWrapperImpl.OnAccessibilityActivatedDelegate(OnAccessibilityActivated);
53 viewWrapperImpl.OnAccessibilityPan = new ViewWrapperImpl.OnAccessibilityPanDelegate(OnAccessibilityPan);
54 viewWrapperImpl.OnAccessibilityTouch = new ViewWrapperImpl.OnAccessibilityTouchDelegate(OnAccessibilityTouch);
55 viewWrapperImpl.OnAccessibilityValueChange = new ViewWrapperImpl.OnAccessibilityValueChangeDelegate(OnAccessibilityValueChange);
56 viewWrapperImpl.OnAccessibilityZoom = new ViewWrapperImpl.OnAccessibilityZoomDelegate(OnAccessibilityZoom);
57 viewWrapperImpl.OnFocusGained = new ViewWrapperImpl.OnFocusGainedDelegate(OnFocusGained);
58 viewWrapperImpl.OnFocusLost = new ViewWrapperImpl.OnFocusLostDelegate(OnFocusLost);
59 viewWrapperImpl.GetNextFocusableView = new ViewWrapperImpl.GetNextFocusableViewDelegate(GetNextFocusableView);
60 viewWrapperImpl.OnFocusChangeCommitted = new ViewWrapperImpl.OnFocusChangeCommittedDelegate(OnFocusChangeCommitted);
61 viewWrapperImpl.OnKeyboardEnter = new ViewWrapperImpl.OnKeyboardEnterDelegate(OnKeyboardEnter);
62 viewWrapperImpl.OnPinch = new ViewWrapperImpl.OnPinchDelegate(OnPinch);
63 viewWrapperImpl.OnPan = new ViewWrapperImpl.OnPanDelegate(OnPan);
64 viewWrapperImpl.OnTap = new ViewWrapperImpl.OnTapDelegate(OnTap);
65 viewWrapperImpl.OnLongPress = new ViewWrapperImpl.OnLongPressDelegate(OnLongPress);
67 // Make sure CustomView is initialized.
70 // Set the StyleName the name of the View
71 // We have to do this because the StyleManager on Native side can't workout it out
72 // This will also ensure that the style of views/visuals initialized above are applied by the style manager.
73 SetStyleName(this.GetType().Name);
77 /// Sets the background with a property map.
79 /// <param name="map">The background property map.</param>
80 /// <since_tizen> 3 </since_tizen>
81 public void SetBackground(Tizen.NUI.PropertyMap map)
83 viewWrapperImpl.SetBackground(map);
87 /// Allows deriving classes to enable any of the gesture detectors that are available.<br>
88 /// Gesture detection can be enabled one at a time or in a bitwise format.<br>
90 /// <param name="type">The gesture type(s) to enable.</param>
91 /// <since_tizen> 3 </since_tizen>
92 public void EnableGestureDetection(Gesture.GestureType type)
94 viewWrapperImpl.EnableGestureDetection(type);
98 /// Allows deriving classes to disable any of the gesture detectors.<br>
99 /// Like EnableGestureDetection, this can also be called using bitwise or one at a time.<br>
101 /// <param name="type">The gesture type(s) to disable.</param>
102 internal void DisableGestureDetection(Gesture.GestureType type)
104 viewWrapperImpl.DisableGestureDetection(type);
108 /// Sets whether this control supports two dimensional keyboard navigation
109 /// (i.e., whether it knows how to handle the keyboard focus movement between its child views).<br>
110 /// The control doesn't support it by default.<br>
112 /// <param name="isSupported">Whether this control supports two dimensional keyboard navigation.</param>
113 /// <since_tizen> 3 </since_tizen>
114 public bool FocusNavigationSupport
118 return IsKeyboardNavigationSupported();
122 SetKeyboardNavigationSupport(value);
126 internal void SetKeyboardNavigationSupport(bool isSupported)
128 viewWrapperImpl.SetKeyboardNavigationSupport(isSupported);
132 /// Gets whether this control supports two-dimensional keyboard navigation.
134 /// <returns>True if this control supports two-dimensional keyboard navigation.</returns>
135 internal bool IsKeyboardNavigationSupported()
137 return viewWrapperImpl.IsKeyboardNavigationSupported();
142 /// Sets or gets whether this control is a focus group for keyboard navigation.
144 /// <returns>True if this control is set as a focus group for keyboard navigation.</returns>
145 /// <since_tizen> 3 </since_tizen>
146 public bool FocusGroup
150 return IsKeyboardFocusGroup();
154 SetAsKeyboardFocusGroup(value);
159 /// Sets whether this control is a focus group for keyboard navigation.
160 /// (i.e., the scope of keyboard focus movement can be limitied to its child views). The control is not a focus group by default.
162 /// <param name="isFocusGroup">Whether this control is set as a focus group for keyboard navigation.</param>
163 internal void SetAsKeyboardFocusGroup(bool isFocusGroup)
165 viewWrapperImpl.SetAsFocusGroup(isFocusGroup);
169 /// Gets whether this control is a focus group for keyboard navigation.
171 internal bool IsKeyboardFocusGroup()
173 return viewWrapperImpl.IsFocusGroup();
177 /// Called by the AccessibilityManager to activate the control.
179 internal void AccessibilityActivate()
181 viewWrapperImpl.AccessibilityActivate();
185 /// Called by the KeyboardFocusManager.
187 internal void KeyboardEnter()
189 viewWrapperImpl.KeyboardEnter();
193 /// Called by the KeyInputFocusManager to emit key event signals.
195 /// <param name="key">The key event.</param>
196 /// <returns>True if the event was consumed.</returns>
197 internal bool EmitKeyEventSignal(Key key)
199 return viewWrapperImpl.EmitKeyEventSignal(key);
203 /// Requests a relayout, which means performing a size negotiation on this view, its parent, and children (and potentially whole scene).<br>
204 /// This method can also be called from a derived class every time it needs a different size.<br>
205 /// At the end of event processing, the relayout process starts and all controls which requested relayout will have their sizes (re)negotiated.<br>
206 /// 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.<br>
208 protected void RelayoutRequest()
210 viewWrapperImpl.RelayoutRequest();
214 /// Provides the view implementation of GetHeightForWidth.
216 /// <param name="width">The width to use.</param>
217 /// <returns>The height based on the width.</returns>
218 protected float GetHeightForWidthBase(float width)
220 return viewWrapperImpl.GetHeightForWidthBase(width);
224 /// Provides the view implementation of GetWidthForHeight.
226 /// <param name="height">The height to use.</param>
227 /// <returns>The width based on the height.</returns>
228 protected float GetWidthForHeightBase(float height)
230 return viewWrapperImpl.GetWidthForHeightBase(height);
234 /// Calculates the size for a child using the base view object.
236 /// <param name="child">The child view to calculate the size for.</param>
237 /// <param name="dimension">The dimension to calculate the size, for example, the width or the height.</param>
238 /// <returns>Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.</returns>
239 protected float CalculateChildSizeBase(View child, DimensionType dimension)
241 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
245 /// Determines if this view is dependent on it's children for relayout from the base class.
247 /// <param name="dimension">The dimension(s) to check for.</param>
248 /// <returns>Return if the view is dependent on it's children.</returns>
249 protected bool RelayoutDependentOnChildrenBase(DimensionType dimension)
251 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
255 /// Determines if this view is dependent on it's children for relayout from the base class.
257 /// <returns>Return if the view is dependent on it's children.</returns>
258 protected bool RelayoutDependentOnChildrenBase()
260 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
264 /// Registers a visual by property index, linking a view to visual when required.<br>
265 /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.<br>
266 /// No parenting is done during registration, this should be done by a derived class.<br>
268 /// <param name="index">The property index of the visual used to reference visual.</param>
269 /// <param name="visual">The visual to register.</param>
270 protected void RegisterVisual(int index, VisualBase visual)
272 viewWrapperImpl.RegisterVisual(index, visual);
276 /// Registers a visual by the property index, linking a view to visual when required.<br>
277 /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.<br>
278 /// If enabled is false, then the visual is not set on the stage until enabled by the derived class.<br>
280 /// <param name="index">The property index of the visual used to reference visual.</param>
281 /// <param name="visual">The visual to register.</param>
282 /// <param name="enabled">False if derived class wants to control when the visual is set on the stage.</param>
283 protected void RegisterVisual(int index, VisualBase visual, bool enabled)
285 viewWrapperImpl.RegisterVisual(index, visual, enabled);
289 /// Erases the entry matching the given index from the list of registered visuals.
291 /// <param name="index">The property index of the visual used to reference visual.</param>
292 protected void UnregisterVisual(int index)
294 viewWrapperImpl.UnregisterVisual(index);
298 /// Retrieves the visual associated with the given property index.<br>
299 /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br>
301 /// <param name="index">The property index of the visual used to reference visual.</param>
302 /// <returns>The registered visual if exists, otherwise an empty handle.</returns>
303 protected VisualBase GetVisual(int index)
305 return viewWrapperImpl.GetVisual(index);
309 /// Sets the given visual to be displayed or not when parent staged.<br>
310 /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br>
312 /// <param name="index">The property index of the visual, used to reference visual.</param>
313 /// <param name="enable">Flag set to enabled or disabled.</param>
314 protected void EnableVisual(int index, bool enable)
316 viewWrapperImpl.EnableVisual(index, enable);
320 /// Queries if the given visual is to be displayed when parent staged.<br>
321 /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br>
323 /// <param name="index">The property index of the visual.</param>
324 /// <returns>Whether visual is enabled or not.</returns>
325 protected bool IsVisualEnabled(int index)
327 return viewWrapperImpl.IsVisualEnabled(index);
331 /// Creates a transition effect on the control.
333 /// <param name="transitionData">The transition data describing the effect to create.</param>
334 /// <returns>A handle to an animation defined with the given effect, or an empty handle if no properties match.</returns>
335 protected Animation CreateTransition(TransitionData transitionData)
337 return viewWrapperImpl.CreateTransition(transitionData);
341 /// Emits the KeyInputFocusGained signal if true, else, emits the KeyInputFocusLost signal.<br>
342 /// Should be called last by the control after it acts on the input focus change.<br>
344 /// <param name="focusGained">True if gained, false if lost.</param>
345 protected void EmitFocusSignal(bool focusGained)
347 viewWrapperImpl.EmitFocusSignal(focusGained);
351 /// This method is called after the control has been initialized.<br>
352 /// Derived classes should do any second phase initialization by overriding this method.<br>
354 /// <since_tizen> 3 </since_tizen>
355 public virtual void OnInitialize()
360 /// Called after the view has been connected to the stage.<br>
361 /// When a view is connected, it will be directly or indirectly parented to the root view.<br>
362 /// The root view is provided automatically by Tizen.NUI.Stage, and is always considered to be connected.<br>
363 /// When the parent of a set of views is connected to the stage, then all of the children will receive this callback.<br>
365 /// <param name="depth">The depth in the hierarchy for the view.</param>
366 /// <since_tizen> 3 </since_tizen>
367 public virtual void OnStageConnection(int depth)
372 /// Called after the view has been disconnected from the stage.<br>
373 /// If a view is disconnected, it either has no parent, or is parented to a disconnected view.<br>
374 /// 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.<br>
376 /// <since_tizen> 3 </since_tizen>
377 public virtual void OnStageDisconnection()
382 /// Called after a child has been added to the owning view.
384 /// <param name="view">The child which has been added.</param>
385 /// <since_tizen> 3 </since_tizen>
386 public virtual void OnChildAdd(View view)
391 /// Called after the owning view has attempted to remove a child( regardless of whether it succeeded or not ).
393 /// <param name="view">The child being removed.</param>
394 /// <since_tizen> 3 </since_tizen>
395 public virtual void OnChildRemove(View view)
400 /// Called when the owning view property is set.
402 /// <param name="index">The property index that was set.</param>
403 /// <param name="propertyValue">The value to set.</param>
404 /// <since_tizen> 3 </since_tizen>
405 public virtual void OnPropertySet(int index, Tizen.NUI.PropertyValue propertyValue)
410 /// Called when the owning view's size is set, for example, using View.SetSize().
412 /// <param name="targetSize">The target size.</param>
413 /// <since_tizen> 3 </since_tizen>
414 public virtual void OnSizeSet(Vector3 targetSize)
419 /// Called when the owning view's size is animated, for example, using Animation::AnimateTo( Property ( view, View::Property::SIZE ), ... ).
421 /// <param name="animation">The object which is animating the owning view.</param>
422 /// <param name="targetSize">The target size.</param>
423 /// <since_tizen> 3 </since_tizen>
424 public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
429 /// Called after a touch event is received by the owning view.<br>
430 /// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br>
432 /// <param name="touch">The touch event.</param>
433 /// <returns>True if the event should be consumed.</returns>
434 /// <since_tizen> 3 </since_tizen>
435 public virtual bool OnTouch(Touch touch)
437 return false; // Do not consume
441 /// Called after a hover event is received by the owning view.<br>
442 /// CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br>
444 /// <param name="hover">The hover event.</param>
445 /// <returns>True if the hover event should be consumed.</returns>
446 /// <since_tizen> 3 </since_tizen>
447 public virtual bool OnHover(Hover hover)
449 return false; // Do not consume
453 /// Called after a key event is received by the view that has had its focus set.
455 /// <param name="key">The key event.</param>
456 /// <returns>True if the key event should be consumed.</returns>
457 /// <since_tizen> 3 </since_tizen>
458 public virtual bool OnKey(Key key)
460 return false; // Do not consume
464 /// Called after a wheel event is received by the owning view.<br>
465 /// CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br>
467 /// <param name="wheel">The wheel event.</param>
468 /// <returns>True if the wheel event should be consumed.</returns>
469 /// <since_tizen> 3 </since_tizen>
470 public virtual bool OnWheel(Wheel wheel)
472 return false; // Do not consume
476 /// Called after the size negotiation has been finished for this control.<br>
477 /// The control is expected to assign this given size to itself or its children.<br>
478 /// 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.<br>
479 /// As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).<br>
481 /// <param name="size">The allocated size.</param>
482 /// <param name="container">The control should add views to this container that it is not able to allocate a size for.</param>
483 /// <since_tizen> 3 </since_tizen>
484 public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
489 /// Notification for deriving classes.
491 /// <param name="policy">The policy being set.</param>
492 /// <param name="dimension">The policy is being set for.</param>
493 /// <since_tizen> 3 </since_tizen>
494 public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
499 /// Returns the natural size of the view.
501 /// <returns>The view's natural size</returns>
502 /// <since_tizen> 3 </since_tizen>
503 public new virtual Size2D GetNaturalSize()
505 return new Size2D(0, 0);
509 /// Calculates the size for a child.
511 /// <param name="child">The child view to calculate the size for.</param>
512 /// <param name="dimension">The dimension to calculate the size, for example, the width or the height.</param>
513 /// <returns>Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.</returns>
514 /// <since_tizen> 3 </since_tizen>
515 public virtual float CalculateChildSize(View child, DimensionType dimension)
517 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
521 /// This method is called during size negotiation when a height is required for a given width.<br>
522 /// Derived classes should override this if they wish to customize the height returned.<br>
524 /// <param name="width">Width to use</param>
525 /// <returns>The height based on the width</returns>
526 /// <since_tizen> 3 </since_tizen>
527 public new virtual float GetHeightForWidth(float width)
529 return viewWrapperImpl.GetHeightForWidthBase(width);
533 /// This method is called during size negotiation when a width is required for a given height.<br>
534 /// Derived classes should override this if they wish to customize the width returned.<br>
536 /// <param name="height">Height to use</param>
537 /// <returns>The width based on the width</returns>
538 /// <since_tizen> 3 </since_tizen>
539 public new virtual float GetWidthForHeight(float height)
541 return viewWrapperImpl.GetWidthForHeightBase(height);
545 /// Determines if this view is dependent on it's children for relayout.
547 /// <param name="dimension">The dimension(s) to check for.</param>
548 /// <returns>Return if the view is dependent on it's children.</returns>
549 /// <since_tizen> 3 </since_tizen>
550 public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
552 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
556 /// Determines if this view is dependent on it's children for relayout from the base class.
558 /// <returns>Return true if the view is dependent on it's children.</returns>
559 /// <since_tizen> 3 </since_tizen>
560 public virtual bool RelayoutDependentOnChildren()
562 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
566 /// The virtual method to notify deriving classes that relayout dependencies have been
567 /// met and the size for this object is about to be calculated for the given dimension.
569 /// <param name="dimension">The dimension that is about to be calculated.</param>
570 /// <since_tizen> 3 </since_tizen>
571 public virtual void OnCalculateRelayoutSize(DimensionType dimension)
576 /// The virtual method to notify deriving classes that the size for a dimension has just been negotiated.
578 /// <param name="size">The new size for the given dimension.</param>
579 /// <param name="dimension">The dimension that was just negotiated.</param>
580 /// <since_tizen> 3 </since_tizen>
581 public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
586 /// This method should be overridden by deriving classes requiring notifications when the style changes.
588 /// <param name="styleManager">The StyleManager object.</param>
589 /// <param name="change">Information denoting what has changed.</param>
590 /// <since_tizen> 3 </since_tizen>
591 public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
596 /// This method is called when the control accessibility is activated.<br>
597 /// Derived classes should override this to perform custom accessibility activation.<br>
599 /// <returns>True if this control can perform accessibility activation.</returns>
600 internal virtual bool OnAccessibilityActivated()
606 /// This method should be overridden by deriving classes when they wish to respond the accessibility.
608 /// <param name="gestures">The pan gesture.</param>
609 /// <returns>True if the pan gesture has been consumed by this control.</returns>
610 internal virtual bool OnAccessibilityPan(PanGesture gestures)
616 /// This method should be overridden by deriving classes when they wish to respond the accessibility.
618 /// <param name="touch">The touch gesture.</param>
619 /// <returns>True if the touch event has been consumed by this control.</returns>
620 internal virtual bool OnAccessibilityTouch(Touch touch)
626 /// This method should be overridden by deriving classes when they wish to respond the accessibility up and down action (i.e., value change of slider control).
628 /// <param name="isIncrease">Whether the value should be increased or decreased.</param>
629 /// <returns>True if the value changed action has been consumed by this control.</returns>
630 internal virtual bool OnAccessibilityValueChange(bool isIncrease)
636 /// This method should be overridden by deriving classes when they wish to respond the accessibility zoom action.
638 /// <returns>True if the zoom action has been consumed by this control.</returns>
639 internal virtual bool OnAccessibilityZoom()
645 /// 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.
647 /// <since_tizen> 3 </since_tizen>
648 public virtual void OnFocusGained()
653 /// 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.
655 /// <since_tizen> 3 </since_tizen>
656 public virtual void OnFocusLost()
661 /// Gets the next keyboard focusable view in this control towards the given direction.<br>
662 /// A control needs to override this function in order to support two dimensional keyboard navigation.<br>
664 /// <param name="currentFocusedView">The current focused view.</param>
665 /// <param name="direction">The direction to move the focus towards.</param>
666 /// <param name="loopEnabled">Whether the focus movement should be looped within the control.</param>
667 /// <returns>The next keyboard focusable view in this control or an empty handle if no view can be focused.</returns>
668 /// <since_tizen> 3 </since_tizen>
669 public virtual View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled)
675 /// Informs this control that its chosen focusable view will be focused.<br>
676 /// This allows the application to preform any actions it wishes before the focus is actually moved to the chosen view.<br>
678 /// <param name="commitedFocusableView">The commited focused view.</param>
679 /// <since_tizen> 3 </since_tizen>
680 public virtual void OnFocusChangeCommitted(View commitedFocusableView)
685 /// This method is called when the control has enter pressed on it.<br>
686 /// Derived classes should override this to perform custom actions.<br>
688 /// <returns>True if this control supported this action.</returns>
689 /// <since_tizen> 3 </since_tizen>
690 public virtual bool OnKeyboardEnter()
696 /// Called whenever a pinch gesture is detected on this control.<br>
697 /// This can be overridden by deriving classes when pinch detection is enabled. The default behavior is to scale the control by the pinch scale.<br>
698 /// If overridden, then the default behavior will not occur.<br>
699 /// Pinch detection should be enabled via EnableGestureDetection().<br>
701 /// <param name="pinch">The pinch tap gesture.</param>
702 internal virtual void OnPinch(PinchGesture pinch)
707 /// Called whenever a pan gesture is detected on this control.<br>
708 /// This should be overridden by deriving classes when pan detection is enabled.<br>
709 /// There is no default behavior with panning.<br>
710 /// Pan detection should be enabled via EnableGestureDetection().<br>
712 /// <param name="pan">The pan gesture.</param>
713 /// <since_tizen> 3 </since_tizen>
714 public virtual void OnPan(PanGesture pan)
719 /// Called whenever a tap gesture is detected on this control.<br>
720 /// This should be overridden by deriving classes when tap detection is enabled.<br>
721 /// There is no default behavior with a tap.<br>
722 /// Tap detection should be enabled via EnableGestureDetection().<br>
724 /// <param name="tap">The tap gesture.</param>
725 /// <since_tizen> 3 </since_tizen>
726 public virtual void OnTap(TapGesture tap)
731 /// Called whenever a long press gesture is detected on this control.<br>
732 /// This should be overridden by deriving classes when long press detection is enabled.<br>
733 /// There is no default behavior associated with a long press.<br>
734 /// Long press detection should be enabled via EnableGestureDetection().<br>
736 /// <param name="longPress">The long press gesture.</param>
737 internal virtual void OnLongPress(LongPressGesture longPress)
741 private void OnControlChildAdd(View child)
745 private void OnControlChildRemove(View child)