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.
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.OnKeyInputFocusGained = new ViewWrapperImpl.OnKeyInputFocusGainedDelegate(OnKeyInputFocusGained);
58 viewWrapperImpl.OnKeyInputFocusLost = new ViewWrapperImpl.OnKeyInputFocusLostDelegate(OnKeyInputFocusLost);
59 viewWrapperImpl.GetNextKeyboardFocusableView = new ViewWrapperImpl.GetNextKeyboardFocusableViewDelegate(GetNextKeyboardFocusableView);
60 viewWrapperImpl.OnKeyboardFocusChangeCommitted = new ViewWrapperImpl.OnKeyboardFocusChangeCommittedDelegate(OnKeyboardFocusChangeCommitted);
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 // By default, we do not want the position to use the anchor point
68 this.PositionUsesAnchorPoint = false;
70 // Make sure CustomView is initialized.
73 // Set the StyleName the name of the View
74 // We have to do this because the StyleManager on Native side can't workout it out
75 // This will also ensure that the style of actors/visuals initialized above are applied by the style manager.
76 SetStyleName(this.GetType().Name);
80 /// Set the background with a property map.
82 /// <param name="map">The background property map</param>
83 public void SetBackground(Tizen.NUI.PropertyMap map)
85 viewWrapperImpl.SetBackground(map);
89 * @brief Allows deriving classes to enable any of the gesture detectors that are available.
91 * Gesture detection can be enabled one at a time or in bitwise format as shown:
93 * EnableGestureDetection(Gesture.Type.Pinch | Gesture.Type.Tap | Gesture.Type.Pan));
95 * @param[in] type The gesture type(s) to enable.
97 public void EnableGestureDetection(Gesture.GestureType type)
99 viewWrapperImpl.EnableGestureDetection(type);
103 * @brief Allows deriving classes to disable any of the gesture detectors.
105 * Like EnableGestureDetection, this can also be called using bitwise or.
106 * @param[in] type The gesture type(s) to disable.
107 * @see EnableGetureDetection
109 internal void DisableGestureDetection(Gesture.GestureType type)
111 viewWrapperImpl.DisableGestureDetection(type);
115 /// Sets whether this control supports two dimensional keyboard navigation
116 /// (i.e. whether it knows how to handle the keyboard focus movement between its child actors).
117 /// The control doesn't support it by default.
119 /// <param name="isSupported">Whether this control supports two dimensional keyboard navigation.</param>
120 public bool FocusNavigationSupport
124 return IsKeyboardNavigationSupported();
128 SetKeyboardNavigationSupport(value);
132 internal void SetKeyboardNavigationSupport(bool isSupported)
134 viewWrapperImpl.SetKeyboardNavigationSupport(isSupported);
139 * @brief Gets whether this control supports two dimensional keyboard navigation.
141 * @return true if this control supports two dimensional keyboard navigation.
143 internal bool IsKeyboardNavigationSupported()
145 return viewWrapperImpl.IsKeyboardNavigationSupported();
150 /// Sets or Gets whether this control is a focus group for keyboard navigation.
152 /// <returns>true if this control is set as a focus group for keyboard navigation</returns>
153 public bool FocusGroup
157 return IsKeyboardFocusGroup();
161 SetAsKeyboardFocusGroup(value);
166 * @brief Sets whether this control is a focus group for keyboard navigation.
168 * (i.e. the scope of keyboard focus movement
169 * can be limitied to its child actors). The control is not a focus group by default.
170 * @param[in] isFocusGroup Whether this control is set as a focus group for keyboard navigation.
172 internal void SetAsKeyboardFocusGroup(bool isFocusGroup)
174 viewWrapperImpl.SetAsKeyboardFocusGroup(isFocusGroup);
178 * @brief Gets whether this control is a focus group for keyboard navigation.
180 * @return true if this control is set as a focus group for keyboard navigation.
182 internal bool IsKeyboardFocusGroup()
184 return viewWrapperImpl.IsKeyboardFocusGroup();
188 * @brief Called by the AccessibilityManager to activate the Control.
191 internal void AccessibilityActivate()
193 viewWrapperImpl.AccessibilityActivate();
197 /// Called by the KeyboardFocusManager.
199 internal void KeyboardEnter()
201 viewWrapperImpl.KeyboardEnter();
205 /// Called by the KeyInputFocusManager to emit key event signals.
207 /// <param name="key">The key event</param>
208 /// <returns>True if the event was consumed</returns>
209 internal bool EmitKeyEventSignal(Key key)
211 return viewWrapperImpl.EmitKeyEventSignal(key);
215 * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene).
217 * This method can also be called from a derived class every time it needs a different size.
218 * At the end of event processing, the relayout process starts and
219 * all controls which requested Relayout will have their sizes (re)negotiated.
221 * @note RelayoutRequest() can be called multiple times; the size negotiation is still
222 * only performed once, i.e. there is no need to keep track of this in the calling side.
224 protected void RelayoutRequest()
226 viewWrapperImpl.RelayoutRequest();
230 * @brief Provides the Actor implementation of GetHeightForWidth.
231 * @param width Width to use.
232 * @return The height based on the width.
234 protected float GetHeightForWidthBase(float width)
236 return viewWrapperImpl.GetHeightForWidthBase(width);
240 * @brief Provides the Actor implementation of GetWidthForHeight.
241 * @param height Height to use.
242 * @return The width based on the height.
244 protected float GetWidthForHeightBase(float height)
246 return viewWrapperImpl.GetWidthForHeightBase(height);
250 * @brief Calculate the size for a child using the base actor object.
252 * @param[in] child The child actor to calculate the size for
253 * @param[in] dimension The dimension to calculate the size for. E.g. width or height
254 * @return Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.
256 protected float CalculateChildSizeBase(Actor child, DimensionType dimension)
258 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
262 * @brief Determine if this actor is dependent on it's children for relayout from the base class.
264 * @param dimension The dimension(s) to check for
265 * @return Return if the actor is dependent on it's children.
267 protected bool RelayoutDependentOnChildrenBase(DimensionType dimension)
269 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
273 * @brief Determine if this actor is dependent on it's children for relayout from the base class.
275 * @param dimension The dimension(s) to check for
276 * @return Return if the actor is dependent on it's children.
278 protected bool RelayoutDependentOnChildrenBase()
280 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
284 * @brief Register a visual by Property Index, linking an Actor to visual when required.
285 * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
286 * No parenting is done during registration, this should be done by derived class.
288 * @param[in] index The Property index of the visual, used to reference visual
289 * @param[in] visual The visual to register
290 * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
291 * Use below API with enabled set to false if derived class wishes to control when visual is staged.
293 protected void RegisterVisual(int index, VisualBase visual)
295 viewWrapperImpl.RegisterVisual(index, visual);
299 * @brief Register a visual by Property Index, linking an Actor to visual when required.
300 * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
301 * If enabled is false then the visual is not set on stage until enabled by the derived class.
304 * @param[in] index The Property index of the visual, used to reference visual
305 * @param[in] visual The visual to register
306 * @param[in] enabled false if derived class wants to control when visual is set on stage.
309 protected void RegisterVisual(int index, VisualBase visual, bool enabled)
311 viewWrapperImpl.RegisterVisual(index, visual, enabled);
315 * @brief Erase the entry matching the given index from the list of registered visuals
316 * @param[in] index The Property index of the visual, used to reference visual
319 protected void UnregisterVisual(int index)
321 viewWrapperImpl.UnregisterVisual(index);
325 * @brief Retrieve the visual associated with the given property index.
327 * @param[in] index The Property index of the visual.
328 * @return The registered visual if exist, otherwise empty handle.
329 * @note For managing object life-cycle, do not store the returned visual as a member which increments its reference count.
331 protected VisualBase GetVisual(int index)
333 return viewWrapperImpl.GetVisual(index);
337 * @brief Sets the given visual to be displayed or not when parent staged.
339 * @param[in] index The Property index of the visual
340 * @param[in] enable flag to set enabled or disabled.
342 protected void EnableVisual(int index, bool enable)
344 viewWrapperImpl.EnableVisual(index, enable);
348 * @brief Queries if the given visual is to be displayed when parent staged.
350 * @param[in] index The Property index of the visual
351 * @return bool whether visual is enabled or not
353 protected bool IsVisualEnabled(int index)
355 return viewWrapperImpl.IsVisualEnabled(index);
359 * @brief Create a transition effect on the control.
361 * @param[in] transitionData The transition data describing the effect to create
362 * @return A handle to an animation defined with the given effect, or an empty
363 * handle if no properties match.
365 protected Animation CreateTransition(TransitionData transitionData)
367 return viewWrapperImpl.CreateTransition(transitionData);
371 * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal
373 * Should be called last by the control after it acts on the Input Focus change.
375 * @param[in] focusGained True if gained, False if lost
377 protected void EmitKeyInputFocusSignal(bool focusGained)
379 viewWrapperImpl.EmitKeyInputFocusSignal(focusGained);
383 * @brief This method is called after the Control has been initialized.
385 * Derived classes should do any second phase initialization by overriding this method.
387 public virtual void OnInitialize()
392 * @brief Called after the actor has been connected to the stage.
394 * When an actor is connected, it will be directly or indirectly parented to the root Actor.
395 * @param[in] depth The depth in the hierarchy for the actor
397 * @note The root Actor is provided automatically by Dali::Stage, and is always considered to be connected.
398 * When the parent of a set of actors is connected to the stage, then all of the children
399 * will received this callback.
400 * For the following actor tree, the callback order will be A, B, D, E, C, and finally F.
411 * @param[in] depth The depth in the hierarchy for the actor
413 public virtual void OnStageConnection(int depth)
418 * @brief Called after the actor has been disconnected from Stage.
420 * If an actor is disconnected it either has no parent, or is parented to a disconnected actor.
422 * @note When the parent of a set of actors is disconnected to the stage, then all of the children
423 * will received this callback, starting with the leaf actors.
424 * For the following actor tree, the callback order will be D, E, B, F, C, and finally A.
436 public virtual void OnStageDisconnection()
441 * @brief Called after a child has been added to the owning actor.
443 * @param[in] child The child which has been added
445 public virtual void OnChildAdd(Actor actor)
450 * @brief Called after the owning actor has attempted to remove a child( regardless of whether it succeeded or not ).
452 * @param[in] child The child being removed
454 public virtual void OnChildRemove(Actor actor)
459 * @brief Called when the owning actor property is set.
461 * @param[in] index The Property index that was set
462 * @param[in] propertyValue The value to set
464 public virtual void OnPropertySet(int index, Tizen.NUI.PropertyValue propertyValue)
469 * @brief Called when the owning actor's size is set e.g. using Actor::SetSize().
471 * @param[in] targetSize The target size. Note that this target size may not match the size returned via Actor.GetTargetSize.
473 public virtual void OnSizeSet(Vector3 targetSize)
478 * @brief Called when the owning actor's size is animated e.g. using Animation::AnimateTo( Property( actor, Actor::Property::SIZE ), ... ).
480 * @param[in] animation The object which is animating the owning actor.
481 * @param[in] targetSize The target size. Note that this target size may not match the size returned via @ref Actor.GetTargetSize.
483 public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
488 * @DEPRECATED_1_1.37 Connect to TouchSignal() instead.
490 * @brief Called after a touch-event is received by the owning actor.
492 * @param[in] touch The touch event
493 * @return True if the event should be consumed.
494 * @note CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
496 public virtual bool OnTouch(Touch touch)
498 return false; // Do not consume
502 * @brief Called after a hover-event is received by the owning actor.
504 * @param[in] hover The hover event
505 * @return True if the hover event should be consumed.
506 * @note CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
508 public virtual bool OnHover(Hover hover)
510 return false; // Do not consume
514 * @brief Called after a key-event is received by the actor that has had its focus set.
516 * @param[in] key the Key Event
517 * @return True if the event should be consumed.
519 public virtual bool OnKey(Key key)
521 return false; // Do not consume
525 * @brief Called after a wheel-event is received by the owning actor.
527 * @param[in] wheel The wheel event
528 * @return True if the event should be consumed.
529 * @note CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
531 public virtual bool OnWheel(Wheel wheel)
533 return false; // Do not consume
537 * @brief Called after the size negotiation has been finished for this control.
539 * The control is expected to assign this given size to itself/its children.
541 * Should be overridden by derived classes if they need to layout
542 * actors differently after certain operations like add or remove
543 * actors, resize or after changing specific properties.
545 * @param[in] size The allocated size.
546 * @param[in,out] container The control should add actors to this container that it is not able
547 * to allocate a size for.
548 * @note As this function is called from inside the size negotiation algorithm, you cannot
549 * call RequestRelayout (the call would just be ignored).
551 public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
556 * @brief Notification for deriving classes
558 * @param[in] policy The policy being set
559 * @param[in] dimension The dimension the policy is being set for
561 public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
566 * @brief Return the natural size of the actor.
568 * @return The actor's natural size
570 public virtual Size GetNaturalSize()
572 return new Size(0.0f, 0.0f, 0.0f);
576 * @brief Calculate the size for a child.
578 * @param[in] child The child actor to calculate the size for
579 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
580 * @return Return the calculated size for the given dimension.
582 public virtual float CalculateChildSize(Actor child, DimensionType dimension)
584 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
588 * @brief This method is called during size negotiation when a height is required for a given width.
590 * Derived classes should override this if they wish to customize the height returned.
592 * @param width Width to use.
593 * @return The height based on the width.
595 public virtual float GetHeightForWidth(float width)
597 return viewWrapperImpl.GetHeightForWidthBase(width);
601 * @brief This method is called during size negotiation when a width is required for a given height.
603 * Derived classes should override this if they wish to customize the width returned.
605 * @param height Height to use.
606 * @return The width based on the width.
608 public virtual float GetWidthForHeight(float height)
610 return viewWrapperImpl.GetWidthForHeightBase(height);
614 * @brief Determine if this actor is dependent on it's children for relayout.
616 * @param dimension The dimension(s) to check for
617 * @return Return if the actor is dependent on it's children.
619 public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
621 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
625 * @brief Determine if this actor is dependent on it's children for relayout from the base class.
627 * @return Return if the actor is dependent on it's children.
629 public virtual bool RelayoutDependentOnChildren()
631 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
635 * @brief Virtual method to notify deriving classes that relayout dependencies have been
636 * met and the size for this object is about to be calculated for the given dimension
638 * @param dimension The dimension that is about to be calculated
640 public virtual void OnCalculateRelayoutSize(DimensionType dimension)
645 * @brief Virtual method to notify deriving classes that the size for a dimension
646 * has just been negotiated
648 * @param[in] size The new size for the given dimension
649 * @param[in] dimension The dimension that was just negotiated
651 public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
656 * @brief This method should be overridden by deriving classes requiring notifications when the style changes.
658 * @param[in] styleManager The StyleManager object.
659 * @param[in] change Information denoting what has changed.
661 public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
666 * @brief This method is called when the control is accessibility activated.
668 * Derived classes should override this to perform custom accessibility activation.
669 * @return true if this control can perform accessibility activation.
671 internal virtual bool OnAccessibilityActivated()
677 * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
680 * @param[in] gesture The pan gesture.
681 * @return true if the pan gesture has been consumed by this control
683 internal virtual bool OnAccessibilityPan(PanGesture gestures)
689 * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
692 * @param[in] touch The touch event.
693 * @return true if the touch event has been consumed by this control
695 internal virtual bool OnAccessibilityTouch(Touch touch)
701 * @brief This method should be overridden by deriving classes when they wish to respond
702 * the accessibility up and down action (i.e. value change of slider control).
704 * @param[in] isIncrease Whether the value should be increased or decreased
705 * @return true if the value changed action has been consumed by this control
707 internal virtual bool OnAccessibilityValueChange(bool isIncrease)
713 * @brief This method should be overridden by deriving classes when they wish to respond
714 * the accessibility zoom action.
716 * @return true if the zoom action has been consumed by this control
718 internal virtual bool OnAccessibilityZoom()
724 * @brief This method should be overridden by deriving classes when they wish to respond
725 * the accessibility zoom action.
727 * @return true if the zoom action has been consumed by this control
729 public virtual void OnKeyInputFocusGained()
734 * @brief Called when the control loses key input focus.
736 * Should be overridden by derived classes if they need to customize what happens when focus is lost.
738 public virtual void OnKeyInputFocusLost()
743 * @brief Gets the next keyboard focusable actor in this control towards the given direction.
745 * A control needs to override this function in order to support two dimensional keyboard navigation.
746 * @param[in] currentFocusedActor The current focused actor.
747 * @param[in] direction The direction to move the focus towards.
748 * @param[in] loopEnabled Whether the focus movement should be looped within the control.
749 * @return the next keyboard focusable actor in this control or an empty handle if no actor can be focused.
751 public virtual View GetNextKeyboardFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled)
757 * @brief Informs this control that its chosen focusable actor will be focused.
759 * This allows the application to preform any actions if wishes
760 * before the focus is actually moved to the chosen actor.
762 * @param[in] commitedFocusableActor The commited focusable actor.
764 public virtual void OnKeyboardFocusChangeCommitted(View commitedFocusableView)
769 * @brief This method is called when the control has enter pressed on it.
771 * Derived classes should override this to perform custom actions.
772 * @return true if this control supported this action.
774 public virtual bool OnKeyboardEnter()
780 * @brief Called whenever a pinch gesture is detected on this control.
782 * This can be overridden by deriving classes when pinch detection
783 * is enabled. The default behaviour is to scale the control by the
786 * @param[in] pinch The pinch gesture.
787 * @note If overridden, then the default behaviour will not occur.
788 * @note Pinch detection should be enabled via EnableGestureDetection().
789 * @see EnableGestureDetection
791 internal virtual void OnPinch(PinchGesture pinch)
796 * @brief Called whenever a pan gesture is detected on this control.
798 * This should be overridden by deriving classes when pan detection
801 * @param[in] pan The pan gesture.
802 * @note There is no default behaviour with panning.
803 * @note Pan detection should be enabled via EnableGestureDetection().
804 * @see EnableGestureDetection
806 public virtual void OnPan(PanGesture pan)
811 * @brief Called whenever a tap gesture is detected on this control.
813 * This should be overridden by deriving classes when tap detection
816 * @param[in] tap The tap gesture.
817 * @note There is no default behaviour with a tap.
818 * @note Tap detection should be enabled via EnableGestureDetection().
819 * @see EnableGestureDetection
821 public virtual void OnTap(TapGesture tap)
826 * @brief Called whenever a long press gesture is detected on this control.
828 * This should be overridden by deriving classes when long press
829 * detection is enabled.
831 * @param[in] longPress The long press gesture.
832 * @note There is no default behaviour associated with a long press.
833 * @note Long press detection should be enabled via EnableGestureDetection().
834 * @see EnableGestureDetection
836 internal virtual void OnLongPress(LongPressGesture longPress)
840 private void OnControlChildAdd(Actor child)
844 private void OnControlChildRemove(Actor child)
848 public enum CustomViewBehaviour
850 ViewBehaviourDefault = 0,
851 DisableSizeNegotiation = 1 << 0,
852 RequiresKeyboardNavigationSupport = 1 << 5,
853 DisableStyleChangeSignals = 1 << 6,
854 LastViewBehaviourFlag