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.GetNextKeyboardFocusableActor = new ViewWrapperImpl.GetNextKeyboardFocusableActorDelegate(GetNextKeyboardFocusableActor);
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 // 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 actors/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 * @brief Allows deriving classes to enable any of the gesture detectors that are available.
88 * Gesture detection can be enabled one at a time or in bitwise format as shown:
90 * EnableGestureDetection(Gesture.Type.Pinch | Gesture.Type.Tap | Gesture.Type.Pan));
92 * @param[in] type The gesture type(s) to enable.
94 internal void EnableGestureDetection(Gesture.GestureType type)
96 viewWrapperImpl.EnableGestureDetection(type);
100 * @brief Allows deriving classes to disable any of the gesture detectors.
102 * Like EnableGestureDetection, this can also be called using bitwise or.
103 * @param[in] type The gesture type(s) to disable.
104 * @see EnableGetureDetection
106 internal void DisableGestureDetection(Gesture.GestureType type)
108 viewWrapperImpl.DisableGestureDetection(type);
112 /// Sets whether this control supports two dimensional keyboard navigation
113 /// (i.e. whether it knows how to handle the keyboard focus movement between its child actors).
114 /// The control doesn't support it by default.
116 /// <param name="isSupported">Whether this control supports two dimensional keyboard navigation.</param>
117 public bool FocusNavigationSupport
121 return IsKeyboardNavigationSupported();
125 SetKeyboardNavigationSupport(value);
129 internal void SetKeyboardNavigationSupport(bool isSupported)
131 viewWrapperImpl.SetKeyboardNavigationSupport(isSupported);
136 * @brief Gets whether this control supports two dimensional keyboard navigation.
138 * @return true if this control supports two dimensional keyboard navigation.
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 public bool FocusGroup
154 return IsKeyboardFocusGroup();
158 SetAsKeyboardFocusGroup(value);
163 * @brief Sets whether this control is a focus group for keyboard navigation.
165 * (i.e. the scope of keyboard focus movement
166 * can be limitied to its child actors). The control is not a focus group by default.
167 * @param[in] isFocusGroup Whether this control is set as a focus group for keyboard navigation.
169 internal void SetAsKeyboardFocusGroup(bool isFocusGroup)
171 viewWrapperImpl.SetAsKeyboardFocusGroup(isFocusGroup);
175 * @brief Gets whether this control is a focus group for keyboard navigation.
177 * @return true if this control is set as a focus group for keyboard navigation.
179 internal bool IsKeyboardFocusGroup()
181 return viewWrapperImpl.IsKeyboardFocusGroup();
185 * @brief Called by the AccessibilityManager to activate the Control.
188 internal void AccessibilityActivate()
190 viewWrapperImpl.AccessibilityActivate();
194 /// Called by the KeyboardFocusManager.
196 public void KeyboardEnter()
198 viewWrapperImpl.KeyboardEnter();
202 /// Called by the KeyInputFocusManager to emit key event signals.
204 /// <param name="key">The key event</param>
205 /// <returns>True if the event was consumed</returns>
206 public bool EmitKeyEventSignal(Key key)
208 return viewWrapperImpl.EmitKeyEventSignal(key);
212 * @brief Request a relayout, which means performing a size negotiation on this actor, its parent and children (and potentially whole scene).
214 * This method can also be called from a derived class every time it needs a different size.
215 * At the end of event processing, the relayout process starts and
216 * all controls which requested Relayout will have their sizes (re)negotiated.
218 * @note RelayoutRequest() can be called multiple times; the size negotiation is still
219 * only performed once, i.e. there is no need to keep track of this in the calling side.
221 protected void RelayoutRequest()
223 viewWrapperImpl.RelayoutRequest();
227 * @brief Provides the Actor implementation of GetHeightForWidth.
228 * @param width Width to use.
229 * @return The height based on the width.
231 protected float GetHeightForWidthBase(float width)
233 return viewWrapperImpl.GetHeightForWidthBase(width);
237 * @brief Provides the Actor implementation of GetWidthForHeight.
238 * @param height Height to use.
239 * @return The width based on the height.
241 protected float GetWidthForHeightBase(float height)
243 return viewWrapperImpl.GetWidthForHeightBase(height);
247 * @brief Calculate the size for a child using the base actor object.
249 * @param[in] child The child actor to calculate the size for
250 * @param[in] dimension The dimension to calculate the size for. E.g. width or height
251 * @return Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found.
253 protected float CalculateChildSizeBase(Actor child, DimensionType dimension)
255 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
259 * @brief Determine if this actor is dependent on it's children for relayout from the base class.
261 * @param dimension The dimension(s) to check for
262 * @return Return if the actor is dependent on it's children.
264 protected bool RelayoutDependentOnChildrenBase(DimensionType dimension)
266 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
270 * @brief Determine if this actor is dependent on it's children for relayout from the base class.
272 * @param dimension The dimension(s) to check for
273 * @return Return if the actor is dependent on it's children.
275 protected bool RelayoutDependentOnChildrenBase()
277 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
281 * @brief Register a visual by Property Index, linking an Actor to visual when required.
282 * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
283 * No parenting is done during registration, this should be done by derived class.
285 * @param[in] index The Property index of the visual, used to reference visual
286 * @param[in] visual The visual to register
287 * @note Derived class should not call visual.SetOnStage(actor). It is the responsibility of the base class to connect/disconnect registered visual to stage.
288 * Use below API with enabled set to false if derived class wishes to control when visual is staged.
290 protected void RegisterVisual(int index, VisualBase visual)
292 viewWrapperImpl.RegisterVisual(index, visual);
296 * @brief Register a visual by Property Index, linking an Actor to visual when required.
297 * In the case of the visual being an actor or control deeming visual not required then visual should be an empty handle.
298 * If enabled is false then the visual is not set on stage until enabled by the derived class.
301 * @param[in] index The Property index of the visual, used to reference visual
302 * @param[in] visual The visual to register
303 * @param[in] enabled false if derived class wants to control when visual is set on stage.
306 protected void RegisterVisual(int index, VisualBase visual, bool enabled)
308 viewWrapperImpl.RegisterVisual(index, visual, enabled);
312 * @brief Erase the entry matching the given index from the list of registered visuals
313 * @param[in] index The Property index of the visual, used to reference visual
316 protected void UnregisterVisual(int index)
318 viewWrapperImpl.UnregisterVisual(index);
322 * @brief Retrieve the visual associated with the given property index.
324 * @param[in] index The Property index of the visual.
325 * @return The registered visual if exist, otherwise empty handle.
326 * @note For managing object life-cycle, do not store the returned visual as a member which increments its reference count.
328 protected VisualBase GetVisual(int index)
330 return viewWrapperImpl.GetVisual(index);
334 * @brief Sets the given visual to be displayed or not when parent staged.
336 * @param[in] index The Property index of the visual
337 * @param[in] enable flag to set enabled or disabled.
339 protected void EnableVisual(int index, bool enable)
341 viewWrapperImpl.EnableVisual(index, enable);
345 * @brief Queries if the given visual is to be displayed when parent staged.
347 * @param[in] index The Property index of the visual
348 * @return bool whether visual is enabled or not
350 protected bool IsVisualEnabled(int index)
352 return viewWrapperImpl.IsVisualEnabled(index);
356 * @brief Create a transition effect on the control.
358 * @param[in] transitionData The transition data describing the effect to create
359 * @return A handle to an animation defined with the given effect, or an empty
360 * handle if no properties match.
362 protected Animation CreateTransition(TransitionData transitionData)
364 return viewWrapperImpl.CreateTransition(transitionData);
368 * @brief Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal
370 * Should be called last by the control after it acts on the Input Focus change.
372 * @param[in] focusGained True if gained, False if lost
374 protected void EmitKeyInputFocusSignal(bool focusGained)
376 viewWrapperImpl.EmitKeyInputFocusSignal(focusGained);
380 * @brief This method is called after the Control has been initialized.
382 * Derived classes should do any second phase initialization by overriding this method.
384 public virtual void OnInitialize()
389 * @brief Called after the actor has been connected to the stage.
391 * When an actor is connected, it will be directly or indirectly parented to the root Actor.
392 * @param[in] depth The depth in the hierarchy for the actor
394 * @note The root Actor is provided automatically by Dali::Stage, and is always considered to be connected.
395 * When the parent of a set of actors is connected to the stage, then all of the children
396 * will received this callback.
397 * For the following actor tree, the callback order will be A, B, D, E, C, and finally F.
408 * @param[in] depth The depth in the hierarchy for the actor
410 public virtual void OnStageConnection(int depth)
415 * @brief Called after the actor has been disconnected from Stage.
417 * If an actor is disconnected it either has no parent, or is parented to a disconnected actor.
419 * @note When the parent of a set of actors is disconnected to the stage, then all of the children
420 * will received this callback, starting with the leaf actors.
421 * For the following actor tree, the callback order will be D, E, B, F, C, and finally A.
433 public virtual void OnStageDisconnection()
438 * @brief Called after a child has been added to the owning actor.
440 * @param[in] child The child which has been added
442 public virtual void OnChildAdd(Actor actor)
447 * @brief Called after the owning actor has attempted to remove a child( regardless of whether it succeeded or not ).
449 * @param[in] child The child being removed
451 public virtual void OnChildRemove(Actor actor)
456 * @brief Called when the owning actor property is set.
458 * @param[in] index The Property index that was set
459 * @param[in] propertyValue The value to set
461 public virtual void OnPropertySet(int index, Tizen.NUI.PropertyValue propertyValue)
466 * @brief Called when the owning actor's size is set e.g. using Actor::SetSize().
468 * @param[in] targetSize The target size. Note that this target size may not match the size returned via Actor.GetTargetSize.
470 public virtual void OnSizeSet(Vector3 targetSize)
475 * @brief Called when the owning actor's size is animated e.g. using Animation::AnimateTo( Property( actor, Actor::Property::SIZE ), ... ).
477 * @param[in] animation The object which is animating the owning actor.
478 * @param[in] targetSize The target size. Note that this target size may not match the size returned via @ref Actor.GetTargetSize.
480 public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize)
485 * @DEPRECATED_1_1.37 Connect to TouchSignal() instead.
487 * @brief Called after a touch-event is received by the owning actor.
489 * @param[in] touch The touch event
490 * @return True if the event should be consumed.
491 * @note CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
493 public virtual bool OnTouch(Touch touch)
495 return false; // Do not consume
499 * @brief Called after a hover-event is received by the owning actor.
501 * @param[in] hover The hover event
502 * @return True if the hover event should be consumed.
503 * @note CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
505 public virtual bool OnHover(Hover hover)
507 return false; // Do not consume
511 * @brief Called after a key-event is received by the actor that has had its focus set.
513 * @param[in] key the Key Event
514 * @return True if the event should be consumed.
516 public virtual bool OnKey(Key key)
518 return false; // Do not consume
522 * @brief Called after a wheel-event is received by the owning actor.
524 * @param[in] wheel The wheel event
525 * @return True if the event should be consumed.
526 * @note CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
528 public virtual bool OnWheel(Wheel wheel)
530 return false; // Do not consume
534 * @brief Called after the size negotiation has been finished for this control.
536 * The control is expected to assign this given size to itself/its children.
538 * Should be overridden by derived classes if they need to layout
539 * actors differently after certain operations like add or remove
540 * actors, resize or after changing specific properties.
542 * @param[in] size The allocated size.
543 * @param[in,out] container The control should add actors to this container that it is not able
544 * to allocate a size for.
545 * @note As this function is called from inside the size negotiation algorithm, you cannot
546 * call RequestRelayout (the call would just be ignored).
548 public virtual void OnRelayout(Vector2 size, RelayoutContainer container)
553 * @brief Notification for deriving classes
555 * @param[in] policy The policy being set
556 * @param[in] dimension The dimension the policy is being set for
558 public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension)
563 * @brief Return the natural size of the actor.
565 * @return The actor's natural size
567 public virtual Size GetNaturalSize()
569 return new Size(0.0f, 0.0f, 0.0f);
573 * @brief Calculate the size for a child.
575 * @param[in] child The child actor to calculate the size for
576 * @param[in] dimension The dimension to calculate the size for. E.g. width or height.
577 * @return Return the calculated size for the given dimension.
579 public virtual float CalculateChildSize(Actor child, DimensionType dimension)
581 return viewWrapperImpl.CalculateChildSizeBase(child, dimension);
585 * @brief This method is called during size negotiation when a height is required for a given width.
587 * Derived classes should override this if they wish to customize the height returned.
589 * @param width Width to use.
590 * @return The height based on the width.
592 public virtual float GetHeightForWidth(float width)
594 return viewWrapperImpl.GetHeightForWidthBase(width);
598 * @brief This method is called during size negotiation when a width is required for a given height.
600 * Derived classes should override this if they wish to customize the width returned.
602 * @param height Height to use.
603 * @return The width based on the width.
605 public virtual float GetWidthForHeight(float height)
607 return viewWrapperImpl.GetWidthForHeightBase(height);
611 * @brief Determine if this actor is dependent on it's children for relayout.
613 * @param dimension The dimension(s) to check for
614 * @return Return if the actor is dependent on it's children.
616 public virtual bool RelayoutDependentOnChildren(DimensionType dimension)
618 return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension);
622 * @brief Determine if this actor is dependent on it's children for relayout from the base class.
624 * @return Return if the actor is dependent on it's children.
626 public virtual bool RelayoutDependentOnChildren()
628 return viewWrapperImpl.RelayoutDependentOnChildrenBase();
632 * @brief Virtual method to notify deriving classes that relayout dependencies have been
633 * met and the size for this object is about to be calculated for the given dimension
635 * @param dimension The dimension that is about to be calculated
637 public virtual void OnCalculateRelayoutSize(DimensionType dimension)
642 * @brief Virtual method to notify deriving classes that the size for a dimension
643 * has just been negotiated
645 * @param[in] size The new size for the given dimension
646 * @param[in] dimension The dimension that was just negotiated
648 public virtual void OnLayoutNegotiated(float size, DimensionType dimension)
653 * @brief This method should be overridden by deriving classes requiring notifications when the style changes.
655 * @param[in] styleManager The StyleManager object.
656 * @param[in] change Information denoting what has changed.
658 public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change)
663 * @brief This method is called when the control is accessibility activated.
665 * Derived classes should override this to perform custom accessibility activation.
666 * @return true if this control can perform accessibility activation.
668 internal virtual bool OnAccessibilityActivated()
674 * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
677 * @param[in] gesture The pan gesture.
678 * @return true if the pan gesture has been consumed by this control
680 internal virtual bool OnAccessibilityPan(PanGesture gestures)
686 * @brief This method should be overridden by deriving classes when they wish to respond the accessibility
689 * @param[in] touch The touch event.
690 * @return true if the touch event has been consumed by this control
692 internal virtual bool OnAccessibilityTouch(Touch touch)
698 * @brief This method should be overridden by deriving classes when they wish to respond
699 * the accessibility up and down action (i.e. value change of slider control).
701 * @param[in] isIncrease Whether the value should be increased or decreased
702 * @return true if the value changed action has been consumed by this control
704 internal virtual bool OnAccessibilityValueChange(bool isIncrease)
710 * @brief This method should be overridden by deriving classes when they wish to respond
711 * the accessibility zoom action.
713 * @return true if the zoom action has been consumed by this control
715 internal virtual bool OnAccessibilityZoom()
721 * @brief This method should be overridden by deriving classes when they wish to respond
722 * the accessibility zoom action.
724 * @return true if the zoom action has been consumed by this control
726 public virtual void OnKeyInputFocusGained()
731 * @brief Called when the control loses key input focus.
733 * Should be overridden by derived classes if they need to customize what happens when focus is lost.
735 public virtual void OnKeyInputFocusLost()
740 * @brief Gets the next keyboard focusable actor in this control towards the given direction.
742 * A control needs to override this function in order to support two dimensional keyboard navigation.
743 * @param[in] currentFocusedActor The current focused actor.
744 * @param[in] direction The direction to move the focus towards.
745 * @param[in] loopEnabled Whether the focus movement should be looped within the control.
746 * @return the next keyboard focusable actor in this control or an empty handle if no actor can be focused.
748 public virtual Actor GetNextKeyboardFocusableActor(Actor currentFocusedActor, View.FocusDirection direction, bool loopEnabled)
754 * @brief Informs this control that its chosen focusable actor will be focused.
756 * This allows the application to preform any actions if wishes
757 * before the focus is actually moved to the chosen actor.
759 * @param[in] commitedFocusableActor The commited focusable actor.
761 public virtual void OnKeyboardFocusChangeCommitted(Actor commitedFocusableActor)
766 * @brief This method is called when the control has enter pressed on it.
768 * Derived classes should override this to perform custom actions.
769 * @return true if this control supported this action.
771 public virtual bool OnKeyboardEnter()
777 * @brief Called whenever a pinch gesture is detected on this control.
779 * This can be overridden by deriving classes when pinch detection
780 * is enabled. The default behaviour is to scale the control by the
783 * @param[in] pinch The pinch gesture.
784 * @note If overridden, then the default behaviour will not occur.
785 * @note Pinch detection should be enabled via EnableGestureDetection().
786 * @see EnableGestureDetection
788 internal virtual void OnPinch(PinchGesture pinch)
793 * @brief Called whenever a pan gesture is detected on this control.
795 * This should be overridden by deriving classes when pan detection
798 * @param[in] pan The pan gesture.
799 * @note There is no default behaviour with panning.
800 * @note Pan detection should be enabled via EnableGestureDetection().
801 * @see EnableGestureDetection
803 public virtual void OnPan(PanGesture pan)
808 * @brief Called whenever a tap gesture is detected on this control.
810 * This should be overridden by deriving classes when tap detection
813 * @param[in] tap The tap gesture.
814 * @note There is no default behaviour with a tap.
815 * @note Tap detection should be enabled via EnableGestureDetection().
816 * @see EnableGestureDetection
818 internal virtual void OnTap(TapGesture tap)
823 * @brief Called whenever a long press gesture is detected on this control.
825 * This should be overridden by deriving classes when long press
826 * detection is enabled.
828 * @param[in] longPress The long press gesture.
829 * @note There is no default behaviour associated with a long press.
830 * @note Long press detection should be enabled via EnableGestureDetection().
831 * @see EnableGestureDetection
833 internal virtual void OnLongPress(LongPressGesture longPress)
837 private void OnControlChildAdd(Actor child)
841 private void OnControlChildRemove(Actor child)
845 public enum CustomViewBehaviour
847 ViewBehaviourDefault = 0,
848 DisableSizeNegotiation = 1 << 0,
849 RequiresKeyboardNavigationSupport = 1 << 5,
850 DisableStyleChangeSignals = 1 << 6,
851 LastViewBehaviourFlag