2 * Copyright (c) 2016 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.
17 using System.ComponentModel;
22 /// CustomView provides some common functionality required by all views.
24 public class CustomView : ViewWrapper
26 public CustomView(string typeName, CustomViewBehaviour behaviour) : base(typeName, new ViewWrapperImpl(behaviour))
28 // Registering CustomView virtual functions to viewWrapperImpl delegates.
29 viewWrapperImpl.OnStageConnection = new ViewWrapperImpl.OnStageConnectionDelegate(OnStageConnection);
30 viewWrapperImpl.OnStageDisconnection = new ViewWrapperImpl.OnStageDisconnectionDelegate(OnStageDisconnection);
31 viewWrapperImpl.OnChildAdd = new ViewWrapperImpl.OnChildAddDelegate(OnChildAdd);
32 viewWrapperImpl.OnChildRemove = new ViewWrapperImpl.OnChildRemoveDelegate(OnChildRemove);
33 viewWrapperImpl.OnPropertySet = new ViewWrapperImpl.OnPropertySetDelegate(OnPropertySet);
34 viewWrapperImpl.OnSizeSet = new ViewWrapperImpl.OnSizeSetDelegate(OnSizeSet);
35 viewWrapperImpl.OnSizeAnimation = new ViewWrapperImpl.OnSizeAnimationDelegate(OnSizeAnimation);
36 viewWrapperImpl.OnTouch = new ViewWrapperImpl.OnTouchDelegate(OnTouch);
37 viewWrapperImpl.OnHover = new ViewWrapperImpl.OnHoverDelegate(OnHover);
38 viewWrapperImpl.OnKey = new ViewWrapperImpl.OnKeyDelegate(OnKey);
39 viewWrapperImpl.OnWheel = new ViewWrapperImpl.OnWheelDelegate(OnWheel);
40 viewWrapperImpl.OnRelayout = new ViewWrapperImpl.OnRelayoutDelegate(OnRelayout);
41 viewWrapperImpl.OnSetResizePolicy = new ViewWrapperImpl.OnSetResizePolicyDelegate(OnSetResizePolicy);
42 viewWrapperImpl.GetNaturalSize = new ViewWrapperImpl.GetNaturalSizeDelegate(GetNaturalSize);
43 viewWrapperImpl.CalculateChildSize = new ViewWrapperImpl.CalculateChildSizeDelegate(CalculateChildSize);
44 viewWrapperImpl.GetHeightForWidth = new ViewWrapperImpl.GetHeightForWidthDelegate(GetHeightForWidth);
45 viewWrapperImpl.GetWidthForHeight = new ViewWrapperImpl.GetWidthForHeightDelegate(GetWidthForHeight);
46 viewWrapperImpl.RelayoutDependentOnChildrenDimension = new ViewWrapperImpl.RelayoutDependentOnChildrenDimensionDelegate(RelayoutDependentOnChildren);
47 viewWrapperImpl.RelayoutDependentOnChildren = new ViewWrapperImpl.RelayoutDependentOnChildrenDelegate(RelayoutDependentOnChildren);
48 viewWrapperImpl.OnCalculateRelayoutSize = new ViewWrapperImpl.OnCalculateRelayoutSizeDelegate(OnCalculateRelayoutSize);
49 viewWrapperImpl.OnLayoutNegotiated = new ViewWrapperImpl.OnLayoutNegotiatedDelegate(OnLayoutNegotiated);
50 viewWrapperImpl.OnControlChildAdd = new ViewWrapperImpl.OnControlChildAddDelegate(OnControlChildAdd);
51 viewWrapperImpl.OnControlChildRemove = new ViewWrapperImpl.OnControlChildRemoveDelegate(OnControlChildRemove);
52 viewWrapperImpl.OnStyleChange = new ViewWrapperImpl.OnStyleChangeDelegate(OnStyleChange);
53 viewWrapperImpl.OnAccessibilityActivated = new ViewWrapperImpl.OnAccessibilityActivatedDelegate(OnAccessibilityActivated);
54 viewWrapperImpl.OnAccessibilityPan = new ViewWrapperImpl.OnAccessibilityPanDelegate(OnAccessibilityPan);
55 viewWrapperImpl.OnAccessibilityTouch = new ViewWrapperImpl.OnAccessibilityTouchDelegate(OnAccessibilityTouch);
56 viewWrapperImpl.OnAccessibilityValueChange = new ViewWrapperImpl.OnAccessibilityValueChangeDelegate(OnAccessibilityValueChange);
57 viewWrapperImpl.OnAccessibilityZoom = new ViewWrapperImpl.OnAccessibilityZoomDelegate(OnAccessibilityZoom);
58 viewWrapperImpl.OnFocusGained = new ViewWrapperImpl.OnFocusGainedDelegate(OnFocusGained);
59 viewWrapperImpl.OnFocusLost = new ViewWrapperImpl.OnFocusLostDelegate(OnFocusLost);
60 viewWrapperImpl.GetNextFocusableView = new ViewWrapperImpl.GetNextFocusableViewDelegate(GetNextFocusableView);
61 viewWrapperImpl.OnFocusChangeCommitted = new ViewWrapperImpl.OnFocusChangeCommittedDelegate(OnFocusChangeCommitted);
62 viewWrapperImpl.OnKeyboardEnter = new ViewWrapperImpl.OnKeyboardEnterDelegate(OnKeyboardEnter);
63 viewWrapperImpl.OnPinch = new ViewWrapperImpl.OnPinchDelegate(OnPinch);
64 viewWrapperImpl.OnPan = new ViewWrapperImpl.OnPanDelegate(OnPan);
65 viewWrapperImpl.OnTap = new ViewWrapperImpl.OnTapDelegate(OnTap);
66 viewWrapperImpl.OnLongPress = new ViewWrapperImpl.OnLongPressDelegate(OnLongPress);
68 // By default, we do not want the position to use the anchor point
69 this.PositionUsesAnchorPoint = false;
71 // Make sure CustomView is initialized.
74 // Set the StyleName the name of the View
75 // We have to do this because the StyleManager on Native side can't workout it out
76 // This will also ensure that the style of actors/visuals initialized above are applied by the style manager.
77 SetStyleName(this.GetType().Name);
81 /// Set the background with a property map.
83 /// <param name="map">The background property map</param>
84 public void SetBackground(Tizen.NUI.PropertyMap map)
86 viewWrapperImpl.SetBackground(map);
90 /// Allows deriving classes to enable any of the gesture detectors that are available.<br>
91 /// Gesture detection can be enabled one at a time or in bitwise format.<br>
93 /// <param name="type">The gesture type(s) to enable</param>
94 public void EnableGestureDetection(Gesture.GestureType type)
96 viewWrapperImpl.EnableGestureDetection(type);
100 /// Allows deriving classes to disable any of the gesture detectors.<br>
101 /// Like EnableGestureDetection, this can also be called using bitwise or one at a time.<br>
103 /// <param name="type">The gesture type(s) to disable</param>
104 internal void DisableGestureDetection(Gesture.GestureType type)
106 viewWrapperImpl.DisableGestureDetection(type);
110 /// Sets whether this control supports two dimensional keyboard navigation
111 /// (i.e. whether it knows how to handle the keyboard focus movement between its child actors).<br>
112 /// The control doesn't support it by default.<br>
114 /// <param name="isSupported">Whether this control supports two dimensional keyboard navigation.</param>
115 public bool FocusNavigationSupport
119 return IsKeyboardNavigationSupported();
123 SetKeyboardNavigationSupport(value);
127 internal void SetKeyboardNavigationSupport(bool isSupported)
129 viewWrapperImpl.SetKeyboardNavigationSupport(isSupported);
133 /// Gets whether this control supports two dimensional keyboard navigation.
135 /// <returns>true if this control supports two dimensional keyboard navigation</returns>
136 internal bool IsKeyboardNavigationSupported()
138 return viewWrapperImpl.IsKeyboardNavigationSupported();
143 /// Sets or Gets whether this control is a focus group for keyboard navigation.
145 /// <returns>true if this control is set as a focus group for keyboard navigation</returns>
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 actors). 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 /// Request a relayout, which means performing a size negotiation on this actor, 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 Actor implementation of GetHeightForWidth.
216 /// <param name="width">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 Actor implementation of GetWidthForHeight.
226 /// <param name="height">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 /// Calculate the size for a child using the base actor object.
236 /// <param name="child">The child actor to calculate the size for</param>
237 /// <param name="dimension">The dimension to calculate the size for. E.g. width or 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(Actor child, DimensionType dimension)
241 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
245 /// Determine if this actor 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 actor is dependent on it's children</returns>
249 protected bool RelayoutDependentOnChildrenBase(DimensionType dimension)
251 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
255 /// Determine if this actor is dependent on it's children for relayout from the base class.
257 /// <returns>Return if the actor is dependent on it's children</returns>
258 protected bool RelayoutDependentOnChildrenBase()
260 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
264 /// Register a visual by Property Index, linking an Actor to visual when required.<br>
265 /// In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.<br>
266 /// No parenting is done during registration, this should be done by 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 /// Register a visual by Property Index, linking an Actor to visual when required.<br>
277 /// In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.<br>
278 /// If enabled is false then the visual is not set on 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 visual is set on stage</param>
283 protected void RegisterVisual(int index, VisualBase visual, bool enabled)
285 viewWrapperImpl.RegisterVisual(index, visual, enabled);
289 /// Erase 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 /// Retrieve the visual associated with the given property index.<br>
299 /// For managing object life-cycle, 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 exist, otherwise 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 object life-cycle, 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 to set 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 object life-cycle, 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 /// Create a transition effect on the control.
333 /// <param name="transitionData">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 KeyInputFocusGained signal if true else emits KeyInputFocusLost signal.<br>
342 /// Should be called last by the control after it acts on the Input Focus change.<br>
344 /// <param name="focusGained">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 public virtual void OnInitialize()
359 /// Called after the actor has been connected to the stage.<br>
360 /// When an actor is connected, it will be directly or indirectly parented to the root Actor.<br>
361 /// The root Actor is provided automatically by Tizen.NUI.Stage, and is always considered to be connected.<br>
362 /// When the parent of a set of actors is connected to the stage, then all of the children will received this callback.<br>
364 /// <param name="depth">The depth in the hierarchy for the actor</param>
365 public virtual void OnStageConnection(int depth)
370 /// Called after the actor has been disconnected from Stage.<br>
371 /// If an actor is disconnected it either has no parent, or is parented to a disconnected actor.<br>
372 /// When the parent of a set of actors is disconnected to the stage, then all of the children will received this callback, starting with the leaf actors.<br>
374 public virtual void OnStageDisconnection()
379 /// Called after a child has been added to the owning actor.
381 /// <param name="actor">The child which has been added</param>
382 public virtual void OnChildAdd(Actor actor)
387 /// Called after the owning actor has attempted to remove a child( regardless of whether it succeeded or not ).
389 /// <param name="actor">The child being removed</param>
390 public virtual void OnChildRemove(Actor actor)
395 /// Called when the owning actor property is set.
397 /// <param name="index">The Property index that was set</param>
398 /// <param name="propertyValue">The value to set</param>
399 public virtual void OnPropertySet(int index, Tizen.NUI.PropertyValue propertyValue)
404 /// Called when the owning actor's size is set e.g. using Actor.SetSize().
406 /// <param name="targetSize">The target size. Note that this target size may not match the size returned via Actor.GetTargetSize</param>
407 public virtual void OnSizeSet(Vector3 targetSize)
412 /// Called when the owning actor's size is animated e.g. using Animation::AnimateTo( Property( actor, Actor::Property::SIZE ), ... ).
414 /// <param name="animation">The object which is animating the owning actor</param>
415 /// <param name="targetSize">The target size. Note that this target size may not match the size returned via @ref Actor.GetTargetSize</param>
416 public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
421 /// Called after a touch-event is received by the owning actor.<br>
422 /// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br>
424 /// <param name="touch">The touch event</param>
425 /// <returns>True if the event should be consumed</returns>
426 public virtual bool OnTouch(Touch touch)
428 return false; // Do not consume
432 /// Called after a hover-event is received by the owning actor.<br>
433 /// CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br>
435 /// <param name="hover">The hover event</param>
436 /// <returns>True if the hover event should be consumed</returns>
437 public virtual bool OnHover(Hover hover)
439 return false; // Do not consume
443 /// Called after a key-event is received by the actor that has had its focus set.
445 /// <param name="key">The key event</param>
446 /// <returns>True if the key event should be consumed</returns>
447 public virtual bool OnKey(Key key)
449 return false; // Do not consume
453 /// Called after a wheel-event is received by the owning actor.<br>
454 /// CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).<br>
456 /// <param name="wheel">The wheel event</param>
457 /// <returns>True if the wheel event should be consumed</returns>
458 public virtual bool OnWheel(Wheel wheel)
460 return false; // Do not consume
464 /// Called after the size negotiation has been finished for this control.<br>
465 /// The control is expected to assign this given size to itself/its children.<br>
466 /// Should be overridden by derived classes if they need to layout actors differently after certain operations like add or remove actors, resize or after changing specific properties.<br>
467 /// As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).<br>
469 /// <param name="size">The allocated size</param>
470 /// <param name="container">The control should add actors to this container that it is not able to allocate a size for</param>
471 public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
476 /// Notification for deriving classes.
478 /// <param name="policy">policy The policy being set</param>
479 /// <param name="dimension">dimension The dimension the policy is being set for</param>
480 public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
485 /// Return the natural size of the actor.
487 /// <returns>The actor's natural size</returns>
488 public virtual Size GetNaturalSize()
490 return new Size(0.0f, 0.0f, 0.0f);
494 /// Calculate the size for a child.
496 /// <param name="child">The child actor to calculate the size for</param>
497 /// <param name="dimension">The dimension to calculate the size for. E.g. width or height</param>
498 /// <returns>Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.</returns>
499 public virtual float CalculateChildSize(Actor child, DimensionType dimension)
501 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
505 /// This method is called during size negotiation when a height is required for a given width.<br>
506 /// Derived classes should override this if they wish to customize the height returned.<br>
508 /// <param name="width">Width to use</param>
509 /// <returns>The height based on the width</returns>
510 public virtual float GetHeightForWidth(float width)
512 return viewWrapperImpl.GetHeightForWidthBase(width);
516 /// This method is called during size negotiation when a width is required for a given height.<br>
517 /// Derived classes should override this if they wish to customize the width returned.<br>
519 /// <param name="height">Height to use</param>
520 /// <returns>The width based on the width</returns>
521 public virtual float GetWidthForHeight(float height)
523 return viewWrapperImpl.GetWidthForHeightBase(height);
527 /// Determine if this actor is dependent on it's children for relayout.
529 /// <param name="dimension">The dimension(s) to check for</param>
530 /// <returns>Return if the actor is dependent on it's children</returns>
531 public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
533 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
537 /// Determine if this actor is dependent on it's children for relayout from the base class.
539 /// <returns>Return true if the actor is dependent on it's children</returns>
540 public virtual bool RelayoutDependentOnChildren()
542 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
546 /// Virtual method to notify deriving classes that relayout dependencies have been
547 /// met and the size for this object is about to be calculated for the given dimension.
549 /// <param name="dimension">The dimension that is about to be calculated</param>
550 public virtual void OnCalculateRelayoutSize(DimensionType dimension)
555 /// Virtual method to notify deriving classes that the size for a dimension has just been negotiated.
557 /// <param name="size">The new size for the given dimension</param>
558 /// <param name="dimension">The dimension that was just negotiated</param>
559 public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
564 /// This method should be overridden by deriving classes requiring notifications when the style changes.
566 /// <param name="styleManager">The StyleManager object</param>
567 /// <param name="change">Information denoting what has changed</param>
568 public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
573 /// This method is called when the control is accessibility activated.<br>
574 /// Derived classes should override this to perform custom accessibility activation.<br>
576 /// <returns>true if this control can perform accessibility activation</returns>
577 internal virtual bool OnAccessibilityActivated()
583 /// This method should be overridden by deriving classes when they wish to respond the accessibility.
585 /// <param name="gestures">The pan gesture</param>
586 /// <returns>true if the pan gesture has been consumed by this control</returns>
587 internal virtual bool OnAccessibilityPan(PanGesture gestures)
593 /// This method should be overridden by deriving classes when they wish to respond the accessibility
595 /// <param name="touch">The touch gesture</param>
596 /// <returns>true if the touch event has been consumed by this control</returns>
597 internal virtual bool OnAccessibilityTouch(Touch touch)
603 /// 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).
605 /// <param name="isIncrease">isIncrease Whether the value should be increased or decreased</param>
606 /// <returns>true if the value changed action has been consumed by this control</returns>
607 internal virtual bool OnAccessibilityValueChange(bool isIncrease)
613 /// This method should be overridden by deriving classes when they wish to respond the accessibility zoom action.
615 /// <returns>true if the zoom action has been consumed by this control</returns>
616 internal virtual bool OnAccessibilityZoom()
622 /// 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.
624 public virtual void OnFocusGained()
629 /// 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.
631 public virtual void OnFocusLost()
636 /// Gets the next keyboard focusable actor in this control towards the given direction.<br>
637 /// A control needs to override this function in order to support two dimensional keyboard navigation.<br>
639 /// <param name="currentFocusedView">The current focused actor</param>
640 /// <param name="direction">The direction to move the focus towards</param>
641 /// <param name="loopEnabled">Whether the focus movement should be looped within the control</param>
642 /// <returns>the next keyboard focusable actor in this control or an empty handle if no actor can be focused</returns>
643 public virtual View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled)
649 /// Informs this control that its chosen focusable actor will be focused.<br>
650 /// This allows the application to preform any actions if wishes before the focus is actually moved to the chosen actor.<br>
652 /// <param name="commitedFocusableView">The commited focused actor</param>
653 public virtual void OnFocusChangeCommitted(View commitedFocusableView)
658 /// This method is called when the control has enter pressed on it.<br>
659 /// Derived classes should override this to perform custom actions.<br>
661 /// <returns>true if this control supported this action</returns>
662 public virtual bool OnKeyboardEnter()
668 /// Called whenever a pinch gesture is detected on this control.<br>
669 /// 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>
670 /// If overridden, then the default behaviour will not occur.<br>
671 /// Pinch detection should be enabled via EnableGestureDetection().<br>
673 /// <param name="pinch">pinch tap gesture</param>
674 internal virtual void OnPinch(PinchGesture pinch)
679 /// Called whenever a pan gesture is detected on this control.<br>
680 /// This should be overridden by deriving classes when pan detection is enabled.<br>
681 /// There is no default behaviour with panning.<br>
682 /// Pan detection should be enabled via EnableGestureDetection().<br>
684 /// <param name="pan">The pan gesture</param>
685 public virtual void OnPan(PanGesture pan)
690 /// Called whenever a tap gesture is detected on this control.<br>
691 /// This should be overridden by deriving classes when tap detection is enabled.<br>
692 /// There is no default behaviour with a tap.<br>
693 /// Tap detection should be enabled via EnableGestureDetection().<br>
695 /// <param name="tap">The tap gesture</param>
696 public virtual void OnTap(TapGesture tap)
701 /// Called whenever a long press gesture is detected on this control.<br>
702 /// This should be overridden by deriving classes when long press detection is enabled.<br>
703 /// There is no default behaviour associated with a long press.<br>
704 /// Long press detection should be enabled via EnableGestureDetection().<br>
706 /// <param name="longPress">The long press gesture</param>
707 internal virtual void OnLongPress(LongPressGesture longPress)
711 private void OnControlChildAdd(Actor child)
715 private void OnControlChildRemove(Actor child)
721 /// This specifies ccustomView behaviour types.
723 public enum CustomViewBehaviour
726 /// Use to provide default behaviour (size negotiation is on, event callbacks are not called)
728 ViewBehaviourDefault = 0,
730 /// True if control does not need size negotiation, i.e. it can be skipped in the algorithm
732 DisableSizeNegotiation = 1 << 0,
734 /// Use to provide key navigation support.
736 RequiresKeyboardNavigationSupport = 1 << 5,
738 /// Use to make style change event disabled.
740 DisableStyleChangeSignals = 1 << 6,
741 [EditorBrowsable(EditorBrowsableState.Never)]
742 LastViewBehaviourFlag