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 /// Set the background with a property map.
79 /// <param name="map">The background property map</param>
80 public void SetBackground(Tizen.NUI.PropertyMap map)
82 viewWrapperImpl.SetBackground(map);
86 /// Allows deriving classes to enable any of the gesture detectors that are available.<br>
87 /// Gesture detection can be enabled one at a time or in bitwise format.<br>
89 /// <param name="type">The gesture type(s) to enable</param>
90 public void EnableGestureDetection(Gesture.GestureType type)
92 viewWrapperImpl.EnableGestureDetection(type);
96 /// Allows deriving classes to disable any of the gesture detectors.<br>
97 /// Like EnableGestureDetection, this can also be called using bitwise or one at a time.<br>
99 /// <param name="type">The gesture type(s) to disable</param>
100 internal void DisableGestureDetection(Gesture.GestureType type)
102 viewWrapperImpl.DisableGestureDetection(type);
106 /// Sets whether this control supports two dimensional keyboard navigation
107 /// (i.e. whether it knows how to handle the keyboard focus movement between its child views).<br>
108 /// The control doesn't support it by default.<br>
110 /// <param name="isSupported">Whether this control supports two dimensional keyboard navigation.</param>
111 public bool FocusNavigationSupport
115 return IsKeyboardNavigationSupported();
119 SetKeyboardNavigationSupport(value);
123 internal void SetKeyboardNavigationSupport(bool isSupported)
125 viewWrapperImpl.SetKeyboardNavigationSupport(isSupported);
129 /// Gets whether this control supports two dimensional keyboard navigation.
131 /// <returns>true if this control supports two dimensional keyboard navigation</returns>
132 internal bool IsKeyboardNavigationSupported()
134 return viewWrapperImpl.IsKeyboardNavigationSupported();
139 /// Sets or Gets whether this control is a focus group for keyboard navigation.
141 /// <returns>true if this control is set as a focus group for keyboard navigation</returns>
142 public bool FocusGroup
146 return IsKeyboardFocusGroup();
150 SetAsKeyboardFocusGroup(value);
155 /// Sets whether this control is a focus group for keyboard navigation.
156 /// (i.e. the scope of keyboard focus movement can be limitied to its child views). The control is not a focus group by default.
158 /// <param name="isFocusGroup">Whether this control is set as a focus group for keyboard navigation</param>
159 internal void SetAsKeyboardFocusGroup(bool isFocusGroup)
161 viewWrapperImpl.SetAsFocusGroup(isFocusGroup);
165 /// Gets whether this control is a focus group for keyboard navigation.
167 internal bool IsKeyboardFocusGroup()
169 return viewWrapperImpl.IsFocusGroup();
173 /// Called by the AccessibilityManager to activate the Control.
175 internal void AccessibilityActivate()
177 viewWrapperImpl.AccessibilityActivate();
181 /// Called by the KeyboardFocusManager.
183 internal void KeyboardEnter()
185 viewWrapperImpl.KeyboardEnter();
189 /// Called by the KeyInputFocusManager to emit key event signals.
191 /// <param name="key">The key event</param>
192 /// <returns>True if the event was consumed</returns>
193 internal bool EmitKeyEventSignal(Key key)
195 return viewWrapperImpl.EmitKeyEventSignal(key);
199 /// Request a relayout, which means performing a size negotiation on this view, its parent and children (and potentially whole scene).<br>
200 /// This method can also be called from a derived class every time it needs a different size.<br>
201 /// At the end of event processing, the relayout process starts and all controls which requested Relayout will have their sizes (re)negotiated.<br>
202 /// 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>
204 protected void RelayoutRequest()
206 viewWrapperImpl.RelayoutRequest();
210 /// Provides the View implementation of GetHeightForWidth.
212 /// <param name="width">Width to use</param>
213 /// <returns>The height based on the width</returns>
214 protected float GetHeightForWidthBase(float width)
216 return viewWrapperImpl.GetHeightForWidthBase(width);
220 /// Provides the View implementation of GetWidthForHeight.
222 /// <param name="height">Height to use</param>
223 /// <returns>The width based on the height</returns>
224 protected float GetWidthForHeightBase(float height)
226 return viewWrapperImpl.GetWidthForHeightBase(height);
230 /// Calculate the size for a child using the base view object.
232 /// <param name="child">The child view to calculate the size for</param>
233 /// <param name="dimension">The dimension to calculate the size for. E.g. width or height</param>
234 /// <returns>Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found</returns>
235 protected float CalculateChildSizeBase(View child, DimensionType dimension)
237 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
241 /// Determine if this view is dependent on it's children for relayout from the base class.
243 /// <param name="dimension">The dimension(s) to check for</param>
244 /// <returns>Return if the view is dependent on it's children</returns>
245 protected bool RelayoutDependentOnChildrenBase(DimensionType dimension)
247 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
251 /// Determine if this view is dependent on it's children for relayout from the base class.
253 /// <returns>Return if the view is dependent on it's children</returns>
254 protected bool RelayoutDependentOnChildrenBase()
256 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
260 /// Register a visual by Property Index, linking an View to visual when required.<br>
261 /// In the case of the visual being an view or control deeming visual not required then visual should be an empty handle.<br>
262 /// No parenting is done during registration, this should be done by derived class.<br>
264 /// <param name="index">The Property index of the visual, used to reference visual</param>
265 /// <param name="visual">The visual to register</param>
266 protected void RegisterVisual(int index, VisualBase visual)
268 viewWrapperImpl.RegisterVisual(index, visual);
272 /// Register a visual by Property Index, linking an View to visual when required.<br>
273 /// In the case of the visual being an view or control deeming visual not required then visual should be an empty handle.<br>
274 /// If enabled is false then the visual is not set on stage until enabled by the derived class.<br>
276 /// <param name="index">The Property index of the visual, used to reference visual</param>
277 /// <param name="visual">The visual to register</param>
278 /// <param name="enabled">false if derived class wants to control when visual is set on stage</param>
279 protected void RegisterVisual(int index, VisualBase visual, bool enabled)
281 viewWrapperImpl.RegisterVisual(index, visual, enabled);
285 /// Erase the entry matching the given index from the list of registered visuals.
287 /// <param name="index">The Property index of the visual, used to reference visual</param>
288 protected void UnregisterVisual(int index)
290 viewWrapperImpl.UnregisterVisual(index);
294 /// Retrieve the visual associated with the given property index.<br>
295 /// For managing object life-cycle, do not store the returned visual as a member which increments its reference count.<br>
297 /// <param name="index">The Property index of the visual, used to reference visual</param>
298 /// <returns>The registered visual if exist, otherwise empty handle</returns>
299 protected VisualBase GetVisual(int index)
301 return viewWrapperImpl.GetVisual(index);
305 /// Sets the given visual to be displayed or not when parent staged.<br>
306 /// For managing object life-cycle, do not store the returned visual as a member which increments its reference count.<br>
308 /// <param name="index">The Property index of the visual, used to reference visual</param>
309 /// <param name="enable">flag to set enabled or disabled</param>
310 protected void EnableVisual(int index, bool enable)
312 viewWrapperImpl.EnableVisual(index, enable);
316 /// Queries if the given visual is to be displayed when parent staged.<br>
317 /// For managing object life-cycle, do not store the returned visual as a member which increments its reference count.<br>
319 /// <param name="index">The Property index of the visual</param>
320 /// <returns>Whether visual is enabled or not</returns>
321 protected bool IsVisualEnabled(int index)
323 return viewWrapperImpl.IsVisualEnabled(index);
327 /// Create a transition effect on the control.
329 /// <param name="transitionData">transitionData The transition data describing the effect to create</param>
330 /// <returns>A handle to an animation defined with the given effect, or an empty handle if no properties match </returns>
331 protected Animation CreateTransition(TransitionData transitionData)
333 return viewWrapperImpl.CreateTransition(transitionData);
337 /// Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal.<br>
338 /// Should be called last by the control after it acts on the Input Focus change.<br>
340 /// <param name="focusGained">focusGained True if gained, False if lost</param>
341 protected void EmitFocusSignal(bool focusGained)
343 viewWrapperImpl.EmitFocusSignal(focusGained);
347 /// This method is called after the Control has been initialized.<br>
348 /// Derived classes should do any second phase initialization by overriding this method.<br>
350 public virtual void OnInitialize()
355 /// Called after the view has been connected to the stage.<br>
356 /// When an view is connected, it will be directly or indirectly parented to the root View.<br>
357 /// The root View is provided automatically by Tizen.NUI.Stage, and is always considered to be connected.<br>
358 /// When the parent of a set of views is connected to the stage, then all of the children will received this callback.<br>
360 /// <param name="depth">The depth in the hierarchy for the view</param>
361 public virtual void OnStageConnection(int depth)
366 /// Called after the view has been disconnected from Stage.<br>
367 /// If an view is disconnected it either has no parent, or is parented to a disconnected view.<br>
368 /// 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.<br>
370 public virtual void OnStageDisconnection()
375 /// Called after a child has been added to the owning view.
377 /// <param name="view">The child which has been added</param>
378 public virtual void OnChildAdd(View view)
383 /// Called after the owning view has attempted to remove a child( regardless of whether it succeeded or not ).
385 /// <param name="view">The child being removed</param>
386 public virtual void OnChildRemove(View view)
391 /// Called when the owning view property is set.
393 /// <param name="index">The Property index that was set</param>
394 /// <param name="propertyValue">The value to set</param>
395 public virtual void OnPropertySet(int index, Tizen.NUI.PropertyValue propertyValue)
400 /// Called when the owning view's size is set e.g. using View.SetSize().
402 /// <param name="targetSize">The target size</param>
403 public virtual void OnSizeSet(Vector3 targetSize)
408 /// Called when the owning view's size is animated e.g. using Animation::AnimateTo( Property( view, View::Property::SIZE ), ... ).
410 /// <param name="animation">The object which is animating the owning view</param>
411 /// <param name="targetSize">The target size</param>
412 public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
417 /// Called after a touch-event is received by the owning view.<br>
418 /// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br>
420 /// <param name="touch">The touch event</param>
421 /// <returns>True if the event should be consumed</returns>
422 public virtual bool OnTouch(Touch touch)
424 return false; // Do not consume
428 /// Called after a hover-event is received by the owning view.<br>
429 /// CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br>
431 /// <param name="hover">The hover event</param>
432 /// <returns>True if the hover event should be consumed</returns>
433 public virtual bool OnHover(Hover hover)
435 return false; // Do not consume
439 /// Called after a key-event is received by the view that has had its focus set.
441 /// <param name="key">The key event</param>
442 /// <returns>True if the key event should be consumed</returns>
443 public virtual bool OnKey(Key key)
445 return false; // Do not consume
449 /// Called after a wheel-event is received by the owning view.<br>
450 /// CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br>
452 /// <param name="wheel">The wheel event</param>
453 /// <returns>True if the wheel event should be consumed</returns>
454 public virtual bool OnWheel(Wheel wheel)
456 return false; // Do not consume
460 /// Called after the size negotiation has been finished for this control.<br>
461 /// The control is expected to assign this given size to itself/its children.<br>
462 /// 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>
463 /// As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).<br>
465 /// <param name="size">The allocated size</param>
466 /// <param name="container">The control should add views to this container that it is not able to allocate a size for</param>
467 public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
472 /// Notification for deriving classes.
474 /// <param name="policy">policy The policy being set</param>
475 /// <param name="dimension">dimension The dimension the policy is being set for</param>
476 public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
481 /// Return the natural size of the view.
483 /// <returns>The view's natural size</returns>
484 public virtual Size2D GetNaturalSize()
486 return new Size2D(0, 0);
490 /// Calculate the size for a child.
492 /// <param name="child">The child view to calculate the size for</param>
493 /// <param name="dimension">The dimension to calculate the size for. E.g. width or height</param>
494 /// <returns>Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.</returns>
495 public virtual float CalculateChildSize(View child, DimensionType dimension)
497 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
501 /// This method is called during size negotiation when a height is required for a given width.<br>
502 /// Derived classes should override this if they wish to customize the height returned.<br>
504 /// <param name="width">Width to use</param>
505 /// <returns>The height based on the width</returns>
506 public virtual float GetHeightForWidth(float width)
508 return viewWrapperImpl.GetHeightForWidthBase(width);
512 /// This method is called during size negotiation when a width is required for a given height.<br>
513 /// Derived classes should override this if they wish to customize the width returned.<br>
515 /// <param name="height">Height to use</param>
516 /// <returns>The width based on the width</returns>
517 public virtual float GetWidthForHeight(float height)
519 return viewWrapperImpl.GetWidthForHeightBase(height);
523 /// Determine if this view is dependent on it's children for relayout.
525 /// <param name="dimension">The dimension(s) to check for</param>
526 /// <returns>Return if the view is dependent on it's children</returns>
527 public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
529 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
533 /// Determine if this view is dependent on it's children for relayout from the base class.
535 /// <returns>Return true if the view is dependent on it's children</returns>
536 public virtual bool RelayoutDependentOnChildren()
538 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
542 /// Virtual method to notify deriving classes that relayout dependencies have been
543 /// met and the size for this object is about to be calculated for the given dimension.
545 /// <param name="dimension">The dimension that is about to be calculated</param>
546 public virtual void OnCalculateRelayoutSize(DimensionType dimension)
551 /// Virtual method to notify deriving classes that the size for a dimension has just been negotiated.
553 /// <param name="size">The new size for the given dimension</param>
554 /// <param name="dimension">The dimension that was just negotiated</param>
555 public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
560 /// This method should be overridden by deriving classes requiring notifications when the style changes.
562 /// <param name="styleManager">The StyleManager object</param>
563 /// <param name="change">Information denoting what has changed</param>
564 public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
569 /// This method is called when the control is accessibility activated.<br>
570 /// Derived classes should override this to perform custom accessibility activation.<br>
572 /// <returns>true if this control can perform accessibility activation</returns>
573 internal virtual bool OnAccessibilityActivated()
579 /// This method should be overridden by deriving classes when they wish to respond the accessibility.
581 /// <param name="gestures">The pan gesture</param>
582 /// <returns>true if the pan gesture has been consumed by this control</returns>
583 internal virtual bool OnAccessibilityPan(PanGesture gestures)
589 /// This method should be overridden by deriving classes when they wish to respond the accessibility
591 /// <param name="touch">The touch gesture</param>
592 /// <returns>true if the touch event has been consumed by this control</returns>
593 internal virtual bool OnAccessibilityTouch(Touch touch)
599 /// 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).
601 /// <param name="isIncrease">isIncrease Whether the value should be increased or decreased</param>
602 /// <returns>true if the value changed action has been consumed by this control</returns>
603 internal virtual bool OnAccessibilityValueChange(bool isIncrease)
609 /// This method should be overridden by deriving classes when they wish to respond the accessibility zoom action.
611 /// <returns>true if the zoom action has been consumed by this control</returns>
612 internal virtual bool OnAccessibilityZoom()
618 /// Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when focus is gained.
620 public virtual void OnFocusGained()
625 /// Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when focus is lost.
627 public virtual void OnFocusLost()
632 /// Gets the next keyboard focusable view in this control towards the given direction.<br>
633 /// A control needs to override this function in order to support two dimensional keyboard navigation.<br>
635 /// <param name="currentFocusedView">The current focused view</param>
636 /// <param name="direction">The direction to move the focus towards</param>
637 /// <param name="loopEnabled">Whether the focus movement should be looped within the control</param>
638 /// <returns>the next keyboard focusable view in this control or an empty handle if no view can be focused</returns>
639 public virtual View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled)
645 /// Informs this control that its chosen focusable view will be focused.<br>
646 /// This allows the application to preform any actions if wishes before the focus is actually moved to the chosen view.<br>
648 /// <param name="commitedFocusableView">The commited focused view</param>
649 public virtual void OnFocusChangeCommitted(View commitedFocusableView)
654 /// This method is called when the control has enter pressed on it.<br>
655 /// Derived classes should override this to perform custom actions.<br>
657 /// <returns>true if this control supported this action</returns>
658 public virtual bool OnKeyboardEnter()
664 /// Called whenever a pinch gesture is detected on this control.<br>
665 /// This can be overridden by deriving classes when pinch detection is enabled. The default behaviour is to scale the control by the pinch scale.<br>
666 /// If overridden, then the default behaviour will not occur.<br>
667 /// Pinch detection should be enabled via EnableGestureDetection().<br>
669 /// <param name="pinch">pinch tap gesture</param>
670 internal virtual void OnPinch(PinchGesture pinch)
675 /// Called whenever a pan gesture is detected on this control.<br>
676 /// This should be overridden by deriving classes when pan detection is enabled.<br>
677 /// There is no default behaviour with panning.<br>
678 /// Pan detection should be enabled via EnableGestureDetection().<br>
680 /// <param name="pan">The pan gesture</param>
681 public virtual void OnPan(PanGesture pan)
686 /// Called whenever a tap gesture is detected on this control.<br>
687 /// This should be overridden by deriving classes when tap detection is enabled.<br>
688 /// There is no default behaviour with a tap.<br>
689 /// Tap detection should be enabled via EnableGestureDetection().<br>
691 /// <param name="tap">The tap gesture</param>
692 public virtual void OnTap(TapGesture tap)
697 /// Called whenever a long press gesture is detected on this control.<br>
698 /// This should be overridden by deriving classes when long press detection is enabled.<br>
699 /// There is no default behaviour associated with a long press.<br>
700 /// Long press detection should be enabled via EnableGestureDetection().<br>
702 /// <param name="longPress">The long press gesture</param>
703 internal virtual void OnLongPress(LongPressGesture longPress)
707 private void OnControlChildAdd(View child)
711 private void OnControlChildRemove(View child)