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
26 /// Create an instance of customView.
28 /// <param name="typeName">typename</param>
29 /// <param name="behaviour">CustomView Behaviour</param>
30 /// <since_tizen> 3 </since_tizen>
31 public CustomView(string typeName, CustomViewBehaviour behaviour) : base(typeName, new ViewWrapperImpl(behaviour))
33 // Registering CustomView virtual functions to viewWrapperImpl delegates.
34 viewWrapperImpl.OnStageConnection = new ViewWrapperImpl.OnStageConnectionDelegate(OnStageConnection);
35 viewWrapperImpl.OnStageDisconnection = new ViewWrapperImpl.OnStageDisconnectionDelegate(OnStageDisconnection);
36 viewWrapperImpl.OnChildAdd = new ViewWrapperImpl.OnChildAddDelegate(OnChildAdd);
37 viewWrapperImpl.OnChildRemove = new ViewWrapperImpl.OnChildRemoveDelegate(OnChildRemove);
38 viewWrapperImpl.OnPropertySet = new ViewWrapperImpl.OnPropertySetDelegate(OnPropertySet);
39 viewWrapperImpl.OnSizeSet = new ViewWrapperImpl.OnSizeSetDelegate(OnSizeSet);
40 viewWrapperImpl.OnSizeAnimation = new ViewWrapperImpl.OnSizeAnimationDelegate(OnSizeAnimation);
41 viewWrapperImpl.OnTouch = new ViewWrapperImpl.OnTouchDelegate(OnTouch);
42 viewWrapperImpl.OnHover = new ViewWrapperImpl.OnHoverDelegate(OnHover);
43 viewWrapperImpl.OnKey = new ViewWrapperImpl.OnKeyDelegate(OnKey);
44 viewWrapperImpl.OnWheel = new ViewWrapperImpl.OnWheelDelegate(OnWheel);
45 viewWrapperImpl.OnRelayout = new ViewWrapperImpl.OnRelayoutDelegate(OnRelayout);
46 viewWrapperImpl.OnSetResizePolicy = new ViewWrapperImpl.OnSetResizePolicyDelegate(OnSetResizePolicy);
47 viewWrapperImpl.GetNaturalSize = new ViewWrapperImpl.GetNaturalSizeDelegate(GetNaturalSize);
48 viewWrapperImpl.CalculateChildSize = new ViewWrapperImpl.CalculateChildSizeDelegate(CalculateChildSize);
49 viewWrapperImpl.GetHeightForWidth = new ViewWrapperImpl.GetHeightForWidthDelegate(GetHeightForWidth);
50 viewWrapperImpl.GetWidthForHeight = new ViewWrapperImpl.GetWidthForHeightDelegate(GetWidthForHeight);
51 viewWrapperImpl.RelayoutDependentOnChildrenDimension = new ViewWrapperImpl.RelayoutDependentOnChildrenDimensionDelegate(RelayoutDependentOnChildren);
52 viewWrapperImpl.RelayoutDependentOnChildren = new ViewWrapperImpl.RelayoutDependentOnChildrenDelegate(RelayoutDependentOnChildren);
53 viewWrapperImpl.OnCalculateRelayoutSize = new ViewWrapperImpl.OnCalculateRelayoutSizeDelegate(OnCalculateRelayoutSize);
54 viewWrapperImpl.OnLayoutNegotiated = new ViewWrapperImpl.OnLayoutNegotiatedDelegate(OnLayoutNegotiated);
55 viewWrapperImpl.OnControlChildAdd = new ViewWrapperImpl.OnControlChildAddDelegate(OnControlChildAdd);
56 viewWrapperImpl.OnControlChildRemove = new ViewWrapperImpl.OnControlChildRemoveDelegate(OnControlChildRemove);
57 viewWrapperImpl.OnStyleChange = new ViewWrapperImpl.OnStyleChangeDelegate(OnStyleChange);
58 viewWrapperImpl.OnAccessibilityActivated = new ViewWrapperImpl.OnAccessibilityActivatedDelegate(OnAccessibilityActivated);
59 viewWrapperImpl.OnAccessibilityPan = new ViewWrapperImpl.OnAccessibilityPanDelegate(OnAccessibilityPan);
60 viewWrapperImpl.OnAccessibilityTouch = new ViewWrapperImpl.OnAccessibilityTouchDelegate(OnAccessibilityTouch);
61 viewWrapperImpl.OnAccessibilityValueChange = new ViewWrapperImpl.OnAccessibilityValueChangeDelegate(OnAccessibilityValueChange);
62 viewWrapperImpl.OnAccessibilityZoom = new ViewWrapperImpl.OnAccessibilityZoomDelegate(OnAccessibilityZoom);
63 viewWrapperImpl.OnFocusGained = new ViewWrapperImpl.OnFocusGainedDelegate(OnFocusGained);
64 viewWrapperImpl.OnFocusLost = new ViewWrapperImpl.OnFocusLostDelegate(OnFocusLost);
65 viewWrapperImpl.GetNextFocusableView = new ViewWrapperImpl.GetNextFocusableViewDelegate(GetNextFocusableView);
66 viewWrapperImpl.OnFocusChangeCommitted = new ViewWrapperImpl.OnFocusChangeCommittedDelegate(OnFocusChangeCommitted);
67 viewWrapperImpl.OnKeyboardEnter = new ViewWrapperImpl.OnKeyboardEnterDelegate(OnKeyboardEnter);
68 viewWrapperImpl.OnPinch = new ViewWrapperImpl.OnPinchDelegate(OnPinch);
69 viewWrapperImpl.OnPan = new ViewWrapperImpl.OnPanDelegate(OnPan);
70 viewWrapperImpl.OnTap = new ViewWrapperImpl.OnTapDelegate(OnTap);
71 viewWrapperImpl.OnLongPress = new ViewWrapperImpl.OnLongPressDelegate(OnLongPress);
73 // Make sure CustomView is initialized.
76 // Set the StyleName the name of the View
77 // We have to do this because the StyleManager on Native side can't workout it out
78 // This will also ensure that the style of views/visuals initialized above are applied by the style manager.
79 SetStyleName(this.GetType().Name);
83 /// Sets the background with a property map.
85 /// <param name="map">The background property map.</param>
86 /// <since_tizen> 3 </since_tizen>
87 public void SetBackground(Tizen.NUI.PropertyMap map)
89 viewWrapperImpl.SetBackground(map);
93 /// Allows deriving classes to enable any of the gesture detectors that are available.<br />
94 /// Gesture detection can be enabled one at a time or in a bitwise format.<br />
96 /// <param name="type">The gesture type(s) to enable.</param>
97 /// <since_tizen> 3 </since_tizen>
98 public void EnableGestureDetection(Gesture.GestureType type)
100 viewWrapperImpl.EnableGestureDetection(type);
104 /// Allows deriving classes to disable any of the gesture detectors.<br />
105 /// Like EnableGestureDetection, this can also be called using bitwise or one at a time.<br />
107 /// <param name="type">The gesture type(s) to disable.</param>
108 internal void DisableGestureDetection(Gesture.GestureType type)
110 viewWrapperImpl.DisableGestureDetection(type);
114 /// Sets whether this control supports two dimensional keyboard navigation
115 /// (i.e., whether it knows how to handle the keyboard focus movement between its child views).<br />
116 /// The control doesn't support it by default.<br />
118 /// <since_tizen> 3 </since_tizen>
119 public bool FocusNavigationSupport
123 return IsKeyboardNavigationSupported();
127 SetKeyboardNavigationSupport(value);
131 internal void SetKeyboardNavigationSupport(bool isSupported)
133 viewWrapperImpl.SetKeyboardNavigationSupport(isSupported);
137 /// Gets whether this control supports two-dimensional keyboard navigation.
139 /// <returns>True if this control supports two-dimensional keyboard navigation.</returns>
140 internal bool IsKeyboardNavigationSupported()
142 return viewWrapperImpl.IsKeyboardNavigationSupported();
147 /// Sets or gets whether this control is a focus group for keyboard navigation.
149 /// <returns>True if this control is set as a focus group for keyboard navigation.</returns>
150 /// <since_tizen> 3 </since_tizen>
151 public bool FocusGroup
155 return IsKeyboardFocusGroup();
159 SetAsKeyboardFocusGroup(value);
164 /// Sets whether this control is a focus group for keyboard navigation.
165 /// (i.e., the scope of keyboard focus movement can be limitied to its child views). The control is not a focus group by default.
167 /// <param name="isFocusGroup">Whether this control is set as a focus group for keyboard navigation.</param>
168 internal void SetAsKeyboardFocusGroup(bool isFocusGroup)
170 viewWrapperImpl.SetAsFocusGroup(isFocusGroup);
174 /// Gets whether this control is a focus group for keyboard navigation.
176 internal bool IsKeyboardFocusGroup()
178 return viewWrapperImpl.IsFocusGroup();
182 /// Called by the AccessibilityManager to activate the control.
184 internal void AccessibilityActivate()
186 viewWrapperImpl.AccessibilityActivate();
190 /// Called by the KeyboardFocusManager.
192 internal void KeyboardEnter()
194 viewWrapperImpl.KeyboardEnter();
198 /// Called by the KeyInputFocusManager to emit key event signals.
200 /// <param name="key">The key event.</param>
201 /// <returns>True if the event was consumed.</returns>
202 internal bool EmitKeyEventSignal(Key key)
204 return viewWrapperImpl.EmitKeyEventSignal(key);
208 /// Requests a relayout, which means performing a size negotiation on this view, its parent, and children (and potentially whole scene).<br />
209 /// This method can also be called from a derived class every time it needs a different size.<br />
210 /// At the end of event processing, the relayout process starts and all controls which requested relayout will have their sizes (re)negotiated.<br />
211 /// 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 />
213 protected void RelayoutRequest()
215 viewWrapperImpl.RelayoutRequest();
219 /// Provides the view implementation of GetHeightForWidth.
221 /// <param name="width">The width to use.</param>
222 /// <returns>The height based on the width.</returns>
223 protected float GetHeightForWidthBase(float width)
225 return viewWrapperImpl.GetHeightForWidthBase(width);
229 /// Provides the view implementation of GetWidthForHeight.
231 /// <param name="height">The height to use.</param>
232 /// <returns>The width based on the height.</returns>
233 protected float GetWidthForHeightBase(float height)
235 return viewWrapperImpl.GetWidthForHeightBase(height);
239 /// Calculates the size for a child using the base view object.
241 /// <param name="child">The child view to calculate the size for.</param>
242 /// <param name="dimension">The dimension to calculate the size, for example, the width or the height.</param>
243 /// <returns>Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.</returns>
244 protected float CalculateChildSizeBase(View child, DimensionType dimension)
246 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
250 /// Determines if this view is dependent on it's children for relayout from the base class.
252 /// <param name="dimension">The dimension(s) to check for.</param>
253 /// <returns>Return if the view is dependent on it's children.</returns>
254 protected bool RelayoutDependentOnChildrenBase(DimensionType dimension)
256 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
260 /// Determines if this view is dependent on it's children for relayout from the base class.
262 /// <returns>Return if the view is dependent on it's children.</returns>
263 protected bool RelayoutDependentOnChildrenBase()
265 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
269 /// Registers a visual by property index, linking a view to visual when required.<br />
270 /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.<br />
271 /// No parenting is done during registration, this should be done by a derived class.<br />
273 /// <param name="index">The property index of the visual used to reference visual.</param>
274 /// <param name="visual">The visual to register.</param>
275 protected void RegisterVisual(int index, VisualBase visual)
277 viewWrapperImpl.RegisterVisual(index, visual);
281 /// Registers a visual by the property index, linking a view to visual when required.<br />
282 /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.<br />
283 /// If enabled is false, then the visual is not set on the stage until enabled by the derived class.<br />
285 /// <param name="index">The property index of the visual used to reference visual.</param>
286 /// <param name="visual">The visual to register.</param>
287 /// <param name="enabled">False if derived class wants to control when the visual is set on the stage.</param>
288 protected void RegisterVisual(int index, VisualBase visual, bool enabled)
290 viewWrapperImpl.RegisterVisual(index, visual, enabled);
294 /// Erases the entry matching the given index from the list of registered visuals.
296 /// <param name="index">The property index of the visual used to reference visual.</param>
297 protected void UnregisterVisual(int index)
299 viewWrapperImpl.UnregisterVisual(index);
303 /// Retrieves the visual associated with the given property index.<br />
304 /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br />
306 /// <param name="index">The property index of the visual used to reference visual.</param>
307 /// <returns>The registered visual if exists, otherwise an empty handle.</returns>
308 protected VisualBase GetVisual(int index)
310 return viewWrapperImpl.GetVisual(index);
314 /// Sets the given visual to be displayed or not when parent staged.<br />
315 /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br />
317 /// <param name="index">The property index of the visual, used to reference visual.</param>
318 /// <param name="enable">Flag set to enabled or disabled.</param>
319 protected void EnableVisual(int index, bool enable)
321 viewWrapperImpl.EnableVisual(index, enable);
325 /// Queries if the given visual is to be displayed when parent staged.<br />
326 /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.<br />
328 /// <param name="index">The property index of the visual.</param>
329 /// <returns>Whether visual is enabled or not.</returns>
330 protected bool IsVisualEnabled(int index)
332 return viewWrapperImpl.IsVisualEnabled(index);
336 /// Creates a transition effect on the control.
338 /// <param name="transitionData">The transition data describing the effect to create.</param>
339 /// <returns>A handle to an animation defined with the given effect, or an empty handle if no properties match.</returns>
340 protected Animation CreateTransition(TransitionData transitionData)
342 return viewWrapperImpl.CreateTransition(transitionData);
346 /// Emits the KeyInputFocusGained signal if true, else, emits the KeyInputFocusLost signal.<br />
347 /// Should be called last by the control after it acts on the input focus change.<br />
349 /// <param name="focusGained">True if gained, false if lost.</param>
350 protected void EmitFocusSignal(bool focusGained)
352 viewWrapperImpl.EmitFocusSignal(focusGained);
356 /// This method is called after the control has been initialized.<br />
357 /// Derived classes should do any second phase initialization by overriding this method.<br />
359 /// <since_tizen> 3 </since_tizen>
360 public virtual void OnInitialize()
365 /// Called after the view has been connected to the stage.<br />
366 /// When a view is connected, it will be directly or indirectly parented to the root view.<br />
367 /// The root view is provided automatically by Tizen.NUI.Stage, and is always considered to be connected.<br />
368 /// When the parent of a set of views is connected to the stage, then all of the children will receive this callback.<br />
370 /// <param name="depth">The depth in the hierarchy for the view.</param>
371 /// <since_tizen> 3 </since_tizen>
372 public virtual void OnStageConnection(int depth)
377 /// Called after the view has been disconnected from the stage.<br />
378 /// If a view is disconnected, it either has no parent, or is parented to a disconnected view.<br />
379 /// 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 />
381 /// <since_tizen> 3 </since_tizen>
382 public virtual void OnStageDisconnection()
387 /// Called after a child has been added to the owning view.
389 /// <param name="view">The child which has been added.</param>
390 /// <since_tizen> 3 </since_tizen>
391 public virtual void OnChildAdd(View view)
396 /// Called after the owning view has attempted to remove a child( regardless of whether it succeeded or not ).
398 /// <param name="view">The child being removed.</param>
399 /// <since_tizen> 3 </since_tizen>
400 public virtual void OnChildRemove(View view)
405 /// Called when the owning view property is set.
407 /// <param name="index">The property index that was set.</param>
408 /// <param name="propertyValue">The value to set.</param>
409 /// <since_tizen> 3 </since_tizen>
410 public virtual void OnPropertySet(int index, Tizen.NUI.PropertyValue propertyValue)
415 /// Called when the owning view's size is set, for example, using View.SetSize().
417 /// <param name="targetSize">The target size.</param>
418 /// <since_tizen> 3 </since_tizen>
419 public virtual void OnSizeSet(Vector3 targetSize)
424 /// Called when the owning view's size is animated, for example, using Animation::AnimateTo( Property ( view, View::Property::SIZE ), ... ).
426 /// <param name="animation">The object which is animating the owning view.</param>
427 /// <param name="targetSize">The target size.</param>
428 /// <since_tizen> 3 </since_tizen>
429 public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
434 /// Called after a touch event is received by the owning view.<br />
435 /// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br />
437 /// <param name="touch">The touch event.</param>
438 /// <returns>True if the event should be consumed.</returns>
439 /// <since_tizen> 3 </since_tizen>
440 public virtual bool OnTouch(Touch touch)
442 return false; // Do not consume
446 /// Called after a hover event is received by the owning view.<br />
447 /// CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br />
449 /// <param name="hover">The hover event.</param>
450 /// <returns>True if the hover event should be consumed.</returns>
451 /// <since_tizen> 3 </since_tizen>
452 public virtual bool OnHover(Hover hover)
454 return false; // Do not consume
458 /// Called after a key event is received by the view that has had its focus set.
460 /// <param name="key">The key event.</param>
461 /// <returns>True if the key event should be consumed.</returns>
462 /// <since_tizen> 3 </since_tizen>
463 public virtual bool OnKey(Key key)
465 return false; // Do not consume
469 /// Called after a wheel event is received by the owning view.<br />
470 /// CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br />
472 /// <param name="wheel">The wheel event.</param>
473 /// <returns>True if the wheel event should be consumed.</returns>
474 /// <since_tizen> 3 </since_tizen>
475 public virtual bool OnWheel(Wheel wheel)
477 return false; // Do not consume
481 /// Called after the size negotiation has been finished for this control.<br />
482 /// The control is expected to assign this given size to itself or its children.<br />
483 /// 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 />
484 /// As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).<br />
486 /// <param name="size">The allocated size.</param>
487 /// <param name="container">The control should add views to this container that it is not able to allocate a size for.</param>
488 /// <since_tizen> 3 </since_tizen>
489 public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
494 /// Notification for deriving classes.
496 /// <param name="policy">The policy being set.</param>
497 /// <param name="dimension">The policy is being set for.</param>
498 /// <since_tizen> 3 </since_tizen>
499 public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
504 /// Returns the natural size of the view.
506 /// <returns>The view's natural size</returns>
507 /// <since_tizen> 3 </since_tizen>
508 public new virtual Size2D GetNaturalSize()
510 return new Size2D(0, 0);
514 /// Calculates the size for a child.
516 /// <param name="child">The child view to calculate the size for.</param>
517 /// <param name="dimension">The dimension to calculate the size, for example, the width or the height.</param>
518 /// <returns>Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.</returns>
519 /// <since_tizen> 3 </since_tizen>
520 public virtual float CalculateChildSize(View child, DimensionType dimension)
522 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
526 /// This method is called during size negotiation when a height is required for a given width.<br />
527 /// Derived classes should override this if they wish to customize the height returned.<br />
529 /// <param name="width">Width to use</param>
530 /// <returns>The height based on the width</returns>
531 /// <since_tizen> 3 </since_tizen>
532 public new virtual float GetHeightForWidth(float width)
534 return viewWrapperImpl.GetHeightForWidthBase(width);
538 /// This method is called during size negotiation when a width is required for a given height.<br />
539 /// Derived classes should override this if they wish to customize the width returned.<br />
541 /// <param name="height">Height to use</param>
542 /// <returns>The width based on the width</returns>
543 /// <since_tizen> 3 </since_tizen>
544 public new virtual float GetWidthForHeight(float height)
546 return viewWrapperImpl.GetWidthForHeightBase(height);
550 /// Determines if this view is dependent on it's children for relayout.
552 /// <param name="dimension">The dimension(s) to check for.</param>
553 /// <returns>Return if the view is dependent on it's children.</returns>
554 /// <since_tizen> 3 </since_tizen>
555 public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
557 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
561 /// Determines if this view is dependent on it's children for relayout from the base class.
563 /// <returns>Return true if the view is dependent on it's children.</returns>
564 /// <since_tizen> 3 </since_tizen>
565 public virtual bool RelayoutDependentOnChildren()
567 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
571 /// The virtual method to notify deriving classes that relayout dependencies have been
572 /// met and the size for this object is about to be calculated for the given dimension.
574 /// <param name="dimension">The dimension that is about to be calculated.</param>
575 /// <since_tizen> 3 </since_tizen>
576 public virtual void OnCalculateRelayoutSize(DimensionType dimension)
581 /// The virtual method to notify deriving classes that the size for a dimension has just been negotiated.
583 /// <param name="size">The new size for the given dimension.</param>
584 /// <param name="dimension">The dimension that was just negotiated.</param>
585 /// <since_tizen> 3 </since_tizen>
586 public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
591 /// This method should be overridden by deriving classes requiring notifications when the style changes.
593 /// <param name="styleManager">The StyleManager object.</param>
594 /// <param name="change">Information denoting what has changed.</param>
595 /// <since_tizen> 3 </since_tizen>
596 public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
601 /// This method is called when the control accessibility is activated.<br />
602 /// Derived classes should override this to perform custom accessibility activation.<br />
604 /// <returns>True if this control can perform accessibility activation.</returns>
605 internal virtual bool OnAccessibilityActivated()
611 /// This method should be overridden by deriving classes when they wish to respond the accessibility.
613 /// <param name="gestures">The pan gesture.</param>
614 /// <returns>True if the pan gesture has been consumed by this control.</returns>
615 internal virtual bool OnAccessibilityPan(PanGesture gestures)
621 /// This method should be overridden by deriving classes when they wish to respond the accessibility.
623 /// <param name="touch">The touch gesture.</param>
624 /// <returns>True if the touch event has been consumed by this control.</returns>
625 internal virtual bool OnAccessibilityTouch(Touch touch)
631 /// 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).
633 /// <param name="isIncrease">Whether the value should be increased or decreased.</param>
634 /// <returns>True if the value changed action has been consumed by this control.</returns>
635 internal virtual bool OnAccessibilityValueChange(bool isIncrease)
641 /// This method should be overridden by deriving classes when they wish to respond the accessibility zoom action.
643 /// <returns>True if the zoom action has been consumed by this control.</returns>
644 internal virtual bool OnAccessibilityZoom()
650 /// 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.
652 /// <since_tizen> 3 </since_tizen>
653 public virtual void OnFocusGained()
658 /// 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.
660 /// <since_tizen> 3 </since_tizen>
661 public virtual void OnFocusLost()
666 /// Gets the next keyboard focusable view in this control towards the given direction.<br />
667 /// A control needs to override this function in order to support two dimensional keyboard navigation.<br />
669 /// <param name="currentFocusedView">The current focused view.</param>
670 /// <param name="direction">The direction to move the focus towards.</param>
671 /// <param name="loopEnabled">Whether the focus movement should be looped within the control.</param>
672 /// <returns>The next keyboard focusable view in this control or an empty handle if no view can be focused.</returns>
673 /// <since_tizen> 3 </since_tizen>
674 public virtual View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled)
680 /// Informs this control that its chosen focusable view will be focused.<br />
681 /// This allows the application to preform any actions it wishes before the focus is actually moved to the chosen view.<br />
683 /// <param name="commitedFocusableView">The commited focused view.</param>
684 /// <since_tizen> 3 </since_tizen>
685 public virtual void OnFocusChangeCommitted(View commitedFocusableView)
690 /// This method is called when the control has enter pressed on it.<br />
691 /// Derived classes should override this to perform custom actions.<br />
693 /// <returns>True if this control supported this action.</returns>
694 /// <since_tizen> 3 </since_tizen>
695 public virtual bool OnKeyboardEnter()
701 /// Called whenever a pinch gesture is detected on this control.<br />
702 /// 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 />
703 /// If overridden, then the default behavior will not occur.<br />
704 /// Pinch detection should be enabled via EnableGestureDetection().<br />
706 /// <param name="pinch">The pinch tap gesture.</param>
707 internal virtual void OnPinch(PinchGesture pinch)
712 /// Called whenever a pan gesture is detected on this control.<br />
713 /// This should be overridden by deriving classes when pan detection is enabled.<br />
714 /// There is no default behavior with panning.<br />
715 /// Pan detection should be enabled via EnableGestureDetection().<br />
717 /// <param name="pan">The pan gesture.</param>
718 /// <since_tizen> 3 </since_tizen>
719 public virtual void OnPan(PanGesture pan)
724 /// Called whenever a tap gesture is detected on this control.<br />
725 /// This should be overridden by deriving classes when tap detection is enabled.<br />
726 /// There is no default behavior with a tap.<br />
727 /// Tap detection should be enabled via EnableGestureDetection().<br />
729 /// <param name="tap">The tap gesture.</param>
730 /// <since_tizen> 3 </since_tizen>
731 public virtual void OnTap(TapGesture tap)
736 /// Called whenever a long press gesture is detected on this control.<br />
737 /// This should be overridden by deriving classes when long press detection is enabled.<br />
738 /// There is no default behavior associated with a long press.<br />
739 /// Long press detection should be enabled via EnableGestureDetection().<br />
741 /// <param name="longPress">The long press gesture.</param>
742 internal virtual void OnLongPress(LongPressGesture longPress)
746 private void OnControlChildAdd(View child)
750 private void OnControlChildRemove(View child)